> 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

Reply via email to