[Interest] [QML] Is there a way to implement font.pointSize/font.pixelSize switch?

Alexander Dyagilev alervdvcw at gmail.com
Mon Apr 13 17:12:44 CEST 2026


Hello,

This code can only switch a Label to use font.pixelSize from font.pointSize
and can't switch it back.

Is there a way to make it work? In other words, how do I reset
font.pixelSize to an undefined value so it will use font.pointSize again?

Label {
            text: "TEST"
            font.pointSize: cb.checked ? 0 : 13
            font.pixelSize: cb.checked ? 13 : 0
 }

 CheckBox {
            id: cb
            text: "Use font.pixelSize"
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20260413/1e97a7b1/attachment.htm>


More information about the Interest mailing list