Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / qmlview / qmlviewgadget.cpp
blob0bc9eca42aeb169b4de8aacb3e04dbf7e9ec8155
1 /**
2 ******************************************************************************
4 * @file qmlviewgadget.cpp
5 * @author Edouard Lafargue Copyright (C) 2010.
6 * @author Dmytro Poplavskiy Copyright (C) 2012.
7 * @addtogroup GCSPlugins GCS Plugins
8 * @{
9 * @addtogroup OPMapPlugin QML Viewer Plugin
10 * @{
11 * @brief The QML Viewer Gadget
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "qmlviewgadget.h"
30 #include "qmlviewgadgetwidget.h"
31 #include "qmlviewgadgetconfiguration.h"
33 QmlViewGadget::QmlViewGadget(QString classId, QmlViewGadgetWidget *widget, QWidget *parent) :
34 IUAVGadget(classId, parent),
35 m_widget(widget)
37 m_container = NULL;
38 m_parent = parent;
41 QmlViewGadget::~QmlViewGadget()
43 delete m_widget;
47 This is called when a configuration is loaded, and updates the plugin's settings.
48 Careful: the plugin is already drawn before the loadConfiguration method is called the
49 first time, so you have to be careful not to assume all the plugin values are initialized
50 the first time you use them
52 void QmlViewGadget::loadConfiguration(IUAVGadgetConfiguration *config)
54 QmlViewGadgetConfiguration *m = qobject_cast<QmlViewGadgetConfiguration *>(config);
56 m_widget->setQmlFile(m->dialFile());
57 m_widget->enableOpenGL(m->useOpenGL());