[GB.QT4]
* BUG: The Menu.Checked property now returns the correct value for non-radio menu items. git-svn-id: svn://localhost/gambas/trunk@6604 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
26d4540cde
commit
d567669ae1
@ -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()];
|
||||
|
@ -109,6 +109,7 @@ public:
|
||||
public slots:
|
||||
|
||||
void slotTriggered(QAction *);
|
||||
void slotToggled(bool);
|
||||
void slotDestroyed();
|
||||
void slotShown();
|
||||
void slotHidden();
|
||||
|
Loading…
x
Reference in New Issue
Block a user