Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

fontSizeMode: Text.Fit not working with textFormat: Text.RichText but <sub>1</sub> work only with RichText



  • Hello, I need to have subscript on my text in QML but it's only recognized with RichText but fontSizeMode: Text.Fit doesn't work with RichText , how can I make it work?

    Text{
                    id:endMainCharge01TpsDataTitle
                    Layout.preferredWidth: parent.width/6
                    Layout.preferredHeight: parent.height/14
                    wrapMode: Text.WordWrap
                    textFormat: Text.RichText
                    text:"<small>Duration main charge 0.1C<sub>1</sub>A (min)</small>"
                    padding: 5
                    Layout.alignment : Qt.AlignRight
                    fontSizeMode: Text.Fit
                    minimumPixelSize: 1
                    font:theme.headerFont
                }
    

    thank a lot for your help!!


Log in to reply