Please nominate your Qt Champions for 2021!

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?

                    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

    thank a lot for your help!!

Log in to reply