CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
guimock.h
Go to the documentation of this file.
1#ifndef GUIMOC_H
2#define GUIMOC_H
3
4#include <catch.hpp>
5#include <context.h>
6#include <fakeit.hpp>
7
9
14{
15 Q_OBJECT
16public:
17 GuiMock(QObject* parent = nullptr)
18 : QMLExecutorGuiInt(parent)
19 { }
20
21public:
22 void loadQML(const QUrl& url) override
23 {
24 mock.get().loadQML(url);
25 }
26
27 void setModel(CANBusModel* model) override
28 {
29 mock.get().setModel(model);
30 }
31
32 QWidget* mainWidget() override
33 {
34 return mock.get().mainWidget();
35 }
36
37 void updateUIColor() override
38 {
39 return mock.get().updateUIColor();
40 }
41
42public:
43 fakeit::Mock<QMLExecutorGuiInt> mock;
44};
45
46#endif
The CANBusModel class is used to interface CAN operations with QML stack.
Definition canbusmodel.hpp:11
fakeit is broken so wrap broken solution to get it working with qt signals
Definition guimock.h:14
void updateUIColor() override
used to align empty QQuickWidget color with current color scheme
Definition guimock.h:37
QWidget * mainWidget() override
not used, return main widget for ui
Definition guimock.h:32
void setModel(CANBusModel *model) override
sets can bus model pointer
Definition guimock.h:27
fakeit::Mock< QMLExecutorGuiInt > mock
Definition guimock.h:43
void loadQML(const QUrl &url) override
Definition guimock.h:22
GuiMock(QObject *parent=nullptr)
Definition guimock.h:17
Interface of gui for QMLExecutor plugin.
Definition qmlexecutorguiint.h:16