From 511132ee4fe77f6535460c96bf70be47b1b65d7d Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Thu, 17 Jun 2021 20:32:45 +0200 Subject: [PATCH] Fixxed issue #294 - Tab refresh problem with a QGLWidget --- src/DockAreaWidget.cpp | 15 +++++++++++++++ src/DockAreaWidget.h | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 01914aaa5..09fd8fd22 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -1030,6 +1030,21 @@ void CDockAreaWidget::onDockWidgetFeaturesChanged() } +#ifdef Q_OS_WIN +//============================================================================ +bool CDockAreaWidget::event(QEvent *e) +{ + switch (e->type()) + { + case QEvent::PlatformSurface: return true; + default: + break; + } + + return Super::event(e); +} +#endif + } // namespace ads //--------------------------------------------------------------------------- diff --git a/src/DockAreaWidget.h b/src/DockAreaWidget.h index a702370bd..536192672 100644 --- a/src/DockAreaWidget.h +++ b/src/DockAreaWidget.h @@ -77,6 +77,17 @@ private Q_SLOTS: void reorderDockWidget(int fromIndex, int toIndex); protected: + +#ifdef Q_OS_WIN + /** + * Reimplements QWidget::event to handle QEvent::PlatformSurface + * This is here to fix issue #294 Tab refresh problem with a QGLWidget + * that exists since Qt version 5.12.7. So this function is here to + * work around a Qt issue. + */ + virtual bool event(QEvent *event) override; +#endif + /** * Inserts a dock widget into dock area. * All dockwidgets in the dock area tabified in a stacked layout with tabs.