Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Text baseline alignment
lite last edited by lite
Hi, I'm trying to align widgets so the baselines of the contained text are aligned. In the pictures below (both with normal size widgets and small widgets), you can see that the text in the QLabel and QComboBox are not baseline aligned. This happens with other widgets also, i.e. QLineEdit. I tried doing
setAlignment(Qt::AlignBaseline)on individual widgets and also the
QHBoxLayoutthat contains them, but it didn't fix it. Am I doing something wrong or is this a Qt issue? Thanks.
joeQ last edited by
ou,There isn't any pictires. would you show some pictures?
@lite You can align
QLabel's text to bottom.
@p3c0 It still doesn't align the baselines of the text. Now, the baseline for the label is below the one for the combo box.
@lite Can you show how do you want it actually ? Can you share some screen ?
@p3c0 Like this (without the red line, obviously):
See how the text "Type" and "Sprite" texts are aligned at the bottom?