mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Merge pull request #1668 from m-kuhn/action-menu-crash
Alternative approach to f9fcee9
This commit is contained in:
commit
cc5d3bcb78
@ -28,7 +28,6 @@
|
||||
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent, bool showDialogButtons )
|
||||
: QDialog( parent )
|
||||
, mHighlight( 0 )
|
||||
, mOwnedFeature( featureOwner ? thepFeature : 0 )
|
||||
{
|
||||
QgsAttributeEditorContext context;
|
||||
context.setDistanceArea( myDa );
|
||||
@ -37,17 +36,22 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
|
||||
|
||||
if ( !showDialogButtons )
|
||||
mAttributeForm->hideButtonBox();
|
||||
|
||||
if ( featureOwner )
|
||||
delete thepFeature;
|
||||
}
|
||||
|
||||
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QWidget* parent, bool showDialogButtons, QgsAttributeEditorContext context )
|
||||
: QDialog( parent )
|
||||
, mHighlight( 0 )
|
||||
, mOwnedFeature( featureOwner ? thepFeature : 0 )
|
||||
{
|
||||
init( vl, thepFeature, context, parent );
|
||||
|
||||
if ( !showDialogButtons )
|
||||
mAttributeForm->hideButtonBox();
|
||||
|
||||
if ( featureOwner )
|
||||
delete thepFeature;
|
||||
}
|
||||
|
||||
QgsAttributeDialog::~QgsAttributeDialog()
|
||||
@ -58,9 +62,6 @@ QgsAttributeDialog::~QgsAttributeDialog()
|
||||
delete mHighlight;
|
||||
}
|
||||
|
||||
if( mOwnedFeature )
|
||||
delete mOwnedFeature;
|
||||
|
||||
saveGeometry();
|
||||
}
|
||||
|
||||
@ -110,7 +111,7 @@ void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, QgsAt
|
||||
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
|
||||
mMenuBar = new QMenuBar( this );
|
||||
QgsActionMenu* menu = new QgsActionMenu( layer, feature, this );
|
||||
QgsActionMenu* menu = new QgsActionMenu( layer, &mAttributeForm->feature(), this );
|
||||
mMenuBar->addMenu( menu );
|
||||
layout()->setMenuBar( mMenuBar );
|
||||
|
||||
|
@ -136,7 +136,6 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
|
||||
QString mReturnvarname;
|
||||
QgsAttributeForm* mAttributeForm;
|
||||
QMenuBar* mMenuBar;
|
||||
QgsFeature *mOwnedFeature;
|
||||
|
||||
// true if this dialog is editable
|
||||
bool mEditable;
|
||||
|
Loading…
x
Reference in New Issue
Block a user