From: vsv Date: Wed, 17 Jan 2018 09:19:37 +0000 (+0300) Subject: Issue #2402: Provide rename using index with column #1 X-Git-Tag: V_3.0.0RC1~25^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c36b2edd26fdfd95930ba3f487d302e930aef961;p=modules%2Fshaper.git Issue #2402: Provide rename using index with column #1 --- diff --git a/src/XGUI/XGUI_DataModel.h b/src/XGUI/XGUI_DataModel.h index d7178aa43..e89546161 100644 --- a/src/XGUI/XGUI_DataModel.h +++ b/src/XGUI/XGUI_DataModel.h @@ -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; diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 6c2e61ffa..883d3f2f3 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -647,7 +647,7 @@ QMap 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& theStates { QMap::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()); } }