QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
QgsAttributeDialog Class Reference

#include <qgsattributedialog.h>

Inheritance diagram for QgsAttributeDialog:
Inheritance graph
[legend]
Collaboration diagram for QgsAttributeDialog:
Collaboration graph
[legend]

Public Slots

void accept ()
 
void show (bool autoDelete=true)
 Show the dialog non-blocking. More...
 

Public Member Functions

 QgsAttributeDialog (QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget *parent=0, bool showDialogButtons=true)
 Create an attribute dialog for a given layer and feature. More...
 
 QgsAttributeDialog (QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget *parent=0, bool showDialogButtons=true, QgsAttributeEditorContext context=QgsAttributeEditorContext())
 Create an attribute dialog for a given layer and feature. More...
 
 ~QgsAttributeDialog ()
 
void saveGeometry ()
 Saves the size and position for the next time this dialog box will be used. More...
 
void restoreGeometry ()
 Restores the size and position from the last time this dialog box was used. More...
 
void setHighlight (QgsHighlight *h)
 setHighlight More...
 
Q_DECL_DEPRECATED QDialog * dialog ()
 Returns reference to self. More...
 
QgsAttributeFormattributeForm ()
 
const QgsFeaturefeature ()
 
bool editable ()
 Is this dialog editable? More...
 
void setIsAddDialog (bool isAddDialog)
 Toggles the form mode between edit feature and add feature. More...
 
void setEditCommandMessage (const QString &message)
 Sets the edit command message (Undo) that will be used when the dialog is accepted. More...
 

Private Member Functions

void init (QgsVectorLayer *layer, QgsFeature *feature, QgsAttributeEditorContext &context, QWidget *parent)
 

Private Attributes

QString mSettingsPath
 
QgsHighlightmHighlight
 
int mFormNr
 
bool mShowDialogButtons
 
QString mReturnvarname
 
QgsAttributeFormmAttributeForm
 
bool mEditable
 

Static Private Attributes

static int sFormCounter
 
static QString sSettingsPath
 

Detailed Description

Definition at line 35 of file qgsattributedialog.h.

Constructor & Destructor Documentation

QgsAttributeDialog::QgsAttributeDialog ( QgsVectorLayer vl,
QgsFeature thepFeature,
bool  featureOwner,
QgsDistanceArea  myDa,
QWidget *  parent = 0,
bool  showDialogButtons = true 
)

Create an attribute dialog for a given layer and feature.

Parameters
vlThe layer for which the dialog will be generated
thepFeatureA feature for which the dialog will be generated
featureOwnerSet to true, if the dialog should take ownership of the feature
myDaA QgsDistanceArea which will be used for expressions
parentA parent widget for the dialog
showDialogButtonsTrue: Show the dialog buttons accept/cancel
Deprecated:

Definition at line 27 of file qgsattributedialog.cpp.

References QgsAttributeForm::hideButtonBox(), init(), mAttributeForm, and QgsAttributeEditorContext::setDistanceArea().

QgsAttributeDialog::QgsAttributeDialog ( QgsVectorLayer vl,
QgsFeature thepFeature,
bool  featureOwner,
QWidget *  parent = 0,
bool  showDialogButtons = true,
QgsAttributeEditorContext  context = QgsAttributeEditorContext() 
)

Create an attribute dialog for a given layer and feature.

Parameters
vlThe layer for which the dialog will be generated
thepFeatureA feature for which the dialog will be generated
featureOwnerSet to true, if the dialog should take ownership of the feature
parentA parent widget for the dialog
showDialogButtonsTrue: Show the dialog buttons accept/cancel
contextThe context in which this dialog is created

Definition at line 42 of file qgsattributedialog.cpp.

References QgsAttributeForm::hideButtonBox(), init(), and mAttributeForm.

QgsAttributeDialog::~QgsAttributeDialog ( )

Definition at line 55 of file qgsattributedialog.cpp.

References mHighlight, and saveGeometry().

Member Function Documentation

void QgsAttributeDialog::accept ( )
slot

Definition at line 83 of file qgsattributedialog.cpp.

References mAttributeForm, and QgsAttributeForm::save().

Referenced by init().

QgsAttributeForm* QgsAttributeDialog::attributeForm ( )
inline

Definition at line 94 of file qgsattributedialog.h.

Q_DECL_DEPRECATED QDialog* QgsAttributeDialog::dialog ( )
inline

Returns reference to self.

Only here for legacy compliance

Returns
this
Deprecated:
Do not use. Just use this object itself. Or QgsAttributeForm if you want to embed.

Definition at line 92 of file qgsattributedialog.h.

bool QgsAttributeDialog::editable ( )
inline

Is this dialog editable?

Returns
returns true, if this dialog was created in an editable manner.

Definition at line 103 of file qgsattributedialog.h.

const QgsFeature* QgsAttributeDialog::feature ( )
inline

Definition at line 96 of file qgsattributedialog.h.

void QgsAttributeDialog::init ( QgsVectorLayer layer,
QgsFeature feature,
QgsAttributeEditorContext context,
QWidget *  parent 
)
private

Definition at line 99 of file qgsattributedialog.cpp.

References accept(), mAttributeForm, restoreGeometry(), and tr.

Referenced by QgsAttributeDialog().

void QgsAttributeDialog::restoreGeometry ( )

Restores the size and position from the last time this dialog box was used.

Definition at line 71 of file qgsattributedialog.cpp.

References mSettingsPath.

Referenced by init().

void QgsAttributeDialog::saveGeometry ( )

Saves the size and position for the next time this dialog box will be used.

Definition at line 66 of file qgsattributedialog.cpp.

References mSettingsPath.

Referenced by ~QgsAttributeDialog().

void QgsAttributeDialog::setEditCommandMessage ( const QString &  message)
inline

Sets the edit command message (Undo) that will be used when the dialog is accepted.

Parameters
messageThe message

Definition at line 119 of file qgsattributedialog.h.

void QgsAttributeDialog::setHighlight ( QgsHighlight h)

setHighlight

Parameters
hThe highlight. Ownership is taken.

Definition at line 76 of file qgsattributedialog.cpp.

References mHighlight.

void QgsAttributeDialog::setIsAddDialog ( bool  isAddDialog)
inline

Toggles the form mode between edit feature and add feature.

If set to true, the dialog will be editable even with an invalid feature. If set to true, the dialog will add a new feature when the form is accepted.

Parameters
isAddDialogIf set to true, turn this dialog into an add feature dialog.

Definition at line 112 of file qgsattributedialog.h.

void QgsAttributeDialog::show ( bool  autoDelete = true)
slot

Show the dialog non-blocking.

Reparents this dialog to be a child of the dialog form and is deleted when closed.

Definition at line 89 of file qgsattributedialog.cpp.

Member Data Documentation

QgsAttributeForm* QgsAttributeDialog::mAttributeForm
private

Definition at line 137 of file qgsattributedialog.h.

Referenced by accept(), init(), and QgsAttributeDialog().

bool QgsAttributeDialog::mEditable
private

Definition at line 140 of file qgsattributedialog.h.

int QgsAttributeDialog::mFormNr
private

Definition at line 134 of file qgsattributedialog.h.

QgsHighlight* QgsAttributeDialog::mHighlight
private

Definition at line 133 of file qgsattributedialog.h.

Referenced by setHighlight(), and ~QgsAttributeDialog().

QString QgsAttributeDialog::mReturnvarname
private

Definition at line 136 of file qgsattributedialog.h.

QString QgsAttributeDialog::mSettingsPath
private

Definition at line 131 of file qgsattributedialog.h.

Referenced by restoreGeometry(), and saveGeometry().

bool QgsAttributeDialog::mShowDialogButtons
private

Definition at line 135 of file qgsattributedialog.h.

int QgsAttributeDialog::sFormCounter
staticprivate

Definition at line 142 of file qgsattributedialog.h.

QString QgsAttributeDialog::sSettingsPath
staticprivate

Definition at line 143 of file qgsattributedialog.h.


The documentation for this class was generated from the following files: