diff options
Diffstat (limited to 'desktop-widgets/statswidget.cpp')
-rw-r--r-- | desktop-widgets/statswidget.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/desktop-widgets/statswidget.cpp b/desktop-widgets/statswidget.cpp index 465d5d496..6b936915f 100644 --- a/desktop-widgets/statswidget.cpp +++ b/desktop-widgets/statswidget.cpp @@ -93,6 +93,8 @@ StatsWidget::StatsWidget(QWidget *parent) : QWidget(parent) view = qobject_cast<StatsView *>(root); if (!view) qWarning("Oops. The root of the StatsView is not a StatsView."); + if (view) + view->setVisible(isVisible()); // Synchronize visibility of widget and QtQuick-view. } // Initialize QComboBox with list of variables @@ -209,6 +211,17 @@ void StatsWidget::showEvent(QShowEvent *e) unrestrict(); updateUi(); QWidget::showEvent(e); + // Apparently, we have to manage the visibility of the view ourselves. That's mad. + if (view) + view->setVisible(true); +} + +void StatsWidget::hideEvent(QHideEvent *e) +{ + QWidget::hideEvent(e); + // Apparently, we have to manage the visibility of the view ourselves. That's mad. + if (view) + view->setVisible(false); } void StatsWidget::restrict() |