Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36257

QLineEdit clear button lacks notification signal

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.2.0
    • None

    Description

      There's no signal notifying that the clear button in QLineEdit was pressed. We have to rely on textChanged(), which is not the same.

      Let me give an example of use case:
      1) We have a "data filter" line edit.
      2) User types some filter expression and presses "Enter" to confirm it.
      3) Filtering engine applies defined filter.

      That's usual flow. Now another:
      1) User deletes (using backspace key) previous filter, so it's empty, but he doesn't press the "Enter", instead he wants to type new filter value and so he does. Filter was not applied yet.
      2) Now user pushes "Enter" and filter gets applied.

      Finally, why do we need mentioned signal:
      1) Repeat flow 1.
      2) Press "clear button".
      Filter was not applied, even this is the natural way things work - if you press clear button, user expects the filter to reset immediately, therefore filter should be applied with empty value.

      Currently flow 3 is impossible, because one cannot tell if textChanged() because of backspace, or because of clear button. In one case we don't want to apply filter, in another we do.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              peppe Giuseppe D'Angelo
              vipe Vipe
              Votes:
              6 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes