49 cfg.insert(
"field_format", configElement.
attribute(
"field_format" ) );
50 cfg.insert(
"display_format", configElement.
attribute(
"display_format" ) );
51 cfg.insert(
"calendar_popup", configElement.
attribute(
"calendar_popup" ) ==
"1" );
52 cfg.insert(
"allow_null", configElement.
attribute(
"allow_null" ) ==
"1" );
63 configElement.
setAttribute(
"field_format", config[
"field_format"].toString() );
64 configElement.
setAttribute(
"display_format", config[
"display_format"].toString() );
65 configElement.
setAttribute(
"calendar_popup", config[
"calendar_popup"].toBool() );
66 configElement.
setAttribute(
"allow_null", config[
"allow_null"].toBool() );
90 result = date.
toString( displayFormat );
103 Q_UNUSED( fieldIdx );
106 return Qt::AlignLeft;
112 map.
insert( QDateTimeEdit::staticMetaObject.className(), 10 );
113 map.
insert( QgsDateTimeEdit::staticMetaObject.className(), 10 );
QString toString(Qt::DateFormat format) const
virtual QMap< const char *, int > supportedWidgetTypes() override
Returns a list of widget types which this editor widget supports.
QgsEditorWidgetWrapper * create(QgsVectorLayer *vl, int fieldIdx, QWidget *editor, QWidget *parent) const override
Override this in your implementation.
#define QGSDATETIMEEDIT_DATEFORMAT
QgsDateTimeEditFactory(const QString &name)
QString attribute(const QString &name, const QString &defValue) const
void writeConfig(const QgsEditorWidgetConfig &config, QDomElement &configElement, QDomDocument &doc, const QgsVectorLayer *layer, int fieldIdx) override
Serialize your configuration and save it in a xml doc.
Wraps a date time widget.
Qt::AlignmentFlag alignmentFlag(QgsVectorLayer *vl, int fieldIdx, const QgsEditorWidgetConfig &config) const override
Return the alignment for a particular field.
QVariantMap QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
void setAttribute(const QString &name, const QString &value)
QgsSearchWidgetWrapper * createSearchWidget(QgsVectorLayer *vl, int fieldIdx, QWidget *parent) const override
By default a simple QgsFilterLineEdit is returned as search widget.
QString representValue(QgsVectorLayer *vl, int fieldIdx, const QgsEditorWidgetConfig &config, const QVariant &cache, const QVariant &value) const override
Create a pretty String representation of the value.
QDateTime fromString(const QString &string, Qt::DateFormat format)
QVariant value(const QString &key, const QVariant &defaultValue) const
QgsEditorWidgetConfig readConfig(const QDomElement &configElement, QgsVectorLayer *layer, int fieldIdx) override
Read the config from an XML file and map it to a proper QgsEditorWidgetConfig.
iterator insert(const Key &key, const T &value)
QgsEditorConfigWidget * configWidget(QgsVectorLayer *vl, int fieldIdx, QWidget *parent) const override
Override this in your implementation.
Represents a vector layer which manages a vector based data sets.