dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
pfdqmlgadget.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10  * for more details.
11  *
12  * You should have received a copy of the GNU General Public License along
13  * with this program; if not, see <http://www.gnu.org/licenses/>
14  */
15 
16 #include "pfdqmlgadget.h"
17 #include "pfdqmlgadgetwidget.h"
19 
20 #include "utils/pathutils.h"
21 
22 PfdQmlGadget::PfdQmlGadget(QString classId, PfdQmlGadgetWidget *widget, QWidget *parent)
23  : IUAVGadget(classId, parent)
24  , m_widget(widget)
25 {
26  m_container = NULL;
27  m_parent = parent;
28 }
29 
31 {
32  m_widget->deleteLater();
33 }
34 
35 /*
36  This is called when a configuration is loaded, and updates the plugin's settings.
37  Careful: the plugin is already drawn before the loadConfiguration method is called the
38  first time, so you have to be careful not to assume all the plugin values are initialized
39  the first time you use them
40  */
41 void PfdQmlGadget::loadConfiguration(IUAVGadgetConfiguration *config)
42 {
43  PfdQmlGadgetConfiguration *m = qobject_cast<PfdQmlGadgetConfiguration *>(config);
44  m_widget->setQmlFile(m->qmlFile());
45  m_widget->setSettingsMap(m->settings());
46 }
void setSettingsMap(const QVariantMap &settings)
PfdQmlGadget(QString classId, PfdQmlGadgetWidget *widget, QWidget *parent=nullptr)
void setQmlFile(QString fn)
void loadConfiguration(IUAVGadgetConfiguration *config)