Skip to content

Commit

Permalink
Gui: fix tree view document double click activating
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Aug 22, 2019
1 parent b392ba1 commit 5280f89
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Gui/Tree.cpp
Expand Up @@ -1218,8 +1218,8 @@ void TreeWidget::onActivateDocument(QAction* active)
// activate the specified document
QByteArray docname = active->data().toByteArray();
Gui::Document* doc = Application::Instance->getDocument((const char*)docname);
if (doc)
doc->setActiveView();
if (doc && !doc->setActiveView())
doc->setActiveView(0,View3DInventor::getClassTypeId());
}

Qt::DropActions TreeWidget::supportedDropActions () const
Expand Down Expand Up @@ -1304,7 +1304,8 @@ void TreeWidget::mouseDoubleClickEvent (QMouseEvent * event)
onReloadDoc();
return;
}
doc->setActiveView();
if(!doc->setActiveView())
doc->setActiveView(0,View3DInventor::getClassTypeId());
}
else if (item->type() == TreeWidget::ObjectType) {
DocumentObjectItem* objitem = static_cast<DocumentObjectItem*>(item);
Expand Down

0 comments on commit 5280f89

Please sign in to comment.