-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactionfactory.cpp
More file actions
48 lines (41 loc) · 1.2 KB
/
actionfactory.cpp
File metadata and controls
48 lines (41 loc) · 1.2 KB
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
#include "actionfactory.h"
#include <QMenu>
#include <QAction>
static ActionFactory *instance = nullptr;
ActionFactory::ActionFactory(){}
void ActionFactory::initialize(QObject *parent){
static bool initialized = false;
if(!initialized){
instance = new ActionFactory;
instance->setParent(parent);
initialized = true;
}
}
QAction *ActionFactory::actionShow(){
static QAction* action = new QAction("Show",instance);
return action;
}
QAction *ActionFactory::actionSettings(){
static QAction* action = new QAction("Settings",instance);
return action;
}
QMenu *ActionFactory::defaultMenu(){
static QMenu* menu = new QMenu(nullptr);
return menu;
}
QAction *ActionFactory::actionExit(){
static QAction* action = new QAction("Exit",instance);
return action;
}
QAction *ActionFactory::actionStart(){
static QAction* action = new QAction("Start",instance);
return action;
}
QAction *ActionFactory::actionStop(){
static QAction* action = new QAction("Stop",instance);
return action;
}
QAction *ActionFactory::actionPause(){
static QAction* action = new QAction("Pause",instance);
return action;
}