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

Improve documentation on how to expose value types with enums to QML

XMLWordPrintable

    • 6c4f44773 (dev), facd6c685 (6.6), 797bbb3bc (tqtc/lts-6.5)

      The attached example runs into

      Warning: main.qml:11:26: Unqualified access
          property int evtype: EventType.INFO
                               ^^^^^^^^^
      Error: main.qml:11:26: Could not compile binding for evtype: Cannot access value for name EventType
          property int evtype: EventType.INFO
                               ^^^^^^^^^
      

      until you make EventType inherit from QObject and replace Q_GADGET by Q_OBJECT.

      From my understanding (and it works for some years in runtime), pure gadgets should be able to keep enums.

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

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes