[Interest] QML: What is a proper way to bind Label's font to FontMetrics's one

Alexander Dyagilev alervdvcw at gmail.com
Sun Jun 18 00:58:34 CEST 2023


Hello,

Ahh, it was bug in my code: I forgot, that FontMetrics.advanceWidth does 
not create a binding with font...

On 6/16/2023 11:19 AM, Alexander Dyagilev wrote:
> Hello,
>
> Qt 5.12.12 - works fine.
>
> Qt 6.4.2 - works buggy (IMO).
>
> Is it just a Qt bug, or is it me know QML not very good?
>
> So, I'm trying to bind |font| properties in this way:
>
> Label {
>       id: root
>       FontMetrics {
>          font: root.font
>       }
> }
>
> Is it legal? If no, is there one? Or, at least, a workaround maybe?  :)
>


More information about the Interest mailing list