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 ) );
138 if ( !(
field().type() == QVariant::Int ||
field().type() == QVariant::Double ||
field().type() == QVariant::LongLong ||
field().type() == QVariant::Date ) )
146 if ( val !=
value() )
148 if (
config(
"UseHtml" ).toBool() )
155 if ( mPlainTextEdit )
157 if ( val !=
value() )
170 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 setNullValue(QString nullValue)
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
QgsTextEditWrapper(QgsVectorLayer *vl, int fieldIdx, QWidget *editor=0, QWidget *parent=0)
void setReadOnly(bool ro)
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.