diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextinput.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextinput.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 90f5a70..b4f36f4 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE /*! \qmlclass TextInput QDeclarativeTextInput + \ingroup qml-basic-visual-elements \since 4.7 \brief The TextInput item displays an editable line of text. \inherits Item @@ -276,8 +277,10 @@ void QDeclarativeTextInput::setSelectionColor(const QColor &color) QPalette p = d->control->palette(); p.setColor(QPalette::Highlight, d->selectionColor); d->control->setPalette(p); - clearCache(); - update(); + if (d->control->hasSelectedText()) { + clearCache(); + update(); + } emit selectionColorChanged(color); } @@ -302,8 +305,10 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color) QPalette p = d->control->palette(); p.setColor(QPalette::HighlightedText, d->selectedTextColor); d->control->setPalette(p); - clearCache(); - update(); + if (d->control->hasSelectedText()) { + clearCache(); + update(); + } emit selectedTextColorChanged(color); } @@ -561,6 +566,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b) /*! \qmlclass IntValidator QIntValidator + \ingroup qml-basic-visual-elements This element provides a validator for integer values. */ @@ -579,6 +585,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b) /*! \qmlclass DoubleValidator QDoubleValidator + \ingroup qml-basic-visual-elements This element provides a validator for non-integer numbers. */ @@ -617,6 +624,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b) /*! \qmlclass RegExpValidator QRegExpValidator + \ingroup qml-basic-visual-elements This element provides a validator, which counts as valid any string which matches a specified regular expression. @@ -1229,8 +1237,12 @@ void QDeclarativeTextInput::setPasswordCharacter(const QString &str) Q_D(QDeclarativeTextInput); if(str.length() < 1) return; - emit passwordCharacterChanged(); d->control->setPasswordCharacter(str.constData()[0]); + EchoMode echoMode_ = echoMode(); + if (echoMode_ == Password || echoMode_ == PasswordEchoOnEdit) { + updateSize(); + } + emit passwordCharacterChanged(); } /*! |