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

`Button` can't be converted to `Control`

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.8.0
    • None
    • Windows

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      
      ApplicationWindow {
          id: root
          visible: true
          height: 480
          width: 640
      
          Text {
              anchors.bottom: parent.bottom
              text: "Current focus: " + (root.activeFocusControl as Control)
          }
      
          Row {
              Repeater {
                  model: 16
      
                  Button {
                      required property int index
      
                      text: index
                  }
              }
          }
      }
      
      

      The documentation mentioned "The following members are inherited from Control." for Button, hinting that it should inherit from Control. However that doesn't seem to be the case. I wanted to accept Control to call focusReason on whatever Control gets the current focus, but I can't due to this limitation.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jirauser69920 user-6dbf8 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes