Skip to content

Commit

Permalink
fixed #3839
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 25, 2011
1 parent f88f721 commit 4070354
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions src/app/qgscustomization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,30 +838,22 @@ void QgsCustomization::removeFromLayout( QLayout *theLayout, QWidget * theWidget

void QgsCustomization::preNotify( QObject * receiver, QEvent * event, bool * done )
{
QWidget *widget = qobject_cast<QWidget*>( receiver );

if ( mEnabled && widget && event->type() == QEvent::Show )
if ( event->type() == QEvent::Show || event->type() == QEvent::MouseButtonPress )
{
QgsCustomization::customizeWidget( widget, event );
if ( widget->inherits( "QDialog" ) && pDialog && pDialog->isVisible() )
QWidget *widget = qobject_cast<QWidget*>( receiver );

if ( mEnabled && widget && event->type() == QEvent::Show )
{
// TODO?
QgsCustomization::customizeWidget( widget, event );
}
}
else if ( mEnabled && widget && ( event->type() == QEvent::Hide || event->type() == QEvent::Close ) )
{
if ( widget->inherits( "QDialog" ) && pDialog && pDialog->isVisible() )
else if ( widget && event->type() == QEvent::MouseButtonPress )
{
// TODO?
}
}
else if ( widget && event->type() == QEvent::MouseButtonPress )
{
QgsDebugMsg( "click" );
if ( pDialog && pDialog->isVisible() )
{
QMouseEvent *e = static_cast<QMouseEvent*>( event );
*done = pDialog->switchWidget( widget, e );
QgsDebugMsg( "click" );
if ( pDialog && pDialog->isVisible() )
{
QMouseEvent *e = static_cast<QMouseEvent*>( event );
*done = pDialog->switchWidget( widget, e );
}
}
}
// Shortcut arrives only if it is defined and used in main app
Expand Down

0 comments on commit 4070354

Please sign in to comment.