27 , mPlainTextEdit( NULL )
38 if (
config(
"UseHtml" ).toBool() )
55 v = mLineEdit->
text();
68 if (
field().convertCompatible( res ) )
76 if (
config(
"IsMultiline" ).toBool() )
78 if (
config(
"UseHtml" ).toBool() )
95 mTextEdit = qobject_cast<
QTextEdit*>( editor );
97 mLineEdit = qobject_cast<
QLineEdit*>( editor );
102 if ( mPlainTextEdit )
127 mWritablePalette = mLineEdit->palette();
128 mReadOnlyPalette = mLineEdit->palette();
129 mReadOnlyPalette.
setColor( QPalette::Text, mWritablePalette.
color( QPalette::Disabled, QPalette::Text ) );
135 return mLineEdit || mTextEdit || mPlainTextEdit;
143 if ( !(
field().type() == QVariant::Int ||
field().type() == QVariant::Double ||
field().type() == QVariant::LongLong ||
field().type() == QVariant::Date ) )
151 if ( val !=
value() )
153 if (
config(
"UseHtml" ).toBool() )
160 if ( mPlainTextEdit )
162 if ( val !=
value() )
175 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
void initWidget(QWidget *editor) override
This method should initialize the editor widget with runtime data.
Lineedit with builtin clear button.
void setPlaceholderText(const QString &)
QVariant value() override
Will be used to access the widget's value.
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
bool valid() override
Return true if the widget has been properly initialized.
QgsTextEditWrapper(QgsVectorLayer *vl, int fieldIdx, QWidget *editor=0, QWidget *parent=0)
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.