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

Enums leak from properties to parent objects

    XMLWordPrintable

    Details

      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

        For Gerrit Dashboard: QTBUG-83703
        # Subject Branch Project Status CR V

          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