Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.2.1
-
None
-
Ubuntu Linux 12.04 LTS, 64-bit
Qt development environment installed from qt-opensource-linux-x64-5.2.1.run from qt-project.org
3.9 GiB RAM, Intel i7-3740QM CPU
Description
Creating a property alias to a QML singleton object produces the following runtime error:
Invalid alias reference. Unable to find id "AcmeSoftwareStyle"
I attached a minimal project that shows the error. Commenting out the line causing the error will demonstrate that the singleton is implemented correctly.
Here is the relevant QML:
main.qml:JavaScript
import QtQuick 2.0 import "." Rectangle { width: 360 height: 360 color: AcmeSoftwareStyle.bkgdColor property alias style: AcmeSoftwareStyle // <- comment out for app to work Text { text: qsTr("Hello World") color: AcmeSoftwareStyle.textColor font.pointSize: AcmeSoftwareStyle.font.pointSize.extraLarge anchors.centerIn: parent font.family: style.font.family // should set font to courier } MouseArea { anchors.fill: parent; onClicked: Qt.quit() } }