diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-05-30 20:58:24 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-06-01 21:34:03 +0000 |
commit | c901cdadc0a6ec65eddfe4f181274e56567f9973 (patch) | |
tree | 0cd722d395efc2b96a394ac862f1cda6ff61a9c3 /src/widgets/widgets/qlineedit.cpp | |
parent | e3e0a6d6d6c50dc21439f24728ee3614c5825d36 (diff) |
QLineEdit: Add an inputRejected() signal for when a key is not allowed
[ChangeLog][QtWidgets][QLineEdit] Added inputRejected() signal for when
a key press is not accepted by the QLineEdit. For instance, when an
invalid key is pressed for a validator set.
Task-number: QTBUG-57448
Change-Id: I39182a78b07b37c6da01905b8da4c57930e3454b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qlineedit.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 9e70b54601..43aa10bdb6 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1674,6 +1674,16 @@ 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. +*/ + +/*! 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 |