How to make the width & height of a rectangle change dynamically with text.
Solved
QML and Qt Quick
-
@Circuits To do this, the easiest way is to use TextMetrics.
Something like this:Rectangle { property alias text: _label.text implicitWidth: tm.width implicitHeight: tm.height Label { id: _label anchors.centerIn: parent } TextMetrics { id: tm font: _label.font text: _label.text } }