From 7d845b89a51e878e7bd7961f88574a061ee46bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 30 May 2015 13:26:17 +0000 Subject: [PATCH] [GB.QT5] * NEW: Dirty hack that disables the new Qt5 mouse click replayed after a popup has been closed. git-svn-id: svn://localhost/gambas/trunk@7106 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.qt4/src/CMenu.cpp | 11 ++++++++++- gb.qt4/src/CMenu.h | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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