23#include "moc_qgslistwidgetwrapper.cpp"
25using namespace Qt::StringLiterals;
34 mWidget->setList( QVariantList() );
41 mWidget->setReadOnly( !enabled );
47 QFrame *ret =
new QFrame( parent );
48 ret->setFrameShape( QFrame::StyledPanel );
49 QHBoxLayout *layout =
new QHBoxLayout( ret );
50 layout->setContentsMargins( 0, 0, 0, 0 );
52 layout->addWidget(
widget );
57 ret->setMinimumSize( QSize( 320, 110 ) );
64 mWidget = qobject_cast<QgsListWidget *>( editor );
75 return mWidget ? mWidget->valid() :
true;
78void QgsListWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
85 const QMetaType::Type type =
field().
type();
88 const QVariantList list = mWidget->list();
89 if ( list.size() == 0 &&
config( u
"EmptyIsNull"_s ).toBool() )
93 if ( type == QMetaType::Type::QStringList )
96 for ( QVariantList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it )
97 result.append( it->toString() );
106void 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.