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

#include <qgsattributeeditor.h>

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

Public Slots

void selectFileName ()
 
void selectDate ()
 
void loadUrl (const QString &)
 
void loadPixmap (const QString &)
 
void updateUrl ()
 
void openUrl ()
 
void updateColor ()
 

Public Member Functions

 QgsAttributeEditor (QObject *parent, QgsVectorLayer *vl=0, int idx=-1)
 

Static Public Member Functions

static QWidget * createAttributeEditor (QWidget *parent, QWidget *editor, QgsVectorLayer *vl, int idx, const QVariant &value, QMap< int, QWidget * > &proxyWidgets)
 Creates or prepares a attribute editor widget. More...
 
static QWidget * createAttributeEditor (QWidget *parent, QWidget *editor, QgsVectorLayer *vl, int idx, const QVariant &value)
 Creates or prepares a attribute editor widget. More...
 
static QWidget * createAttributeEditor (QWidget *parent, QWidget *editor, QgsVectorLayer *vl, int idx, const QVariant &value, QgsAttributeEditorContext &context)
 Creates or prepares a attribute editor widget. More...
 
static QWidget * createWidgetFromDef (const QgsAttributeEditorElement *widgetDef, QWidget *parent, QgsVectorLayer *vl, const QgsFeature &feat, QgsAttributeEditorContext &context, QString &labelText, bool &labelOnTop)
 Creates a widget form a QgsAttributeEditorElement definition. More...
 
static bool retrieveValue (QWidget *widget, QgsVectorLayer *vl, int idx, QVariant &value)
 
static bool setValue (QWidget *widget, QgsVectorLayer *vl, int idx, const QVariant &value)
 

Static Private Member Functions

static QComboBox * comboBox (QWidget *editor, QWidget *parent)
 
static QListWidget * listWidget (QWidget *editor, QWidget *parent)
 
static QgsDualViewdualView (QWidget *editor, QWidget *parent)
 

Private Attributes

QgsVectorLayermLayer
 
int mIdx
 

Detailed Description

Definition at line 39 of file qgsattributeeditor.h.

Constructor & Destructor Documentation

QgsAttributeEditor::QgsAttributeEditor ( QObject *  parent,
QgsVectorLayer vl = 0,
int  idx = -1 
)
inline

Definition at line 44 of file qgsattributeeditor.h.

Referenced by createAttributeEditor().

Member Function Documentation

QComboBox * QgsAttributeEditor::comboBox ( QWidget *  editor,
QWidget *  parent 
)
staticprivate

Definition at line 253 of file qgsattributeeditor.cpp.

Referenced by createAttributeEditor().

QWidget * QgsAttributeEditor::createAttributeEditor ( QWidget *  parent,
QWidget *  editor,
QgsVectorLayer vl,
int  idx,
const QVariant &  value,
QMap< int, QWidget * > &  proxyWidgets 
)
static

Creates or prepares a attribute editor widget.

Parameters
parentThe parent object
editorThe widget to prepare. Set to null if it should be generated
vlThe vector layer to use as data source
idxThe field index this widget refers to
valuethe value to initiate this widget with
proxyWidgetsan array of widgets, which will act as a value proxy if the same field is inserted multiple times
Deprecated:

Definition at line 283 of file qgsattributeeditor.cpp.

References QgsAttributeEditorContext::addProxyWidgets().

Referenced by createAttributeEditor(), QgsFormAnnotationItem::createDesignerWidget(), QgsAttributeTableDelegate::createEditor(), createWidgetFromDef(), and QgsAttributeDialog::init().

QWidget * QgsAttributeEditor::createAttributeEditor ( QWidget *  parent,
QWidget *  editor,
QgsVectorLayer vl,
int  idx,
const QVariant &  value 
)
static

Creates or prepares a attribute editor widget.

Parameters
parentThe parent object
editorThe widget to prepare. Set to null if it should be generated
vlThe vector layer to use as data source
idxThe field index this widget refers to
valuethe value to initiate this widget with

Definition at line 275 of file qgsattributeeditor.cpp.

References QgsAttributeEditorContext::addProxyWidgets(), and createAttributeEditor().

QWidget * QgsAttributeEditor::createAttributeEditor ( QWidget *  parent,
QWidget *  editor,
QgsVectorLayer vl,
int  idx,
const QVariant &  value,
QgsAttributeEditorContext context 
)
static

Creates or prepares a attribute editor widget.

Parameters
parentThe parent object
editorThe widget to prepare. Set to null if it should be generated
vlThe vector layer to use as data source
idxThe field index this widget refers to
valuethe value to initiate this widget with
contextthe context used for the created attribute editor

Definition at line 291 of file qgsattributeeditor.cpp.

References QgsAttributeEditorContext::addProxyWidget(), QgsStringRelay::appendProxy(), QgsFeature::attribute(), QgsVectorLayer::Calendar, QgsCategorizedSymbolRendererV2::categories(), QgsVectorLayer::CheckBox, QgsVectorLayer::Classification, QgsVectorLayer::Color, comboBox(), QgsVectorLayer::dataProvider(), QgsVectorLayer::dateFormat(), QgsVectorLayer::DialRange, QgsVectorLayer::EditorWidgetV2, QgsVectorLayer::editorWidgetV2(), QgsVectorLayer::editorWidgetV2Config(), QgsVectorLayer::EditRange, QgsVectorLayer::editType(), QgsVectorLayer::Enumeration, QgsVectorDataProvider::enumValues(), QgsExpression::evaluate(), QgsVectorLayer::fieldNameIndex(), QgsVectorLayer::FileName, QgsVectorLayer::getFeatures(), QgsExpression::hasParserError(), QgsVectorLayer::Hidden, QgsVectorLayer::Immutable, QgsMapLayerRegistry::instance(), QgsNetworkAccessManager::instance(), QgsVectorLayer::LineEdit, listWidget(), loadPixmap(), loadUrl(), QgsVectorLayer::ValueRelationData::mAllowMulti, QgsVectorLayer::ValueRelationData::mAllowNull, QgsMapLayerRegistry::mapLayer(), MathUtils::max(), QgsVectorLayer::ValueRelationData::mFilterExpression, MathUtils::min(), QgsVectorLayer::ValueRelationData::mKey, QgsVectorLayer::ValueRelationData::mLayer, QgsVectorLayer::RangeData::mMax, QgsVectorLayer::RangeData::mMin, QgsVectorLayer::ValueRelationData::mOrderByValue, QgsVectorLayer::RangeData::mStep, QgsVectorLayer::ValueRelationData::mValue, QgsExpression::needsGeometry(), QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoFlags, QgsFeatureRequest::NoGeometry, openUrl(), QgsVectorLayer::pendingFields(), QgsVectorLayer::Photo, QgsExpression::prepare(), QgsAttributeEditorContext::proxyWidget(), QgsAttributeEditor(), QgsVectorLayer::range(), QgsExpression::referencedColumns(), QgsVectorLayer::rendererV2(), selectDate(), selectFileName(), setValue(), size, QgsVectorLayer::SliderRange, QgsVectorLayer::TextEdit, tr, QgsField::type(), QgsVectorDataProvider::uniqueValues(), QgsVectorLayer::UniqueValues, QgsVectorLayer::UniqueValuesEditable, updateColor(), updateUrl(), QgsVectorLayer::UuidGenerator, QgsVectorLayer::ValueMap, QgsVectorLayer::valueMap(), QgsVectorLayer::ValueRelation, QgsVectorLayer::valueRelation(), QgsVectorLayer::WebView, and QgsVectorLayer::widgetSize().

QWidget * QgsAttributeEditor::createWidgetFromDef ( const QgsAttributeEditorElement widgetDef,
QWidget *  parent,
QgsVectorLayer vl,
const QgsFeature feat,
QgsAttributeEditorContext context,
QString &  labelText,
bool &  labelOnTop 
)
static

Creates a widget form a QgsAttributeEditorElement definition.

Will recursively generate containers and widgets.

Parameters
widgetDefThe definition for the widget
parentThe parent object
vlThe vector layer to use as data source
featThe feature to create the widget for
contextthe context used for the created attribute editor
[out]labelTextAn optional label text will be written into the referenced QString. It will be set to a QString::null value if no label should be shown
[out]labelOnTopWill be set to true if the label should be placed on top of the field. If set to false, the label should be shown left or right of the field

Definition at line 1385 of file qgsattributeeditor.cpp.

References QgsAttributeEditorElement::AeTypeContainer, QgsAttributeEditorElement::AeTypeField, QgsAttributeEditorElement::AeTypeRelation, QgsVectorLayer::attributeDisplayName(), QgsFeature::attributes(), QgsAttributeEditorContainer::children(), createAttributeEditor(), QgsRelationEditorWidget::createRelationEditor(), QgsVectorLayer::editType(), QgsVectorLayer::fieldEditable(), QgsAttributeEditorField::idx(), QgsVectorLayer::Immutable, index, QgsVectorLayer::isEditable(), QgsAttributeEditorContainer::isGroupBox(), QgsVectorLayer::labelOnTop(), QgsAttributeEditorElement::name(), QgsVectorLayer::Photo, QgsDebugMsg, QgsAttributeEditorRelation::relation(), tr, QgsAttributeEditorElement::type(), and QgsVectorLayer::WebView.

Referenced by QgsAttributeDialog::init().

static QgsDualView* QgsAttributeEditor::dualView ( QWidget *  editor,
QWidget *  parent 
)
staticprivate
QListWidget * QgsAttributeEditor::listWidget ( QWidget *  editor,
QWidget *  parent 
)
staticprivate

Definition at line 264 of file qgsattributeeditor.cpp.

Referenced by createAttributeEditor().

void QgsAttributeEditor::loadPixmap ( const QString &  name)
slot

Definition at line 143 of file qgsattributeeditor.cpp.

References mIdx, mLayer, size, and QgsVectorLayer::widgetSize().

Referenced by createAttributeEditor().

void QgsAttributeEditor::loadUrl ( const QString &  url)
slot

Definition at line 126 of file qgsattributeeditor.cpp.

Referenced by createAttributeEditor().

void QgsAttributeEditor::openUrl ( )
slot

Definition at line 200 of file qgsattributeeditor.cpp.

Referenced by createAttributeEditor().

bool QgsAttributeEditor::retrieveValue ( QWidget *  widget,
QgsVectorLayer vl,
int  idx,
QVariant &  value 
)
static
void QgsAttributeEditor::selectDate ( )
slot

Definition at line 84 of file qgsattributeeditor.cpp.

References QgsFieldValidator::dateFormat(), and tr.

Referenced by createAttributeEditor().

void QgsAttributeEditor::selectFileName ( )
slot

Definition at line 63 of file qgsattributeeditor.cpp.

References tr.

Referenced by createAttributeEditor().

bool QgsAttributeEditor::setValue ( QWidget *  widget,
QgsVectorLayer vl,
int  idx,
const QVariant &  value 
)
static
void QgsAttributeEditor::updateColor ( )
slot

Definition at line 217 of file qgsattributeeditor.cpp.

References QgsColorButton::color(), and QgsColorButton::setColor().

Referenced by createAttributeEditor().

void QgsAttributeEditor::updateUrl ( )
slot

Definition at line 177 of file qgsattributeeditor.cpp.

Referenced by createAttributeEditor().

Member Data Documentation

int QgsAttributeEditor::mIdx
private

Definition at line 118 of file qgsattributeeditor.h.

Referenced by loadPixmap().

QgsVectorLayer* QgsAttributeEditor::mLayer
private

Definition at line 117 of file qgsattributeeditor.h.

Referenced by loadPixmap().


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