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

QLineControl::fixup emits textEdited signal instead of textChanged

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes