QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
27 if ( !mJsonEditWidget )
30 return mJsonEditWidget->property( RAW_VALUE_PROPERTY.toUtf8().data() );
35 QgsJsonEditWidget *jsonEditWidget =
new QgsJsonEditWidget( parent );
38 return jsonEditWidget;
43 mJsonEditWidget = qobject_cast<QgsJsonEditWidget *>( editor );
44 if ( !mJsonEditWidget )
46 mJsonEditWidget =
new QgsJsonEditWidget( editor );
52 return ( mJsonEditWidget );
57 if ( !mJsonEditWidget )
60 mJsonEditWidget->blockSignals(
true );
61 mJsonEditWidget->setJsonText( QStringLiteral(
"<mixed values>" ) );
62 mJsonEditWidget->blockSignals(
false );
71 void QgsJsonEditWrapper::updateValues(
const QVariant &value,
const QVariantList & )
73 if ( !mJsonEditWidget )
76 mJsonEditWidget->setProperty( RAW_VALUE_PROPERTY.toUtf8().data(),
value );
77 mJsonEditWidget->setJsonText(
field().displayString(
value ) );
void initWidget(QWidget *editor) override
This method should initialize the editor widget with runtime data.
bool valid() const override
Returns true if the widget has been properly initialized.
QgsJsonEditWrapper(QgsVectorLayer *layer, int fieldIdx, QWidget *editor=nullptr, QWidget *parent=nullptr)
Constructor for QgsJsonEditWrapper.
void setFeature(const QgsFeature &feature) override
QVariant attribute(const QString &name) const
Lookup attribute value by attribute name.
QWidget * createWidget(QWidget *parent) override
This method should create a new widget with the provided parent.
QVariant value() const override
Will be used to access the widget's value.
Represents a vector layer which manages a vector based data sets.
void showIndeterminateState() override
Sets the widget to display in an indeterminate "mixed value" state.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void setEnabled(bool enabled) override