[Interest] Align text to top of Text

Shantanu Tushar shaan7in at gmail.com
Tue Mar 28 20:51:27 CEST 2017


Hi,

I'm trying to align some text in a Text so that it exactly touches the left
and top edges of the Text item. With the following-

Rectangle {
    anchors { fill: parent; margins: 5 }
    border { width: 1; color: "red" }

    Text {
        anchors.fill: parent

        topPadding: 0
        verticalAlignment: Qt.AlignTop
        text: "HELLO WORLD"
    }
}

I am able to get the following result-



As you can see there is still space between the text and the topmost edge
of the Text. How do I eliminate this space?

Cheers,​

-- 
Shantanu Tushar    (UTC +0530)
shantanu.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170329/711a6ad5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_20170329_001801.png
Type: image/png
Size: 1763 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170329/711a6ad5/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_20170329_001801.png
Type: image/png
Size: 1763 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170329/711a6ad5/attachment-0001.png>


More information about the Interest mailing list