dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
qmlviewgadgetoptionspage.cpp
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
29 #include "ui_qmlviewgadgetoptionspage.h"
33 
34 #include <QtAlgorithms>
35 #include <QStringList>
36 
38  QObject *parent)
39  : IOptionsPage(parent)
40  , m_config(config)
41 {
42 }
43 
44 // creates options page widget (uses the UI file)
45 QWidget *QmlViewGadgetOptionsPage::createPage(QWidget *parent)
46 {
47  Q_UNUSED(parent);
48 
49  options_page = new Ui::QmlViewGadgetOptionsPage();
50  // main widget
51  QWidget *optionsPageWidget = new QWidget;
52  // main layout
53  options_page->setupUi(optionsPageWidget);
54 
55  // Restore the contents from the settings:
56  options_page->svgSourceFile->setExpectedKind(Utils::PathChooser::File);
57  options_page->svgSourceFile->setPromptDialogFilter(tr("QML file (*.qml)"));
58  options_page->svgSourceFile->setPromptDialogTitle(tr("Choose QML file"));
59  options_page->svgSourceFile->setPath(m_config->dialFile());
60 
61  return optionsPageWidget;
62 }
63 
71 {
72  m_config->setDialFile(options_page->svgSourceFile->path());
73 }
74 
76 {
77 }
QWidget * createPage(QWidget *parent)
QmlViewGadgetOptionsPage(QmlViewGadgetConfiguration *config, QObject *parent=nullptr)