]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1022: Do not call pop-up on non selected index
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 28 Sep 2015 13:49:40 +0000 (16:49 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 28 Sep 2015 13:49:40 +0000 (16:49 +0300)
src/XGUI/XGUI_ObjectsBrowser.cpp

index d89d6171b0a8eaa8f1a3078557b3e94d7975ef81..9eee72dcedd517d3029f5d35186c815e50da7ed0 100644 (file)
@@ -288,7 +288,12 @@ void XGUI_ObjectsBrowser::onContextMenuRequested(QContextMenuEvent* theEvent)
   QModelIndexList aIndexes;
   QObjectPtrList aSelectedData = selectedObjects(&aIndexes);
   bool toEnable = false;
+
   if (aSelectedData.size() == 1) {
+    QModelIndex aSelected = myTreeView->indexAt(theEvent->pos());
+    if (!aIndexes.contains(aSelected))
+      return; // menu is called on non selected item
+
     Qt::ItemFlags aFlags = dataModel()->flags(aIndexes.first());
     toEnable = ((aFlags & Qt::ItemIsEditable) != 0);
   }