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

Enums leak from properties to parent objects

    XMLWordPrintable

    Details

    • Commits:
      121b8a6ae42d9423250ab1121c15c49ab064307a

      Description

      An enum defined in class A and used as a property works fine inside a binding and a javascript function
      Using the same enum from class A in a new class B also works fine inside a binding and a javascript function.
      Deriving class C from class B and using the Q_OBJECT macro, Makes the enum work inside the binding, but using the same enum inside a javascript function doesn't.

      Attached an example which instantiates all 3 classes and using a binding to set the enum.
      3 Buttons are defined which use a Javascript function to update the enum properties. Using the "Change Object C" button, results in no change of the property but shows the following warning:

      qrc:/main.qml:45: Error: Cannot assign [undefined] to int
      

      None of this should actually work. We need to output a warning when we detect it and deprecate this behavior.

        Attachments

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

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            gagi Dominik Holland
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes