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

Keyboard focus is lost when changing the currentIndex of a ListView in onActiveFocusChanged

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • 4.8.x
    • 4.8.0
    • None
    • Linux, 4.8 from git

    Description

      When changing the currentIndex property of a ListView in onActiveFocusChanged the keyboard focus gets lost.

      I'm attaching a sample code that demonstrates that. If you run it on qmlviewer and press the down arrow, the square loses the active focus (goes blue from red) but the listview does not get it (the text does not become red).

      If you comment the "currentIndex = 1", you'll see that the text does indeed become red

      The debug lines say

      When started:
      Master Active Focus changed: true

      When pressing the down arrow:
      Slave Active Focus changed: true
      Slave Active Focus changed: true
      Master Active Focus changed: false
      Slave Active Focus changed: false

      If you comment the "currentIndex = 1" line you get

      When started:
      Master Active Focus changed: true

      When pressing the down arrow:
      Slave Active Focus changed: true
      Master Active Focus changed: false

      That is what i would expect also for the first case

      Attachments

        1. test.qml
          1 kB
          Albert Astals Cid (Canonical)
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kallneva kalle nevala
            tsdgeos_canonical Albert Astals Cid (Canonical) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes