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; }