CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
qmlexecutor_p.h
Go to the documentation of this file.
1#ifndef QMLEXECUTOR_P_H
2#define QMLEXECUTOR_P_H
3
4#include <memory>
5
6#include <QObject>
7
9#include "qmlexecutor.h"
10#include "propertyfields.h"
11
12class QMLExecutor;
13class CANBusModel;
14
18class QMLExecutorPrivate : public QObject {
19 Q_OBJECT
20 Q_DECLARE_PUBLIC(QMLExecutor)
21
22public:
30
31public: // ComponentInterface inheritance
36
40 QJsonObject getSettings();
41
45 void setSettings(const QJsonObject& json);
46
50 void configChanged();
51
55 void startSimulation();
56
60 void stopSimulation();
61
65 void updateUIColor();
66
67public slots:
72 void setCANBusModel(CANBusModel* model);
73
78 void QMLLoaded(const QUrl& url);
79
80private:
85 void initProps();
86
87public:
89 bool _simStarted{ false };
94
96 bool _docked{ true };
97
99 std::map<QString, QVariant> _props;
100
101private:
102 QMLExecutor* q_ptr;
103 const QString _nameProperty = "name";
104 const QString _fileProperty = "QML file";
105 CANBusModel* _model;
106
107
108 // workaround for clang 3.5
110
111 // clang-format off
113 std::make_tuple(_nameProperty, QVariant::String, true, cf(nullptr)),
114 std::make_tuple(_fileProperty, QVariant::String, true, cf([] { return new PropertyFieldPath; } ))
115 };
116 // clang-format on
117};
118
119#endif // QMLEXECUTOR_P_H
The CANBusModel class is used to interface CAN operations with QML stack.
Definition canbusmodel.hpp:11
QMLExecutor plugin gui implementation.
Definition qmlexecutorguiimpl.h:29
Interface of gui for QMLExecutor plugin.
Definition qmlexecutorguiint.h:16
Definition qmlexecutor.h:23
QMLExecutor plugin private implementation.
Definition qmlexecutor_p.h:18
bool _simStarted
Simulation started flag.
Definition qmlexecutor_p.h:89
void startSimulation()
start simulation handler
Definition qmlexecutor_p.cpp:79
void configChanged()
Definition qmlexecutor_p.cpp:61
QMLExecutorGuiInt & _ui
gui
Definition qmlexecutor_p.h:93
ComponentInterface::ComponentProperties getSupportedProperties() const
Definition qmlexecutor_p.cpp:35
QMLExecutorCtx _ctx
ioc/iod container for a gui
Definition qmlexecutor_p.h:91
void setSettings(const QJsonObject &json)
Definition qmlexecutor_p.cpp:51
bool _docked
not used
Definition qmlexecutor_p.h:96
void setCANBusModel(CANBusModel *model)
Sets a can bus model used in QML.
Definition qmlexecutor_p.cpp:68
QJsonObject getSettings()
Definition qmlexecutor_p.cpp:40
std::map< QString, QVariant > _props
plugin properties
Definition qmlexecutor_p.h:99
~QMLExecutorPrivate()
Definition qmlexecutor_p.cpp:22
void updateUIColor()
used to align empty QQuickWidget color with current color scheme
Definition qmlexecutor_p.cpp:95
void stopSimulation()
stop simulation handler
Definition qmlexecutor_p.cpp:87
void QMLLoaded(const QUrl &url)
QMLLoaded slot used for notification of QML load.
Definition qmlexecutor_p.cpp:74
Context< QMLExecutorGuiInt > QMLExecutorCtx
single instance ioc/iod container
Definition qmlexecutor.h:18
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
std::function< QWidget *(void)> CustomEditFieldCbk
Definition componentinterface.h:64
Definition propertyfields.h:49