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

QML: explicit cast between int and enumeration

    XMLWordPrintable

Details

    Description

      Unfortunately, javascript does not have the concept of enumerations, and it has been a long term issue. People came up with several suboptimal workarounds, but those feel like workarounds, i.e. sometimes you can modify the integer, which is not typical for an enumeration and so forth.

      Now, that v4 has been integrated a month ago or so, it might be simpler to establish such a feature without much overhead, i.e. almost no-op.

      The syntax would need to be discussed, but it would be simple like: enumProperty: MyEnumType(myInt)

      There could be a method in JS that does the casting, and its bulk coming from the C++ side.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            lpapp Laszlo Papp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes