Disable the context menu for non-editable items

This commit is contained in:
Arin Alex 2018-03-02 22:22:51 +03:00
commit 5d7a116f31

View File

@ -1153,6 +1153,7 @@ void BaseDesignIntf::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
void BaseDesignIntf::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void BaseDesignIntf::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{ {
if (!(flags() & QGraphicsItem::ItemIsSelectable)) return;
PageDesignIntf* page = dynamic_cast<PageDesignIntf*>(scene()); PageDesignIntf* page = dynamic_cast<PageDesignIntf*>(scene());
if (!page->selectedItems().contains(this)){ if (!page->selectedItems().contains(this)){
page->clearSelection(); page->clearSelection();