Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
5.12.4
-
Build machine; Windows 7 Pro 64bit
Qt Versions:
- Qt 15.2.4 for Windows 32 bits
- Qt 15.2.4 for Android ARM
Description
Hi all,
I am modernizing our application from Qt 5.4.2 to last LTS version (Qt 5.12.4). While doing this, I think I've found a bug in qtquickcompiler.
I have declared a QQuickPaintedItem object, which has an enumeration to defined drawing types, like this:
class TourPlayerItem : public QQuickPaintedItem { Q_OBJECT public: enum DrawType { DrawTypeNormal, DrawTypeBackward, DrawTypeWorkRegion, DrawTypeContainerRegionSingle, DrawTypeContainerRegionDouble, DrawTypeOffline, ... }; #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) Q_ENUMS(DrawType) #else Q_ENUM(DrawType) #endif ... }
This class is registered to be accessible from QML:
qmlRegisterType<TourPlayerItem>("com.Geocept.Tour", 1, 0, "GCTourPlayer");
In QML, this class is used like this:
GCTourPlayer { id: tourPlayerTrace anchors.fill: parent drawTypes: [ DrawType { type: GCTourPlayer.DrawTypeBackward; color: '#D9004D9E' }, DrawType { type: GCTourPlayer.DrawTypeWorkRegion; color: '#E67814A0' } ] }
This works fine with Qt 5.4.2 and with Qt 5.12.4 only if QtQuickCompiler is disabled.
When QtQuickCompiler is enabled, type is always set to '0'.
I've got the same issue on Windows and on Android