mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Element editor : add two new actions in context menu for insert or remove point of a selected polygon.
All parts items : remove the 'open hand cursor' when hover a selected part. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5419 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -400,12 +400,16 @@ void QETElementEditor::setupMenus() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::contextMenuEvent
|
||||
* @param event
|
||||
* @brief QETElementEditor::contextMenu
|
||||
* Display a context menu, with all available action.
|
||||
* @param p, the pos of the menu, in screen coordinate
|
||||
* @param actions, a list of actions who can be prepended to the context menu.
|
||||
*/
|
||||
void QETElementEditor::contextMenu(QPoint p)
|
||||
void QETElementEditor::contextMenu(QPoint p, QList<QAction *> actions)
|
||||
{
|
||||
QMenu menu(this);
|
||||
menu.addActions(actions);
|
||||
menu.addSeparator();
|
||||
menu.addAction(undo);
|
||||
menu.addAction(redo);
|
||||
menu.addAction(selectall);
|
||||
@@ -423,14 +427,14 @@ void QETElementEditor::contextMenu(QPoint p)
|
||||
menu.addActions(m_depth_action_group -> actions());
|
||||
|
||||
//Remove from the context menu the actions which are disabled.
|
||||
const QList<QAction *>actions = menu.actions();
|
||||
for(QAction *action : actions)
|
||||
const QList<QAction *>menu_actions = menu.actions();
|
||||
for(QAction *action : menu_actions)
|
||||
{
|
||||
if(!action->isEnabled())
|
||||
menu.removeAction(action);
|
||||
}
|
||||
menu.exec(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user