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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              jclink Jessia Clinkscale
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes