Thanks for the response.
I don't see any suitable value in FontMetrics.
tightBoundingRect is helpful and can be used. But unfortunately, it does
not take underline into account (i.e. it ignores
FontMetrics.font.underline). I don't know if it's a bug or not. Also,
it's very slow on Windows, as it stated in docs.
On 4/14/2021 12:12 AM, Murphy, Sean wrote:
I want to center vertically image and text. But when I'm trying to, it does not
look centered, because of an empty space at the top of the text.
What I mean is illustrated by this image:
The blue rectangle looks a bit above the text. However, these two controls are
centered actually. The second image illustrates this by showing text's bounding
rectangle.
Is there any way to remove this few empty lines of pixels at the top in the
text control?
Or at least somehow get its height so I can take this into account manually?
Have you looked at font metrics
(https://doc.qt.io/qt-5.12/qml-qtquick-fontmetrics.html)? I've never played
around with the parts your concerned about specifically, but it looks like
maybe your answer may lie somewhere in the ascent and/or tightBoundingRect()
areas?
Sean
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest