QGIS API Documentation  2.3.0-Master
 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 : marco.hugentobler@autoform.ch
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
Methods in this class are used to handle basic operations on vector layers.
QgsFeature * feature()
This class contains context information for attribute editor widgets.
QgsHighlight * mHighlight
QgsVectorLayer * mLayer
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:114
bool editable()
Is this dialog editable?
A class for highlight features on the map.
Definition: qgshighlight.h:36
static QString sSettingsPath
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:31
General purpose distance and area calculator.
QgsAttributeEditorContext mContext
Represents a vector layer which manages a vector based data sets.