Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
5.12.0, 5.13.0 Beta 1
-
None
Description
Singleton QML files are very useful to outsource colors or icons in readonly properties. Sometimes I have multiple singleton qml files which refer to each other.
symptoms:
endless loop, browser crash, no warnings, no error messages
How to reproduce:
#file 1 – qmldir
module MyModule singleton Colors 1.0 Colors.qml singleton TypeDef 1.0 TypeDef.qml
#file 2 – Colors.qml
pragma Singleton import QtQuick 2.5 QtObject { readonly property color greyBlue: "#485058" readonly property color darkBlue: "#2e3439" }
#file 3 – TypeDef.qml
pragma Singleton import QtQuick 2.5 import MyModule 1.0 // this construct works in desktop environments but unfortunately not with Web Assembly QtObject { function getColor(input) { if(........) return Colors.greyBlue else return Colors.darkBlue } }
how to work around:
The only way to get this running in browser is to remove the import of the library and redefine the outsourced colors. So you need to hold the Colors twice which is error prone.