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

Enum constants do not work on instances

    XMLWordPrintable

Details

    • 6ebf215fdaf2d757ab90ae4d46c4b938e978e2dc

    Description

      There is no way to register global objects when importing a QML module.

      In Qt components I'd like to have a global Screen object that respects the 'import ... as Foo' prefix. The global object also needs to export types as well as methods.

      So this should work (Screen is a QObject with a Orientation enum and orientation property):

      import Qt.components
      Item

      { orientation: Screen.orientation; }

      Item

      { orientation: Screen.Portrait }

      import Qt.components as Components
      Item

      { orientation: Components.Screen.orientation; }

      Item

      { orientation: Components.Screen.Portrait }

      Attachments

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

        Activity

          People

            chriadam Christopher Adams (closed Nokia identity) (Inactive)
            laknoll Lars Knoll
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes