forked from gort818/qtwebflix
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmenuaction.cpp
More file actions
40 lines (32 loc) · 814 Bytes
/
menuaction.cpp
File metadata and controls
40 lines (32 loc) · 814 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
#include "menuaction.h"
#include <QUrl>
#include <QString>
MenuAction::MenuAction(QString title, QString urlStr, bool separator) {
this->title = title;
this->action = QUrl(urlStr);
this->icon = QString("");
this->separator = separator;
}
MenuAction::~MenuAction() {
}
MenuAction::MenuAction(QString title, QString urlStr, QString iconName, bool separator) {
this->title = title;
this->action = QUrl(urlStr);
this->icon = iconName;
this->separator = separator;
}
QString MenuAction::getTitle() {
return this->title;
}
QIcon MenuAction::getIcon() {
return QIcon::fromTheme(icon);
}
QUrl MenuAction::getUrl() {
return this->action;
}
bool MenuAction::hasIcon() {
return this->icon.length() > 0;
}
bool MenuAction::hasSeparator() {
return this->separator;
}