-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.h
More file actions
50 lines (46 loc) · 1022 Bytes
/
action.h
File metadata and controls
50 lines (46 loc) · 1022 Bytes
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
#ifndef ACTION_H
#define ACTION_H
#include <QHash>
#include <QAction>
#include <QVariant>
#include "utilsexport.h"
#include "menu.h"
#include "iconstorage.h"
class Menu;
class UTILS_EXPORT Action :
public QAction
{
Q_OBJECT
public:
enum DataRoles {
DR_Parametr1,
DR_Parametr2,
DR_Parametr3,
DR_Parametr4,
DR_StreamJid,
DR_SortString,
DR_UserDefined = 64
};
public:
Action(QObject *AParent = NULL);
~Action();
//QAction
Menu *menu() const;
void setMenu(Menu *AMenu);
void setIcon(const QIcon &AIcon);
void setIcon(const QString &AStorageName, const QString &AIconKey, int AIconIndex = 0);
//Action
QVariant data(int ARole) const;
void setData(int ARole, const QVariant &AData);
void setData(const QHash<int,QVariant> &AData);
signals:
void actionDestroyed(Action *AAction);
protected slots:
void onMenuDestroyed(Menu *AMenu);
private:
Menu *FMenu;
IconStorage *FIconStorage;
private:
QHash<int,QVariant> FData;
};
#endif // ACTION_H