Skip to content

Commit

Permalink
Prevent Qt assert when using Qt debug compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
marco committed Sep 18, 2011
1 parent 8905274 commit 7286c55
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgscustomization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
// hide individual toolbar actions
foreach( QAction* action, tb->actions() )
{
if ( action->objectName().isEmpty() )
{
continue;
}
visible = mSettings.value( action->objectName(), true ).toBool();
if ( !visible )
tb->removeAction( action );
Expand Down Expand Up @@ -708,6 +712,10 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
if ( obj->inherits( "QWidget" ) )
{
QWidget* widget = qobject_cast<QWidget*>( obj );
if ( widget->objectName().isEmpty() )
{
continue;
}
bool visible = mSettings.value( widget->objectName(), true ).toBool();
if ( !visible )
{
Expand All @@ -732,6 +740,10 @@ void QgsCustomization::updateMenu( QMenu* menu, QSettings& settings )
foreach( QAction* action, menu->actions() )
{
QString objName = ( action->menu() ? action->menu()->objectName() : action->objectName() );
if ( objName.isEmpty() )
{
continue;
}
bool visible = settings.value( objName, true ).toBool();
if ( !visible )
menu->removeAction( action );
Expand Down

0 comments on commit 7286c55

Please sign in to comment.