-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.cpp
55 lines (46 loc) · 1.02 KB
/
Model.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "Model.h"
#include <QWidgetList>
#include <QtWidgets/qwidget.h>
#include <QWindow>
Model* Model::m_instance = nullptr;
Model *Model::instance()
{
if(m_instance == nullptr){
m_instance = new Model();
}
return m_instance;
}
void Model::testFunc(int caseIndex, QString extraData)
{
LOG << "caseIndex: " << caseIndex << " --- ExtraData: " << extraData;
emit requestTestCase(caseIndex);
}
int Model::widthDisplay() const
{
return m_widthDisplay;
}
void Model::setWidthDisplay(const int width)
{
LOG << "width: " << width;
if(width != m_widthDisplay){
m_widthDisplay = width;
emit widthDisplayChanged();
}
}
int Model::heightDisplay() const
{
return m_heightDisplay;
}
void Model::setHeightDisplay(const int height)
{
LOG << "height: " << height;
if(height != m_heightDisplay){
m_heightDisplay = height;
emit heightDisplayChanged();
}
}
Model::Model(QObject *parent) : QObject(parent)
{
m_widthDisplay = 0;
m_heightDisplay = 0;
}