Quantcast
Channel: Active questions tagged qtquick2 - Stack Overflow
Viewing all articles
Browse latest Browse all 107

Is there a way to make the text characters inside a Label not have a space underneath?

$
0
0

In a QML code, I want to put a label containing capitalised words inside an image.The label is at the bottom of the image and I want the bottom of the text to match with the edge of the image (for example, like the graph paper from a diary). By making the bottom of both match with

anchors.bottom: myImage.bottom 

I can't avoid having some space between the letters and the edge of the image.

I have simplified it into an example as follows:

Rectangle {    id: content    width: 300    height: 300    color: "blue"    Label {        text: "ABC"        color: "black"        font.pixelSize: 200        anchors.bottom: content.bottom        anchors.horizontalCenter: content.horizontalCenter        background: Rectangle{            color: "green"        }    }}

And I can see that there is a green space between the letters and the bottom of the blue rectangle.

Is there a simple way to fix this other than messing with the value of anchors.bottomMargin?


Viewing all articles
Browse latest Browse all 107

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>