@@ -0,0 +1,23 | |||
|
1 | #ifndef SCIQLOP_TIMEWIDGET_H | |
|
2 | #define SCIQLOP_TIMEWIDGET_H | |
|
3 | ||
|
4 | #include <QWidget> | |
|
5 | ||
|
6 | namespace Ui { | |
|
7 | class TimeWidget; | |
|
8 | } // Ui | |
|
9 | ||
|
10 | class TimeWidget; | |
|
11 | ||
|
12 | class TimeWidget : public QWidget { | |
|
13 | Q_OBJECT | |
|
14 | ||
|
15 | public: | |
|
16 | explicit TimeWidget(QWidget *parent = 0); | |
|
17 | virtual ~TimeWidget(); | |
|
18 | ||
|
19 | private: | |
|
20 | Ui::TimeWidget *ui; | |
|
21 | }; | |
|
22 | ||
|
23 | #endif // SCIQLOP_ SQPSIDEPANE_H |
@@ -0,0 +1,12 | |||
|
1 | #include "TimeWidget/TimeWidget.h" | |
|
2 | #include "ui_TimeWidget.h" | |
|
3 | ||
|
4 | TimeWidget::TimeWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::TimeWidget} | |
|
5 | { | |
|
6 | ui->setupUi(this); | |
|
7 | } | |
|
8 | ||
|
9 | TimeWidget::~TimeWidget() | |
|
10 | { | |
|
11 | delete ui; | |
|
12 | } |
@@ -0,0 +1,85 | |||
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
|
2 | <ui version="4.0"> | |
|
3 | <class>TimeWidget</class> | |
|
4 | <widget class="QWidget" name="TimeWidget"> | |
|
5 | <property name="geometry"> | |
|
6 | <rect> | |
|
7 | <x>0</x> | |
|
8 | <y>0</y> | |
|
9 | <width>716</width> | |
|
10 | <height>48</height> | |
|
11 | </rect> | |
|
12 | </property> | |
|
13 | <property name="sizePolicy"> | |
|
14 | <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | |
|
15 | <horstretch>0</horstretch> | |
|
16 | <verstretch>0</verstretch> | |
|
17 | </sizepolicy> | |
|
18 | </property> | |
|
19 | <property name="windowTitle"> | |
|
20 | <string>Form</string> | |
|
21 | </property> | |
|
22 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | |
|
23 | <item> | |
|
24 | <widget class="QLabel" name="label"> | |
|
25 | <property name="sizePolicy"> | |
|
26 | <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> | |
|
27 | <horstretch>0</horstretch> | |
|
28 | <verstretch>0</verstretch> | |
|
29 | </sizepolicy> | |
|
30 | </property> | |
|
31 | <property name="text"> | |
|
32 | <string>TStart :</string> | |
|
33 | </property> | |
|
34 | </widget> | |
|
35 | </item> | |
|
36 | <item> | |
|
37 | <widget class="QDateTimeEdit" name="startDateTimeEdit"> | |
|
38 | <property name="sizePolicy"> | |
|
39 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | |
|
40 | <horstretch>0</horstretch> | |
|
41 | <verstretch>0</verstretch> | |
|
42 | </sizepolicy> | |
|
43 | </property> | |
|
44 | <property name="displayFormat"> | |
|
45 | <string>dd/MM/yyyy HH:mm:ss:zzz</string> | |
|
46 | </property> | |
|
47 | <property name="calendarPopup"> | |
|
48 | <bool>true</bool> | |
|
49 | </property> | |
|
50 | </widget> | |
|
51 | </item> | |
|
52 | <item> | |
|
53 | <widget class="QLabel" name="label_2"> | |
|
54 | <property name="sizePolicy"> | |
|
55 | <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> | |
|
56 | <horstretch>0</horstretch> | |
|
57 | <verstretch>0</verstretch> | |
|
58 | </sizepolicy> | |
|
59 | </property> | |
|
60 | <property name="text"> | |
|
61 | <string>TEnd :</string> | |
|
62 | </property> | |
|
63 | </widget> | |
|
64 | </item> | |
|
65 | <item> | |
|
66 | <widget class="QDateTimeEdit" name="endDateTimeEdit"> | |
|
67 | <property name="sizePolicy"> | |
|
68 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | |
|
69 | <horstretch>0</horstretch> | |
|
70 | <verstretch>0</verstretch> | |
|
71 | </sizepolicy> | |
|
72 | </property> | |
|
73 | <property name="displayFormat"> | |
|
74 | <string>dd/MM/yyyy HH:mm:ss:zzz</string> | |
|
75 | </property> | |
|
76 | <property name="calendarPopup"> | |
|
77 | <bool>true</bool> | |
|
78 | </property> | |
|
79 | </widget> | |
|
80 | </item> | |
|
81 | </layout> | |
|
82 | </widget> | |
|
83 | <resources/> | |
|
84 | <connections/> | |
|
85 | </ui> |
@@ -1,53 +1,53 | |||
|
1 | 1 | #include <Variable/VariableController.h> |
|
2 | 2 | #include <Variable/VariableModel.h> |
|
3 | 3 | |
|
4 | 4 | #include <QMutex> |
|
5 | 5 | #include <QThread> |
|
6 | 6 | |
|
7 | 7 | Q_LOGGING_CATEGORY(LOG_VariableController, "VariableController") |
|
8 | 8 | |
|
9 | 9 | struct VariableController::VariableControllerPrivate { |
|
10 | 10 | explicit VariableControllerPrivate() |
|
11 | 11 | : m_WorkingMutex{}, m_VariableModel{std::make_unique<VariableModel>()} |
|
12 | 12 | { |
|
13 | 13 | } |
|
14 | 14 | |
|
15 | 15 | QMutex m_WorkingMutex; |
|
16 | 16 | std::unique_ptr<VariableModel> m_VariableModel; |
|
17 | 17 | }; |
|
18 | 18 | |
|
19 | 19 | VariableController::VariableController(QObject *parent) |
|
20 | 20 | : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>()} |
|
21 | 21 | { |
|
22 | qCDebug(LOG_VariableController()) | |
|
23 | << tr("VariableController construction") << QThread::currentThread(); | |
|
22 | qCDebug(LOG_VariableController()) << tr("VariableController construction") | |
|
23 | << QThread::currentThread(); | |
|
24 | 24 | } |
|
25 | 25 | |
|
26 | 26 | VariableController::~VariableController() |
|
27 | 27 | { |
|
28 | qCDebug(LOG_VariableController()) | |
|
29 | << tr("VariableController destruction") << QThread::currentThread(); | |
|
28 | qCDebug(LOG_VariableController()) << tr("VariableController destruction") | |
|
29 | << QThread::currentThread(); | |
|
30 | 30 | this->waitForFinish(); |
|
31 | 31 | } |
|
32 | 32 | |
|
33 | 33 | Variable *VariableController::createVariable(const QString &name) noexcept |
|
34 | 34 | { |
|
35 | 35 | return impl->m_VariableModel->createVariable(name); |
|
36 | 36 | } |
|
37 | 37 | |
|
38 | 38 | void VariableController::initialize() |
|
39 | 39 | { |
|
40 | 40 | qCDebug(LOG_VariableController()) << tr("VariableController init") << QThread::currentThread(); |
|
41 | 41 | impl->m_WorkingMutex.lock(); |
|
42 | 42 | qCDebug(LOG_VariableController()) << tr("VariableController init END"); |
|
43 | 43 | } |
|
44 | 44 | |
|
45 | 45 | void VariableController::finalize() |
|
46 | 46 | { |
|
47 | 47 | impl->m_WorkingMutex.unlock(); |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | void VariableController::waitForFinish() |
|
51 | 51 | { |
|
52 | 52 | QMutexLocker locker{&impl->m_WorkingMutex}; |
|
53 | 53 | } |
General Comments 0
You need to be logged in to leave comments.
Login now