From ad9ef8bea53b98917c7e4fd7ea518b5a0f91b0c9 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Mon, 30 Jul 2018 14:03:33 -0400 Subject: [PATCH] Bug 2669. Double click switches to the widget of the dependent object. --- copasi/UI/CQDependencyWidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/copasi/UI/CQDependencyWidget.cpp b/copasi/UI/CQDependencyWidget.cpp index df1673652f..06f566febf 100644 --- a/copasi/UI/CQDependencyWidget.cpp +++ b/copasi/UI/CQDependencyWidget.cpp @@ -12,6 +12,7 @@ #include #include +#include CQDependencyWidget::CQDependencyWidget(QWidget *parent, const char *name, Qt::WindowFlags f) : CopasiWidget(parent, name, f) @@ -210,7 +211,13 @@ CQDependencyWidget::rowDoubleClicked(int row, int) if (key.empty()) return; - if (mpListView == NULL) return; + if (mpListView == NULL) + { + mpListView = CopasiUI3Window::getMainWindow()->getMainWidget(); + } - mpListView->switchToOtherWidget(C_INVALID_INDEX, key); + if (mpListView != NULL) + { + mpListView->switchToOtherWidget(C_INVALID_INDEX, key); + } }