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

Attached property enum value cannot be used

XMLWordPrintable

      See example below. Accessible.Button etc should be an enum values.
      It works in the most simple use case:
      Accessible.role: Accessible.CheckBox
      But this fails:
      Accessible.role: 1 ? Accessible.RadioButton : Accessible.CheckBox

      import QtQuick 2.0
      
      Rectangle {
          id: rect
          Accessible.role: Accessible.CheckBox
      
          Component.onCompleted: {
      
              console.log(rect.Accessible.role) // works, 44
      
              console.log(Accessible.Button)    // undefined
      
              Accessible.role = 1 ? Accessible.RadioButton : Accessible.CheckBox // Error: Cannot assign [undefined] to int
      
              console.log(rect.Accessible.role)
      
          }
      }
      

        1. attached-accessibility.qml
          0.4 kB
          Frederik Gladhorn
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            mvogt Matthew Vogt (closed Nokia identity) (Inactive)
            frederik Frederik Gladhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes