diff --git a/gb.qt4/src/CMenu.cpp b/gb.qt4/src/CMenu.cpp index 605ef26f0..6078dc26b 100644 --- a/gb.qt4/src/CMenu.cpp +++ b/gb.qt4/src/CMenu.cpp @@ -327,7 +327,7 @@ BEGIN_METHOD(Menu_new, GB_OBJECT parent; GB_BOOLEAN hidden) if (!menu->menu) { - menu->menu = new QMenu(); + menu->menu = new MyMenu(); menu->menu->setSeparatorsCollapsible(true); ((QAction *)(menu->widget.widget))->setMenu(menu->menu); @@ -1051,3 +1051,12 @@ void CMenu::slotDestroyed(void) #endif } +//--------------------------------------------------------------------------- + +void MyMenu::setVisible(bool visible) +{ + if (!visible) + setAttribute(Qt::WA_NoMouseReplay); + QMenu::setVisible(visible); +} + diff --git a/gb.qt4/src/CMenu.h b/gb.qt4/src/CMenu.h index cc834665c..feb7f9127 100644 --- a/gb.qt4/src/CMenu.h +++ b/gb.qt4/src/CMenu.h @@ -115,6 +115,13 @@ public slots: void slotHidden(); }; +class MyMenu: public QMenu +{ +public: + + virtual void setVisible(bool visible); +}; + void CMENU_popup(CMENU *_object, const QPoint &pos); #endif