Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7
-
-
ce95fae56 (dev)
Description
I created a Singleton in which I declared a readonly font
//Fonts.qml import QtQuick pragma Singleton Item { readonly property font primary: Qt.font({ family: "DIN Next LT Pro", styleName: "Bold Condensed", pixelSize: 40 }) }
and another qml file in which I am trying to read from this singleton.
// Main.qml import QtQuick Window { id: window width: 640 height: 480 visible: true title: qsTr("Hello World") Component.onCompleted: { console.log(Fonts.primary.family); console.log(Fonts.primary.styleName); } }
Running this code results in the following output:
qml: DIN Next LT Pro
qml:
styleName also doesn't work if I am trying to use the font directly i.e. :
Text { font: Fonts.primary }
Attachments
For Gerrit Dashboard: QTBUG-125495 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
564368,8 | Ensure that "styleName" is set by Qt.font | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |