21#include "moc_qgslistwidgetwrapper.cpp"
30 mWidget->setList( QVariantList() );
37 mWidget->setReadOnly( !enabled );
43 QFrame *ret =
new QFrame( parent );
44 ret->setFrameShape( QFrame::StyledPanel );
45 QHBoxLayout *layout =
new QHBoxLayout( ret );
46 layout->setContentsMargins( 0, 0, 0, 0 );
48 layout->addWidget(
widget );
53 ret->setMinimumSize( QSize( 320, 110 ) );
60 mWidget = qobject_cast<QgsListWidget *>( editor );
71 return mWidget ? mWidget->valid() :
true;
74void QgsListWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
81 const QMetaType::Type type =
field().
type();
84 const QVariantList list = mWidget->list();
85 if ( list.size() == 0 &&
config( QStringLiteral(
"EmptyIsNull" ) ).toBool() )
89 if ( type == QMetaType::Type::QStringList )
92 for ( QVariantList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it )
93 result.append( it->toString() );
102void QgsListWidgetWrapper::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.