17#include "moc_qgsuuidwidgetwrapper.cpp"
29 QString uuid = QUuid::createUuid().toString();
31 if ( maxLength <= 0 || maxLength >= uuid.length() )
38 return uuid.replace(
'-', QString() ).mid( 1, maxLength );
47 v = mLineEdit->text();
56 return new QLineEdit( parent );
61 mLineEdit = qobject_cast<QLineEdit *>( editor );
62 mLabel = qobject_cast<QLabel *>( editor );
64 mLineEdit->setEnabled(
false );
69 return mLineEdit || mLabel;
72void QgsUuidWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
77 if (
field().type() == QMetaType::Type::QString &&
field().length() > 0 )
83 mLineEdit->setText( uuid );
85 mLabel->setText( uuid );
92 mLineEdit->setText(
value.toString() );
94 mLabel->setText(
value.toString() );
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.
Represents a vector layer which manages a vector based data sets.