diff --git a/gb.qt4/src/CMenu.cpp b/gb.qt4/src/CMenu.cpp index b0c99695b..a2091fe9e 100644 --- a/gb.qt4/src/CMenu.cpp +++ b/gb.qt4/src/CMenu.cpp @@ -340,6 +340,7 @@ BEGIN_METHOD(Menu_new, GB_OBJECT parent; GB_BOOLEAN hidden) action = new MyAction(menu->menu); action->setSeparator(true); + QObject::connect(action, SIGNAL(toggled(bool)), &CMenu::manager, SLOT(slotToggled(bool))); QObject::connect(action, SIGNAL(destroyed()), &CMenu::manager, SLOT(slotDestroyed())); menu->menu->addAction(action); @@ -499,7 +500,9 @@ BEGIN_PROPERTY(Menu_Checked) else { if (READ_PROPERTY) - GB.ReturnBoolean(ACTION->isChecked()); + { + GB.ReturnBoolean(THIS->checked); + } else { THIS->checked = VPROP(GB_BOOLEAN); @@ -997,6 +1000,19 @@ void CMenu::unrefChildren(QWidget *w) } }*/ +void CMenu::slotToggled(bool checked) +{ + CMENU *_object = dict[(QAction *)sender()]; + + if (!_object) + return; + + if (!THIS->radio) + return; + + THIS->checked = checked; +} + void CMenu::slotDestroyed(void) { CMENU *_object = dict[(QAction *)sender()]; diff --git a/gb.qt4/src/CMenu.h b/gb.qt4/src/CMenu.h index 18f9fab05..d78c1e735 100644 --- a/gb.qt4/src/CMenu.h +++ b/gb.qt4/src/CMenu.h @@ -109,6 +109,7 @@ public: public slots: void slotTriggered(QAction *); + void slotToggled(bool); void slotDestroyed(); void slotShown(); void slotHidden();