17#include "moc_qgslistwidgetwrapper.cpp"
28 mWidget->
setList( QVariantList() );
41 QFrame *ret =
new QFrame( parent );
42 ret->setFrameShape( QFrame::StyledPanel );
43 QHBoxLayout *layout =
new QHBoxLayout( ret );
44 layout->setContentsMargins( 0, 0, 0, 0 );
46 layout->addWidget(
widget );
51 ret->setMinimumSize( QSize( 320, 110 ) );
58 mWidget = qobject_cast<QgsListWidget *>( editor );
69 return mWidget ? mWidget->
valid() :
true;
72void QgsListWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
79 const QMetaType::Type type =
field().
type();
81 const QVariantList list = mWidget->
list();
82 if ( list.size() == 0 &&
config( QStringLiteral(
"EmptyIsNull" ) ).toBool() )
86 if ( type == QMetaType::Type::QStringList )
89 for ( QVariantList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it )
90 result.append( it->toString() );
99void QgsListWidgetWrapper::onValueChanged()
104void QgsListWidgetWrapper::updateConstraintWidgetStatus()
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 data sets.