QGIS API Documentation  2.99.0-Master (6a61179)
qgsattributedialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsattributedialog.h - description
3  -------------------
4  begin : October 2004
5  copyright : (C) 2004 by Marco Hugentobler
6  email : [email protected]
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #ifndef QGSATTRIBUTEDIALOG_H
18 #define QGSATTRIBUTEDIALOG_H
19 
21 #include "qgsattributeform.h"
23 
24 #include <QDialog>
25 #include <QMenuBar>
26 #include <QGridLayout>
27 
28 class QgsDistanceArea;
29 class QgsHighlight;
30 
34 class GUI_EXPORT QgsAttributeDialog : public QDialog
35 {
36  Q_OBJECT
37 
38  public:
39 
51  QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget* parent = nullptr, bool showDialogButtons = true, const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );
52 
54 
58  void saveGeometry();
59 
63  void restoreGeometry();
64 
69  void setHighlight( QgsHighlight *h );
70 
71  QgsAttributeForm *attributeForm() { return mAttributeForm; }
72 
73  const QgsFeature *feature() { return &mAttributeForm->feature(); }
74 
80  bool editable() { return mAttributeForm->editable(); }
81 
87  void setMode( QgsAttributeForm::Mode mode ) { mAttributeForm->setMode( mode ); }
88 
94  void setEditCommandMessage( const QString& message ) { mAttributeForm->setEditCommandMessage( message ); }
95 
103  virtual bool event( QEvent *e ) override;
104 
105  public slots:
106  void accept() override;
107  void reject() override;
108 
110  void show();
111 
112  private:
113  void init( QgsVectorLayer* layer, QgsFeature* feature, const QgsAttributeEditorContext& context, bool showDialogButtons );
114 
115  QString mSettingsPath;
116  // Used to sync multiple widgets for the same field
117  QgsHighlight *mHighlight;
118  int mFormNr;
119  bool mShowDialogButtons;
120  QString mReturnvarname;
121  QgsAttributeForm* mAttributeForm;
122  QgsFeature *mOwnedFeature;
123 
124  QgsTrackedVectorLayerTools mTrackedVectorLayerTools;
125 
126  // true if this dialog is editable
127  bool mEditable;
128 
129  static int sFormCounter;
130  static QString sSettingsPath;
131 
132 };
133 
134 #endif
This class contains context information for attribute editor widgets.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:135
bool editable()
Is this dialog editable?
void setEditCommandMessage(const QString &message)
Sets the edit command message (Undo) that will be used when the dialog is accepted.
A class for highlight features on the map.
Definition: qgshighlight.h:35
QgsAttributeForm * attributeForm()
General purpose distance and area calculator.
const QgsFeature * feature()
void setMode(QgsAttributeForm::Mode mode)
Toggles the form mode.
Represents a vector layer which manages a vector based data sets.