I have a program which creates QMenu and adds QMenu to first menu. The program runs perfectly on qt4, but when I compile it with qt5, the submenu does not appear. Here is an example code:
QMenu *menu = this->menuBar()->addMenu("Menu");
QMenu *menu2 = menu->addMenu("Menu2");
QAction *act = menu2->addAction("act");
QSystemTrayIcon *qsti = new QSystemTrayIcon(this);
qsti->setContextMenu(menu);
qsti->show();
Menubar shows everything correctly but systemtrayicon fails to show submenu. Secreenshots:
Here, you can see that there is no submenu in the second picture(systemtray). Is there any workaround to solve this issue? I'm on Ubuntu 15.04 with Qt 5.4.1.
Step forward is:
Now it shows that there is action but on my Ubuntu it is displayed with some kind of bug. Can you try it?