From a48d7e3a65eb1956ba713824bb22ce27f8743ae4 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 28 May 2015 17:41:33 +0300 Subject: [PATCH] Issue #565: Restore double click event for object browser header --- src/PartSet/PartSet_Module.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 { -- 2.39.2