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

Attached property enum value cannot be used

    XMLWordPrintable

Details

    Description

      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)
      
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes