21#include "moc_qgskeyvaluewidgetwrapper.cpp"
31 return mWidget->map();
36 mWidget->setMap( QVariantMap() );
43 mWidget->setReadOnly( !enabled );
52 QFrame *ret =
new QFrame( parent );
53 ret->setFrameShape( QFrame::StyledPanel );
54 QHBoxLayout *layout =
new QHBoxLayout( ret );
56 ret->setMinimumSize( QSize( 320, 110 ) );
67 mWidget = qobject_cast<QgsKeyValueWidget *>( editor );
81void QgsKeyValueWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
83 QVariantMap mapValue =
value.toMap();
85 if (
field().type() == QMetaType::Type::QString )
87 const QJsonDocument doc = QJsonDocument::fromJson(
value.toString().toUtf8() );
88 if ( !doc.isNull() && doc.isObject() )
90 mapValue = doc.object().toVariantMap();
93 mWidget->setMap( mapValue );
101void QgsKeyValueWidgetWrapper::onValueChanged()
static QVariant createNullVariant(QMetaType::Type metaType)
Helper method to properly create a null QVariant from a metaType Returns the created QVariant.
Represents a vector layer which manages a vector based dataset.