@@ -838,30 +838,22 @@ void QgsCustomization::removeFromLayout( QLayout *theLayout, QWidget * theWidget
838
838
839
839
void QgsCustomization::preNotify ( QObject * receiver, QEvent * event, bool * done )
840
840
{
841
- QWidget *widget = qobject_cast<QWidget*>( receiver );
842
-
843
- if ( mEnabled && widget && event->type () == QEvent::Show )
841
+ if ( event->type () == QEvent::Show || event->type () == QEvent::MouseButtonPress )
844
842
{
845
- QgsCustomization::customizeWidget ( widget, event );
846
- if ( widget->inherits ( " QDialog" ) && pDialog && pDialog->isVisible () )
843
+ QWidget *widget = qobject_cast<QWidget*>( receiver );
844
+
845
+ if ( mEnabled && widget && event->type () == QEvent::Show )
847
846
{
848
- // TODO?
847
+ QgsCustomization::customizeWidget ( widget, event );
849
848
}
850
- }
851
- else if ( mEnabled && widget && ( event->type () == QEvent::Hide || event->type () == QEvent::Close ) )
852
- {
853
- if ( widget->inherits ( " QDialog" ) && pDialog && pDialog->isVisible () )
849
+ else if ( widget && event->type () == QEvent::MouseButtonPress )
854
850
{
855
- // TODO?
856
- }
857
- }
858
- else if ( widget && event->type () == QEvent::MouseButtonPress )
859
- {
860
- QgsDebugMsg ( " click" );
861
- if ( pDialog && pDialog->isVisible () )
862
- {
863
- QMouseEvent *e = static_cast <QMouseEvent*>( event );
864
- *done = pDialog->switchWidget ( widget, e );
851
+ QgsDebugMsg ( " click" );
852
+ if ( pDialog && pDialog->isVisible () )
853
+ {
854
+ QMouseEvent *e = static_cast <QMouseEvent*>( event );
855
+ *done = pDialog->switchWidget ( widget, e );
856
+ }
865
857
}
866
858
}
867
859
// Shortcut arrives only if it is defined and used in main app
0 commit comments