Salome HOME
Issue #2402: Provide rename using index with column #1
authorvsv <vsv@opencascade.com>
Wed, 17 Jan 2018 09:19:37 +0000 (12:19 +0300)
committervsv <vsv@opencascade.com>
Wed, 17 Jan 2018 09:19:37 +0000 (12:19 +0300)
src/XGUI/XGUI_DataModel.h
src/XGUI/XGUI_ObjectsBrowser.cpp

index d7178aa436ece05b076aece93cc87fed50b54201..e89546161dda5a6b3a564dcc0fe37741a607a222 100644 (file)
@@ -64,7 +64,7 @@ public:
 
   //! Returns index of the object
   //! \param theObject object to find
-  virtual QModelIndex objectIndex(const ObjectPtr theObject, int theColumn = 0) const;
+  virtual QModelIndex objectIndex(const ObjectPtr theObject, int theColumn = 1) const;
 
   //! Clear internal data
   virtual void clear();
@@ -131,7 +131,7 @@ public:
 
   /// Returns an index which is root of the given document
   /// \param theDoc a document
-  QModelIndex documentRootIndex(DocumentPtr theDoc, int theColumn = 0) const;
+  QModelIndex documentRootIndex(DocumentPtr theDoc, int theColumn = 1) const;
 
   /// Returns last history object index
   virtual QModelIndex lastHistoryIndex() const;
index 6c2e61ffae991a90c92db7162c75805d6497d0cf..883d3f2f3798f8e69e35340b578604e0a6d32b26 100644 (file)
@@ -647,7 +647,7 @@ QMap<ObjectPtr, bool> XGUI_ObjectsBrowser::getFoldersState(DocumentPtr theDoc) c
   ObjectPtr aObj;
   for (int i = 0; i < aNb; i++) {
     aObj = theDoc->object(ModelAPI_Folder::group(), i);
-    QModelIndex aIdx = myDocModel->objectIndex(aObj);
+    QModelIndex aIdx = myDocModel->objectIndex(aObj, 0);
     aMap[aObj] = myTreeView->isExpanded(aIdx);
   }
   return aMap;
@@ -657,7 +657,7 @@ void XGUI_ObjectsBrowser::setFoldersState(const QMap<ObjectPtr, bool>& theStates
 {
   QMap<ObjectPtr, bool>::const_iterator aIt;
   for (aIt = theStates.constBegin(); aIt != theStates.constEnd(); aIt++) {
-    QModelIndex aIdx = myDocModel->objectIndex(aIt.key());
+    QModelIndex aIdx = myDocModel->objectIndex(aIt.key(), 0);
     myTreeView->setExpanded(aIdx, aIt.value());
   }
 }