logic: Fixed crash when closing license window on force entering license

This commit is contained in:
Eberhard Graether
2019-02-26 15:39:13 +01:00
parent 91e2c2e7e5
commit 1c11cd5e8c
2 changed files with 19 additions and 2 deletions
+18 -2
View File
@@ -63,14 +63,25 @@ QtViewToggle::QtViewToggle(View* view, QWidget *parent)
{
}
void QtViewToggle::clear()
{
m_view = nullptr;
}
void QtViewToggle::toggledByAction()
{
dynamic_cast<QtMainWindow*>(parent())->toggleView(m_view, true);
if (m_view)
{
dynamic_cast<QtMainWindow*>(parent())->toggleView(m_view, true);
}
}
void QtViewToggle::toggledByUI()
{
dynamic_cast<QtMainWindow*>(parent())->toggleView(m_view, false);
if (m_view)
{
dynamic_cast<QtMainWindow*>(parent())->toggleView(m_view, false);
}
}
@@ -149,6 +160,11 @@ QtMainWindow::~QtMainWindow()
{
delete [] m_recentProjectAction;
}
for (DockWidget& dockWidget : m_dockWidgets)
{
dockWidget.toggle->clear();
}
}
void QtMainWindow::addView(View* view)
+1
View File
@@ -23,6 +23,7 @@ class QtViewToggle
public:
QtViewToggle(View* view, QWidget *parent = nullptr);
void clear();
public slots:
void toggledByAction();