Skip to content

Commit 5b9be7a

Browse files
committed
apply enableAutoGeometryRestore to feature form dialog
1 parent d653fb5 commit 5b9be7a

File tree

3 files changed

+2
-37
lines changed

3 files changed

+2
-37
lines changed

python/gui/qgsattributedialog.sip.in

-12
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@ Create an attribute dialog for a given layer and feature
3232

3333
~QgsAttributeDialog();
3434

35-
void saveGeometry();
36-
%Docstring
37-
Saves the size and position for the next time
38-
this dialog box will be used.
39-
%End
40-
41-
void restoreGeometry();
42-
%Docstring
43-
Restores the size and position from the last time
44-
this dialog box was used.
45-
%End
46-
4735
void setHighlight( QgsHighlight *h );
4836
%Docstring
4937
setHighlight

src/gui/qgsattributedialog.cpp

+2-13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "qgsattributedialog.h"
1919

20+
#include "qgsgui.h"
2021
#include "qgsattributeform.h"
2122
#include "qgshighlight.h"
2223
#include "qgsapplication.h"
@@ -40,18 +41,6 @@ QgsAttributeDialog::~QgsAttributeDialog()
4041

4142
if ( mOwnedFeature )
4243
delete mOwnedFeature;
43-
44-
saveGeometry();
45-
}
46-
47-
void QgsAttributeDialog::saveGeometry()
48-
{
49-
QgsSettings().setValue( mSettingsPath + "geometry", QDialog::saveGeometry() );
50-
}
51-
52-
void QgsAttributeDialog::restoreGeometry()
53-
{
54-
QDialog::restoreGeometry( QgsSettings().value( mSettingsPath + "geometry" ).toByteArray() );
5544
}
5645

5746
void QgsAttributeDialog::setHighlight( QgsHighlight *h )
@@ -85,6 +74,7 @@ void QgsAttributeDialog::reject()
8574

8675
void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const QgsAttributeEditorContext &context, bool showDialogButtons )
8776
{
77+
QgsGui::enableAutoGeometryRestore( this );
8878
QgsAttributeEditorContext trackedContext = context;
8979
setWindowTitle( tr( "%1 - Feature Attributes" ).arg( layer->name() ) );
9080
setLayout( new QGridLayout() );
@@ -114,7 +104,6 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
114104
delete menu;
115105
}
116106

117-
restoreGeometry();
118107
focusNextChild();
119108
}
120109

src/gui/qgsattributedialog.h

-12
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
5555

5656
~QgsAttributeDialog() override;
5757

58-
/**
59-
* Saves the size and position for the next time
60-
* this dialog box will be used.
61-
*/
62-
void saveGeometry();
63-
64-
/**
65-
* Restores the size and position from the last time
66-
* this dialog box was used.
67-
*/
68-
void restoreGeometry();
69-
7058
/**
7159
* \brief setHighlight
7260
* \param h The highlight. Ownership is taken.

0 commit comments

Comments
 (0)