I want to to scale a button's text with respect to its height:
import QtQuick 2.11
import QtQuick.Controls 2.10
ToolButton {
id: btn
font.pixelSize: implicitHeight*0.8 // Binding loop detected for property "font.pixelSize"
contentItem: Text {
text: btn.text
font: btn.font
}
}
This sometimes works but more often a binding loop is detected because when the font size changes, also the button size changes. What is the correct way for scaling the text size?
Regards,
Use "height" instead of "implicitHeight".
And the ToolButton's height is bound to the font size by default, so you need to set a height for your button.