Skip to content

Commit

Permalink
Fix graphical glitches caused by empty menu on attribute dialog
Browse files Browse the repository at this point in the history
Fix #12061
  • Loading branch information
m-kuhn committed Jan 29, 2015
1 parent 16f309b commit c19eb60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -109,12 +109,16 @@ void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, QgsAt
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );

mMenuBar = new QMenuBar( this );
QgsActionMenu* menu = new QgsActionMenu( layer, &mAttributeForm->feature(), this );
if ( menu->actions().size() > 0 )
{
mMenuBar->addMenu( menu );
layout()->setMenuBar( mMenuBar );
QMenuBar* menuBar = new QMenuBar( this );
menuBar->addMenu( menu );
layout()->setMenuBar( menuBar );
}
else
{
delete menu;
}

restoreGeometry();
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsattributedialog.h
Expand Up @@ -135,7 +135,6 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
bool mShowDialogButtons;
QString mReturnvarname;
QgsAttributeForm* mAttributeForm;
QMenuBar* mMenuBar;
QgsFeature *mOwnedFeature;

// true if this dialog is editable
Expand Down

0 comments on commit c19eb60

Please sign in to comment.