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:
blacksun
2018-06-30 21:41:27 +00:00
parent 114c3cdcc3
commit 28faaf12c5
9 changed files with 176 additions and 38 deletions

View File

@@ -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);
}
}
/**