PDA

View Full Version : QMenu Multiple selection problem



vajindarladdad
25th February 2009, 13:58
Hi all Experts,
I am developing an application in which i am using QMenu.
I have added QActions into the menu , which are checkable.
My requirement is that
1) I should check multiple actions when the menu gets displayed (without vanishing the menu).
2) when i click ouside of the menu the menu should get vanished.

I have attached the images which will make you understand more about my requirement.

I want to deselect first three actions without the menu getting vanished.

spirit
25th February 2009, 14:19
after clicking on needed action use removeAction for menu which holds this action.

jpn
25th February 2009, 16:28
QMenu works like menus are supposed to work. Are you sure you want to break commonly accepted UI design principles with such a weird construct? That would not be a menu any more but more like a custom popup component.

vajindarladdad
7th August 2009, 14:32
Example Code

void Widget::customContextMenuRequested(const QPoint &pt)
{
menu->popup(mapToGlobal(pt));
}

void Widget::actionsTriggered(QAction *actionPassed)
{
menu->show();
}

will give you multiple selection QMenu