Fix graphical glitches caused by empty menu on attribute dialog

Fix #12061
This commit is contained in:
Matthias Kuhn 2015-01-29 16:57:04 +01:00
parent 16f309b617
commit c19eb60d2f
2 changed files with 7 additions and 4 deletions

View File

@ -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();

View File

@ -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