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

QmlCacheGen miscompiles Enum constant reference, yielding "undefined"

    XMLWordPrintable

Details

    • All
    • 73f66c8f9 (dev), 3896fb0dc (6.6), 51c99ab3a (tqtc/lts-6.5), 09c2483ae (tqtc/lts-6.2)

    Description

      The `qmlcachegen` tool that generates bytecode for QML behaves differently than when not using pre-compiled QML files (when caching the files at runtime). Please see attached zip-file.

      The line

      property var eF: Main.Foo
      

      appears similarly in our real code and is intended to create a "shortcut" for the long enumeration name. It has been there for a considerable time and much code relies on this to work in our codebase. However, when we changed to  CMake and using the builtin qmlcachegen, it doesn't work anymore and `eF.Bar` yields `undefined`.

      property int bar: eF.Bar
      

      [12:54:06.595] warning: qrc:/qt/qml/reproduce/Main.qml:14:5: Unable to assign [undefined] to int

      If you add "NO_CACHEGEN", it works as expected, but you won't get syntax-checking at compile time anymore.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            jschaubzes Johannes Schaub
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes