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 | Protected Member Functions | Private Slots | 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 ()
 
int exec ()
 Show the dialog and block the application until the dialog is closed. Ownership of this object is not changed. More...
 
void show ()
 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...
 
QDialog * dialog ()
 
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...
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *e)
 

Private Slots

void onDialogFinished (int result)
 

Private Member Functions

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

Private Attributes

QPointer< QDialog > mDialog
 
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 36 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 mDialog, and mHighlight.

Member Function Documentation

void QgsAttributeDialog::accept ( )
slot

Definition at line 91 of file qgsattributedialog.cpp.

References mAttributeForm, and QgsAttributeForm::save().

Referenced by init().

QgsAttributeForm* QgsAttributeDialog::attributeForm ( )
inline

Definition at line 88 of file qgsattributedialog.h.

QDialog* QgsAttributeDialog::dialog ( )
inline

Definition at line 86 of file qgsattributedialog.h.

Referenced by QgsRelationReferenceWidget::referenceChanged().

bool QgsAttributeDialog::editable ( )
inline

Is this dialog editable?

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

Definition at line 97 of file qgsattributedialog.h.

bool QgsAttributeDialog::eventFilter ( QObject *  obj,
QEvent *  e 
)
protected

Definition at line 122 of file qgsattributedialog.cpp.

References mDialog, and mHighlight.

int QgsAttributeDialog::exec ( )
slot

Show the dialog and block the application until the dialog is closed. Ownership of this object is not changed.

Definition at line 96 of file qgsattributedialog.cpp.

References mDialog, and QgsDebugMsg.

Referenced by QgsRelationReferenceWidget::openForm().

const QgsFeature* QgsAttributeDialog::feature ( )
inline

Definition at line 90 of file qgsattributedialog.h.

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

Definition at line 150 of file qgsattributedialog.cpp.

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

Referenced by QgsAttributeDialog().

void QgsAttributeDialog::onDialogFinished ( int  result)
privateslot

Definition at line 144 of file qgsattributedialog.cpp.

References saveGeometry().

Referenced by init().

void QgsAttributeDialog::restoreGeometry ( )

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

Definition at line 75 of file qgsattributedialog.cpp.

References mDialog, and 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 mDialog, and mSettingsPath.

Referenced by onDialogFinished().

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 113 of file qgsattributedialog.h.

void QgsAttributeDialog::setHighlight ( QgsHighlight h)

setHighlight

Parameters
hThe highlight. Ownership is taken.

Definition at line 84 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 106 of file qgsattributedialog.h.

void QgsAttributeDialog::show ( )
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 109 of file qgsattributedialog.cpp.

References mDialog.

Member Data Documentation

QgsAttributeForm* QgsAttributeDialog::mAttributeForm
private

Definition at line 143 of file qgsattributedialog.h.

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

QPointer<QDialog> QgsAttributeDialog::mDialog
private
bool QgsAttributeDialog::mEditable
private

Definition at line 146 of file qgsattributedialog.h.

int QgsAttributeDialog::mFormNr
private

Definition at line 140 of file qgsattributedialog.h.

QgsHighlight* QgsAttributeDialog::mHighlight
private

Definition at line 139 of file qgsattributedialog.h.

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

QString QgsAttributeDialog::mReturnvarname
private

Definition at line 142 of file qgsattributedialog.h.

QString QgsAttributeDialog::mSettingsPath
private

Definition at line 137 of file qgsattributedialog.h.

Referenced by restoreGeometry(), and saveGeometry().

bool QgsAttributeDialog::mShowDialogButtons
private

Definition at line 141 of file qgsattributedialog.h.

int QgsAttributeDialog::sFormCounter
staticprivate

Definition at line 148 of file qgsattributedialog.h.

QString QgsAttributeDialog::sSettingsPath
staticprivate

Definition at line 149 of file qgsattributedialog.h.


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