@@ -666,7 +666,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
666
666
667
667
Q_FOREACH ( QObject *obj, menubar->children () )
668
668
{
669
- if ( obj->inherits ( " QMenu" ) )
669
+ if ( obj->inherits ( " QMenu" ) && !obj-> objectName (). isEmpty () )
670
670
{
671
671
QMenu *menu = qobject_cast<QMenu *>( obj );
672
672
bool visible = mSettings ->value ( menu->objectName (), true ).toBool ();
@@ -688,7 +688,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
688
688
mSettings ->beginGroup ( QStringLiteral ( " Customization/Toolbars" ) );
689
689
Q_FOREACH ( QObject *obj, mw->children () )
690
690
{
691
- if ( obj->inherits ( " QToolBar" ) )
691
+ if ( obj->inherits ( " QToolBar" ) && !obj-> objectName (). isEmpty () )
692
692
{
693
693
QToolBar *tb = qobject_cast<QToolBar *>( obj );
694
694
bool visible = mSettings ->value ( tb->objectName (), true ).toBool ();
@@ -724,7 +724,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
724
724
mSettings ->beginGroup ( QStringLiteral ( " Customization/Docks" ) );
725
725
Q_FOREACH ( QObject *obj, mw->children () )
726
726
{
727
- if ( obj->inherits ( " QDockWidget" ) )
727
+ if ( obj->inherits ( " QDockWidget" ) && !obj-> objectName (). isEmpty () )
728
728
{
729
729
bool visible = mSettings ->value ( obj->objectName (), true ).toBool ();
730
730
if ( !visible )
@@ -745,7 +745,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
745
745
QgsStatusBar *sb = mw->statusBarIface ();
746
746
Q_FOREACH ( QObject *obj, sb->children () )
747
747
{
748
- if ( obj->inherits ( " QWidget" ) )
748
+ if ( obj->inherits ( " QWidget" ) && !obj-> objectName (). isEmpty () )
749
749
{
750
750
QWidget *widget = qobject_cast<QWidget *>( obj );
751
751
if ( widget->objectName ().isEmpty () )
0 commit comments