apply enableAutoGeometryRestore to feature form dialog

This commit is contained in:
Salvatore Larosa 2018-02-01 23:30:00 +01:00
parent d653fb5a8f
commit 5b9be7a966
3 changed files with 2 additions and 37 deletions

View File

@ -32,18 +32,6 @@ Create an attribute dialog for a given layer and feature
~QgsAttributeDialog();
void saveGeometry();
%Docstring
Saves the size and position for the next time
this dialog box will be used.
%End
void restoreGeometry();
%Docstring
Restores the size and position from the last time
this dialog box was used.
%End
void setHighlight( QgsHighlight *h );
%Docstring
setHighlight

View File

@ -17,6 +17,7 @@
#include "qgsattributedialog.h"
#include "qgsgui.h"
#include "qgsattributeform.h"
#include "qgshighlight.h"
#include "qgsapplication.h"
@ -40,18 +41,6 @@ QgsAttributeDialog::~QgsAttributeDialog()
if ( mOwnedFeature )
delete mOwnedFeature;
saveGeometry();
}
void QgsAttributeDialog::saveGeometry()
{
QgsSettings().setValue( mSettingsPath + "geometry", QDialog::saveGeometry() );
}
void QgsAttributeDialog::restoreGeometry()
{
QDialog::restoreGeometry( QgsSettings().value( mSettingsPath + "geometry" ).toByteArray() );
}
void QgsAttributeDialog::setHighlight( QgsHighlight *h )
@ -85,6 +74,7 @@ void QgsAttributeDialog::reject()
void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const QgsAttributeEditorContext &context, bool showDialogButtons )
{
QgsGui::enableAutoGeometryRestore( this );
QgsAttributeEditorContext trackedContext = context;
setWindowTitle( tr( "%1 - Feature Attributes" ).arg( layer->name() ) );
setLayout( new QGridLayout() );
@ -114,7 +104,6 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
delete menu;
}
restoreGeometry();
focusNextChild();
}

View File

@ -55,18 +55,6 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
~QgsAttributeDialog() override;
/**
* Saves the size and position for the next time
* this dialog box will be used.
*/
void saveGeometry();
/**
* Restores the size and position from the last time
* this dialog box was used.
*/
void restoreGeometry();
/**
* \brief setHighlight
* \param h The highlight. Ownership is taken.