Home > Blockchain >  Qml Vertical Text Orientation
Qml Vertical Text Orientation

Time:09-23

How can I display a text in QML with vertical orientation like below

Text {
    id: name13
    text: qsTr("KITCHEN")
}

enter image description here

CodePudding user response:

Set width to 1, and wrapMode to Text.WrapAnywhere. This forces each letter to appear on its own line.

Text {
    text: "KITCHEN"
    anchors.centerIn: parent
    color: "white"
    width: 1
    wrapMode: Text.WrapAnywhere

    // -- additional parameters for prettiness --
    lineHeight: 0.9
    font.pixelSize: 50
    horizontalAlignment: Text.AlignHCenter
}

kitchen-vertical-png

  • Related