26 , mTextEdit( nullptr )
27 , mPlainTextEdit( nullptr )
28 , mLineEdit( nullptr )
38 if (
config(
"UseHtml" ).toBool() )
55 v = mLineEdit->
text();
68 if (
field().convertCompatible( res ) )
72 else if (
field().type() == QVariant::String &&
field().length() > 0 )
86 if (
config(
"IsMultiline" ).toBool() )
88 if (
config(
"UseHtml" ).toBool() )
105 mTextEdit = qobject_cast<
QTextEdit*>( editor );
107 mLineEdit = qobject_cast<
QLineEdit*>( editor );
112 if ( mPlainTextEdit )
137 mWritablePalette = mLineEdit->palette();
138 mReadOnlyPalette = mLineEdit->palette();
139 mReadOnlyPalette.
setColor( QPalette::Text, mWritablePalette.
color( QPalette::Disabled, QPalette::Text ) );
145 return mLineEdit || mTextEdit || mPlainTextEdit;
153 if ( !(
field().type() == QVariant::Int ||
field().type() == QVariant::Double ||
field().type() == QVariant::LongLong ||
field().type() == QVariant::Date ) )
161 if ( val !=
value() )
163 if (
config(
"UseHtml" ).toBool() )
170 if ( mPlainTextEdit )
172 if ( val !=
value() )
185 if ( mPlainTextEdit )
void setEnabled(bool enabled) override
void setColor(ColorGroup group, ColorRole role, const QColor &color)
const QColor & color(ColorGroup group, ColorRole role) const
QString toPlainText() const
QVariant value() const override
Will be used to access the widget's value.
void initWidget(QWidget *editor) override
This method should initialize the editor widget with runtime data.
Lineedit with builtin clear button.
void setPlaceholderText(const QString &)
QgsTextEditWrapper(QgsVectorLayer *vl, int fieldIdx, QWidget *editor=nullptr, QWidget *parent=nullptr)
bool valid() const override
Return true if the widget has been properly initialized.
QWidget * createWidget(QWidget *parent) override
This method should create a new widget with the provided parent.
QVariant value(const QString &key, const QVariant &defaultValue) const
void setReadOnly(bool ro)
void setValue(const QVariant &value) override
QString left(int n) const
void setReadOnly(bool ro)
void setNullValue(const QString &nullValue)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString toPlainText() const
Represents a vector layer which manages a vector based data sets.
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.