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

QLineControl::fixup emits textEdited signal instead of textChanged

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 4.8.3
    • None
    • Change-Id: Iccef45c4b858a65fd5097dc9e5033cefb09ad889

    Description

      bool QLineControl::fixup() // this function assumes that validate currently returns != Acceptable
      {
      ...
              if (m_validator->validate(textCopy, cursorCopy) == QValidator::Acceptable) {
                  if (textCopy != m_text || cursorCopy != m_cursor)
                      internalSetText(textCopy, cursorCopy);
                  return true;
              }
      ...
      }
      

      This method is called from FocusOut event handler, which happens when user opens a QComboBox popup, for example. Emitting textChanged signal leads to showing QCompleter popup too. As a result, we see 2 popups.
      I suggest simply change line internalSetText(textCopy, cursorCopy); to internalSetText(textCopy, cursorCopy, false); which prevents emiting textEdited signal.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              arch Ivan Komissarov
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes