##// END OF EJS Templates
Creates widget for "general settings" and registers it to the dialog
Alexandre Leroux -
r429:2ed0448c50bf
parent child
Show More
@@ -0,0 +1,24
1 #ifndef SCIQLOP_SQPSETTINGSGENERALWIDGET_H
2 #define SCIQLOP_SQPSETTINGSGENERALWIDGET_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class SqpSettingsGeneralWidget;
8 } // Ui
9
10 /**
11 * @brief The SqpSettingsGeneralWidget class represents the general settings of SciQlop
12 */
13 class SqpSettingsGeneralWidget : public QWidget {
14 Q_OBJECT
15
16 public:
17 explicit SqpSettingsGeneralWidget(QWidget *parent = 0);
18 virtual ~SqpSettingsGeneralWidget() noexcept;
19
20 private:
21 Ui::SqpSettingsGeneralWidget *ui;
22 };
23
24 #endif // SCIQLOP_SQPSETTINGSGENERALWIDGET_H
@@ -0,0 +1,14
1 #include "Settings/SqpSettingsGeneralWidget.h"
2
3 #include "ui_SqpSettingsGeneralWidget.h"
4
5 SqpSettingsGeneralWidget::SqpSettingsGeneralWidget(QWidget *parent)
6 : QWidget{parent}, ui{new Ui::SqpSettingsGeneralWidget}
7 {
8 ui->setupUi(this);
9 }
10
11 SqpSettingsGeneralWidget::~SqpSettingsGeneralWidget() noexcept
12 {
13 delete ui;
14 }
@@ -0,0 +1,86
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>SqpSettingsGeneralWidget</class>
4 <widget class="QWidget" name="SqpSettingsGeneralWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>343</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QGridLayout" name="gridLayout">
17 <item row="0" column="0">
18 <widget class="QLabel" name="toleranceInitLabel">
19 <property name="text">
20 <string>Tolerance on first acquisition:</string>
21 </property>
22 </widget>
23 </item>
24 <item row="0" column="1">
25 <widget class="QDoubleSpinBox" name="toleranceInitSpinBox">
26 <property name="sizePolicy">
27 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
28 <horstretch>0</horstretch>
29 <verstretch>0</verstretch>
30 </sizepolicy>
31 </property>
32 <property name="suffix">
33 <string> %</string>
34 </property>
35 <property name="minimum">
36 <double>0.000000000000000</double>
37 </property>
38 <property name="maximum">
39 <double>500.000000000000000</double>
40 </property>
41 </widget>
42 </item>
43 <item row="1" column="0">
44 <widget class="QLabel" name="toleranceUpdateLabel">
45 <property name="text">
46 <string>Tolerance when updating acquisition:</string>
47 </property>
48 </widget>
49 </item>
50 <item row="1" column="1">
51 <widget class="QDoubleSpinBox" name="toleranceUpdateSpinBox">
52 <property name="sizePolicy">
53 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
54 <horstretch>0</horstretch>
55 <verstretch>0</verstretch>
56 </sizepolicy>
57 </property>
58 <property name="suffix">
59 <string> %</string>
60 </property>
61 <property name="minimum">
62 <double>0.000000000000000</double>
63 </property>
64 <property name="maximum">
65 <double>500.000000000000000</double>
66 </property>
67 </widget>
68 </item>
69 <item row="2" column="0">
70 <spacer name="verticalSpacer">
71 <property name="orientation">
72 <enum>Qt::Vertical</enum>
73 </property>
74 <property name="sizeHint" stdset="0">
75 <size>
76 <width>20</width>
77 <height>40</height>
78 </size>
79 </property>
80 </spacer>
81 </item>
82 </layout>
83 </widget>
84 <resources/>
85 <connections/>
86 </ui>
@@ -25,6 +25,7
25 #include <DataSource/DataSourceController.h>
25 #include <DataSource/DataSourceController.h>
26 #include <DataSource/DataSourceWidget.h>
26 #include <DataSource/DataSourceWidget.h>
27 #include <Settings/SqpSettingsDialog.h>
27 #include <Settings/SqpSettingsDialog.h>
28 #include <Settings/SqpSettingsGeneralWidget.h>
28 #include <SidePane/SqpSidePane.h>
29 #include <SidePane/SqpSidePane.h>
29 #include <SqpApplication.h>
30 #include <SqpApplication.h>
30 #include <Time/TimeController.h>
31 #include <Time/TimeController.h>
@@ -59,12 +60,15 public:
59 explicit MainWindowPrivate(MainWindow *mainWindow)
60 explicit MainWindowPrivate(MainWindow *mainWindow)
60 : m_LastOpenLeftInspectorSize{},
61 : m_LastOpenLeftInspectorSize{},
61 m_LastOpenRightInspectorSize{},
62 m_LastOpenRightInspectorSize{},
63 m_GeneralSettingsWidget{new SqpSettingsGeneralWidget{mainWindow}},
62 m_SettingsDialog{new SqpSettingsDialog{mainWindow}}
64 m_SettingsDialog{new SqpSettingsDialog{mainWindow}}
63 {
65 {
64 }
66 }
65
67
66 QSize m_LastOpenLeftInspectorSize;
68 QSize m_LastOpenLeftInspectorSize;
67 QSize m_LastOpenRightInspectorSize;
69 QSize m_LastOpenRightInspectorSize;
70 /// General settings widget. MainWindow has the ownership
71 SqpSettingsGeneralWidget *m_GeneralSettingsWidget;
68 /// Settings dialog. MainWindow has the ownership
72 /// Settings dialog. MainWindow has the ownership
69 SqpSettingsDialog *m_SettingsDialog;
73 SqpSettingsDialog *m_SettingsDialog;
70 };
74 };
@@ -179,6 +183,14 MainWindow::MainWindow(QWidget *parent)
179 auto timeWidget = new TimeWidget{};
183 auto timeWidget = new TimeWidget{};
180 mainToolBar->addWidget(timeWidget);
184 mainToolBar->addWidget(timeWidget);
181
185
186 // //////// //
187 // Settings //
188 // //////// //
189
190 // Registers "general settings" widget to the settings dialog
191 impl->m_SettingsDialog->registerWidget(QStringLiteral("General"),
192 impl->m_GeneralSettingsWidget);
193
182 // /////////// //
194 // /////////// //
183 // Connections //
195 // Connections //
184 // /////////// //
196 // /////////// //
General Comments 0
You need to be logged in to leave comments. Login now