Salome HOME
Merge remote-tracking branch 'origin/cbr/export_to_geom_via_xao_pre_2.10'
authormpv <mpv@opencascade.com>
Wed, 6 Dec 2017 15:24:36 +0000 (18:24 +0300)
committermpv <mpv@opencascade.com>
Wed, 6 Dec 2017 15:24:36 +0000 (18:24 +0300)
src/XGUI/XGUI_ObjectsBrowser.cpp
src/XGUI/XGUI_ObjectsBrowser.h
src/XGUI/XGUI_Workshop.cpp

index 3b09d6ab7cb75b5b1154bd8a760d71119c3eeda4..983f4c37ea1d035a2624fd5e982d4a9ca27883a2 100644 (file)
@@ -621,3 +621,15 @@ void XGUI_ObjectsBrowser::setStateForDoc(DocumentPtr theDoc, const std::list<boo
     myTreeView->setExpanded(aIdx, (*aIt));
   }
 }
+
+void XGUI_ObjectsBrowser::updateAllIndexes(int theColumn, const QModelIndex& theParent)
+{
+  int aNb = myDocModel->rowCount(theParent);
+  for (int i = 0; i < aNb; i++) {
+    QModelIndex aIdx = myDocModel->index(i, theColumn, theParent);
+    if (aIdx.isValid()) {
+      myTreeView->update(aIdx);
+      updateAllIndexes(theColumn, aIdx);
+    }
+  }
+}
index fd522c61a8dd253aaafc940fec2aadac2b942018..372d4bb76402395ec1a7a286abace45cf66a999a 100644 (file)
@@ -206,6 +206,10 @@ Q_OBJECT
 
   void onSelectionChanged();
 
+  /// Updates all items of object browser
+  /// \param theColumn - column of items
+  /// \param theParent - a parent item (by default from root)
+  void updateAllIndexes(int theColumn = 0, const QModelIndex& theParent = QModelIndex());
 
 public slots:
   //! Called on Edit command request
index 032790dcb845354c4a731744e462be306064bb4d..cb0f7a0992e5c81ba60c1d8231446567d9cc012a 100755 (executable)
@@ -1472,6 +1472,8 @@ void XGUI_Workshop::onContextMenuCommand(const QString& theId, bool isChecked)
     viewer()->eraseAll();
 #endif
     updateCommandStatus();
+    // Necessary for update icons in ObjectBrowser on Linux
+    myObjectBrowser->updateAllIndexes();
   } else if (theId == "SELECT_VERTEX_CMD") {
     setViewerSelectionMode(TopAbs_VERTEX);
   } else if (theId == "SELECT_EDGE_CMD") {
@@ -2392,15 +2394,9 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList)
     aObj->setDisplayed(true);
   }
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
-#ifndef WIN32
+
   // Necessary for update icons in ObjectBrowser on Linux
-  QModelIndexList aIndexes = mySelector->selection()->selectedIndexes();
-  foreach (QModelIndex aIdx, aIndexes) {
-    if (aIdx.column() == 0) {
-      myObjectBrowser->treeView()->update(aIdx);
-    }
-  }
-#endif
+  myObjectBrowser->updateAllIndexes();
 }
 
 //**************************************************************