diff options
Diffstat (limited to 'src/widgets/widgets/qlineedit.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index ca6aacc16c..27a94740ac 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1676,6 +1676,21 @@ void QLineEdit::mouseDoubleClickEvent(QMouseEvent* e) */ /*! + \fn void QLineEdit::inputRejected() + + This signal is emitted when the user presses a key that is not + considered to be acceptable input. For example, if a key press + results in a validator's validate() call to return Invalid. + Another case is when trying to enter in more characters beyond the + maximum length of the line edit. + + Note: This signal will still be emitted in a case where part of + the text is accepted but not all of it is. For example, if there + is a maximum length set and the clipboard text is longer than the + maximum length when it is pasted. +*/ + +/*! Converts the given key press \a event into a line edit action. If Return or Enter is pressed and the current text is valid (or @@ -1946,8 +1961,7 @@ void QLineEdit::paintEvent(QPaintEvent *) if (!d->placeholderText.isEmpty()) { const Qt::LayoutDirection layoutDir = d->placeholderText.isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight; const Qt::Alignment alignPhText = QStyle::visualAlignment(layoutDir, QFlag(d->alignment)); - QColor col = pal.text().color(); - col.setAlpha(128); + const QColor col = pal.placeholderText().color(); QPen oldpen = p.pen(); p.setPen(col); Qt::LayoutDirection oldLayoutDir = p.layoutDirection(); @@ -2002,7 +2016,7 @@ void QLineEdit::paintEvent(QPaintEvent *) // draw text, selections and cursors #ifndef QT_NO_STYLE_STYLESHEET - if (QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(style())) { + if (QStyleSheetStyle* cssStyle = qt_styleSheet(style())) { cssStyle->styleSheetPalette(this, &panel, &pal); } #endif |