Starl1ght
Starl1ght

Reputation: 4493

Get length of text in QML label in pixels

Is it somehow possible to get length of text label in QML in pixels?

like if

Label {
    id: label1
    text: "123"
}

How to get length in pixels for "123"?

Upvotes: 1

Views: 3391

Answers (1)

WaltPurvis
WaltPurvis

Reputation: 1530

I believe label1.paintedWidth is what you're looking for.

Upvotes: 2

Related Questions