mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Element editor and diagram editor : context menu display only enabled actions
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5283 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1144,8 +1144,15 @@ void DiagramView::contextMenuEvent(QContextMenuEvent *e) {
|
||||
m_context_menu -> addSeparator();
|
||||
m_context_menu -> addActions(qde -> m_selection_actions_group.actions());
|
||||
}
|
||||
|
||||
// affiche le menu contextuel
|
||||
|
||||
//Remove from the context menu the actions which are disabled.
|
||||
const QList<QAction *> actions = m_context_menu->actions();
|
||||
for(QAction *action : actions)
|
||||
{
|
||||
if(!action->isEnabled())
|
||||
m_context_menu->removeAction(action);
|
||||
}
|
||||
|
||||
m_context_menu -> popup(e -> globalPos());
|
||||
}
|
||||
e -> accept();
|
||||
|
||||
Reference in New Issue
Block a user