From 5757d49ba991d7ebe11eb606e34e06adc25b8fd6 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sun, 25 Oct 2020 18:04:55 +0100 Subject: [PATCH] avoid Qt5/6 incompatibilities --- src/controls/QskPopup.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/controls/QskPopup.cpp b/src/controls/QskPopup.cpp index af8b05f1..6fc7da57 100644 --- a/src/controls/QskPopup.cpp +++ b/src/controls/QskPopup.cpp @@ -70,23 +70,14 @@ namespace { } - void geometryChanged( const QRectF& newGeometry, - const QRectF& oldGeometry ) override - { - Inherited::geometryChanged( newGeometry, oldGeometry ); - - if ( auto popup = static_cast< QskPopup* >( parentItem() ) ) - { - if ( popup->hasOverlay() ) - popup->update(); - } - } - + protected: bool event( QEvent* event ) override { bool ok = Inherited::event( event ); - if ( event->type() == QEvent::MouseButtonPress ) + const int eventType = event->type(); + + if ( eventType == QEvent::MouseButtonPress ) { if ( auto popup = static_cast< QskPopup* >( parentItem() ) ) { @@ -97,6 +88,14 @@ namespace } } } + else if ( eventType == QskEvent::GeometryChange ) + { + if ( auto popup = static_cast< QskPopup* >( parentItem() ) ) + { + if ( popup->hasOverlay() ) + popup->update(); + } + } return ok; }