Aligning the text for a text label with the text in a QLineEdit
-
Hello all,
Title pretty much says it. I have a QLineEdit above a text label in a form layout. I am currently using a fixed pitch font and I would like the text in the text label to be aligned with the text in the QLineEdit.
I have been trying to do this for a few days now to no avail. Would anyone have any ideas on how I can accomplish this?
Thank you
-
Hi
What is wrong the things you tried?
Seems only a pixel or so.

if you apply frame, its very close

-
playing with a container for QLabel and setting padding as @mrjj said is the most direct solution but you could of course also write your own custom QLabel widget that paints the text bitmap whereever you want it inside the custom widget.
-
Hello all,
Thank you for your advice. I ended up placing the label into a container and adjusting the left margin padding. Set the value to 4 and everything appears to be lining up nicely. Thank you all for everything