-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMenu.cpp
More file actions
47 lines (26 loc) · 776 Bytes
/
Copy pathMenu.cpp
File metadata and controls
47 lines (26 loc) · 776 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
#include "Menu.h"
#include <qmenu.h>
#include "QLineEdit"
#include "QWidgetAction"
#include "qdebug.h"
Menu::Menu(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
menu.addSection(QIcon(":/Menu/gamer"), "Widget Menu Section");
menu.addAction(QIcon(":/Menu/gamer"), "Options");
menu.addAction("Exit");
menu.addSection("Widget Menu Section");
QWidgetAction* action = new QWidgetAction(&menu);
action->setDefaultWidget(new QLineEdit());
menu.addAction(action);
qDebug() << menu.isTearOffEnabled();
if (!menu.isTearOffEnabled()) {
menu.setTearOffEnabled(true);
}
}
void Menu::contextMenuEvent(QContextMenuEvent* event)
{
//throw std::logic_error("The method or operation is not implemented.");
menu.exec(QCursor::pos());
}