QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
20 #include "qgsfeature.h"
22 
23 class QDialog;
24 class QLayout;
25 
26 class QgsDistanceArea;
27 class QgsFeature;
28 class QgsField;
29 class QgsHighlight;
30 class QgsVectorLayer;
32 
33 class GUI_EXPORT QgsAttributeDialog : public QObject
34 {
35  Q_OBJECT
36 
37  public:
50  QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent = 0, bool showDialogButtons = true );
51 
63  QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget* parent = 0, bool showDialogButtons = true, QgsAttributeEditorContext context = QgsAttributeEditorContext() );
64 
66 
70  void saveGeometry();
71 
75  void restoreGeometry();
76 
77  void setHighlight( QgsHighlight *h );
78 
79  QDialog *dialog() { return mDialog; }
80 
81  QgsFeature* feature() { return mFeature; }
82 
88  bool editable() { return mEditable; }
89 
90  public slots:
91  void accept();
92 
93  int exec();
94  void show();
95 
96  void dialogDestroyed();
97 
98  protected:
99  bool eventFilter( QObject *obj, QEvent *event );
100 
101  private:
102  void init();
103 
104  QDialog *mDialog;
105  QString mSettingsPath;
106  // Used to sync multiple widgets for the same field
112  int mFormNr;
114  QString mReturnvarname;
115 
116  // true if this dialog is editable
117  bool mEditable;
118 
119  static int sFormCounter;
120  static QString sSettingsPath;
121 };
122 
123 #endif