Skip to content

Commit 4070354

Browse files
committed
fixed #3839
1 parent f88f721 commit 4070354

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

src/app/qgscustomization.cpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -838,30 +838,22 @@ void QgsCustomization::removeFromLayout( QLayout *theLayout, QWidget * theWidget
838838

839839
void QgsCustomization::preNotify( QObject * receiver, QEvent * event, bool * done )
840840
{
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 )
844842
{
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 )
847846
{
848-
// TODO?
847+
QgsCustomization::customizeWidget( widget, event );
849848
}
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 )
854850
{
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+
}
865857
}
866858
}
867859
// Shortcut arrives only if it is defined and used in main app

0 commit comments

Comments
 (0)