From: vsv Date: Thu, 28 May 2015 14:41:33 +0000 (+0300) Subject: Issue #565: Restore double click event for object browser header X-Git-Tag: V_1.2.0~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a48d7e3a65eb1956ba713824bb22ce27f8743ae4;p=modules%2Fshaper.git Issue #565: Restore double click event for object browser header --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 90fded22d..8476879f1 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -666,6 +666,8 @@ void PartSet_Module::customizeObjectBrowser(QWidget* theObjectBrowser) aOB->treeView()->setExpandsOnDoubleClick(false); connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)), SLOT(onTreeViewDoubleClick(const QModelIndex&))); + connect(aOB, SIGNAL(headerMouseDblClicked(const QModelIndex&)), + SLOT(onTreeViewDoubleClick(const QModelIndex&))); connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)), myDataModel, SLOT(onMouseDoubleClick(const QModelIndex&))); } @@ -765,6 +767,11 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess void PartSet_Module::onTreeViewDoubleClick(const QModelIndex& theIndex) { + SessionPtr aMgr = ModelAPI_Session::get(); + if (!theIndex.isValid()) { + aMgr->setActiveDocument(aMgr->moduleDocument()); + return; + } if (theIndex.column() != 0) // Use only first column return; ObjectPtr aObj = myDataModel->object(theIndex); @@ -776,7 +783,6 @@ void PartSet_Module::onTreeViewDoubleClick(const QModelIndex& theIndex) } } if (aPart.get()) { // if this is a part - SessionPtr aMgr = ModelAPI_Session::get(); if (aPart->partDoc() == aMgr->activeDocument()) { aMgr->setActiveDocument(aMgr->moduleDocument()); } else {