43 cfg.
insert(
"field_format", configElement.
attribute(
"field_format" ) );
44 cfg.
insert(
"display_format", configElement.
attribute(
"display_format" ) );
45 cfg.
insert(
"calendar_popup", configElement.
attribute(
"calendar_popup" ) ==
"1" );
46 cfg.
insert(
"allow_null", configElement.
attribute(
"allow_null" ) ==
"1" );
57 configElement.
setAttribute(
"field_format", config[
"field_format"].toString() );
58 configElement.
setAttribute(
"display_format", config[
"display_format"].toString() );
59 configElement.
setAttribute(
"calendar_popup", config[
"calendar_popup"].toBool() );
60 configElement.
setAttribute(
"allow_null", config[
"allow_null"].toBool() );
84 result = date.
toString( displayFormat );
97 map.
insert( QDateTimeEdit::staticMetaObject.className(), 10 );
98 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.
void setAttribute(const QString &name, const QString &value)
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.
const T value(const Key &key) const