2 Attachment(s)
QMenu Multiple selection problem
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.
Re: QMenu Multiple selection problem
after clicking on needed action use removeAction for menu which holds this action.
Re: QMenu Multiple selection problem
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.
Re: QMenu Multiple selection problem
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