##// END OF EJS Templates
Adds icon for 'Plot' menu
Alexandre Leroux -
r322:e195db267c87
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
@@ -27,8 +27,9 public:
27 27 /**
28 28 * Adds a new menu to the current menu
29 29 * @param name the name of the menu
30 * @param icon the icon of the menu (can be null)
30 31 */
31 void addMenu(const QString &name);
32 void addMenu(const QString &name, const QIcon &icon = {});
32 33
33 34 /// Adds a separator to the current menu. The separator is added only if the menu already
34 35 /// contains entries
@@ -3,6 +3,7
3 3 <file>icones/delete.png</file>
4 4 <file>icones/openInspector.png</file>
5 5 <file>icones/next.png</file>
6 <file>icones/plot.png</file>
6 7 <file>icones/previous.png</file>
7 8 </qresource>
8 9 </RCC>
@@ -21,7 +21,7 struct GenerateVariableMenuOperation::GenerateVariableMenuOperationPrivate {
21 21 void visitRootEnter()
22 22 {
23 23 // Creates the root menu
24 m_MenuBuilder.addMenu(QObject::tr("Plot"));
24 m_MenuBuilder.addMenu(QObject::tr("Plot"), QIcon{":/icones/plot.png"});
25 25 }
26 26
27 27 void visitRootLeave()
@@ -12,10 +12,10 MenuBuilder::MenuBuilder(QMenu *menu)
12 12 }
13 13 }
14 14
15 void MenuBuilder::addMenu(const QString &name)
15 void MenuBuilder::addMenu(const QString &name, const QIcon &icon)
16 16 {
17 17 if (auto currMenu = currentMenu()) {
18 m_Menus.push(currMenu->addMenu(name));
18 m_Menus.push(currMenu->addMenu(icon, name));
19 19 }
20 20 else {
21 21 qCCritical(LOG_MenuBuilder()) << QObject::tr("No current menu to attach the new menu");
General Comments 0
You need to be logged in to leave comments. Login now