0

I have designed an UI with Qt but I am facing an issue. In my UI I use two QLineEdit for IP addresses. They have a fixed width using setFixedWidth.

When the childWidget that contains them is set on top with parentLayout->setAlignment(&childWidget, Qt::AlignTop) I get the correct width of QLineEdit :

childWidget on top

But when childWidget is vertically centered and on the left with:
parentLayout->setAlignment(&childWidget, Qt::AlignVCenter | Qt::AlignLeft)
I get a smaller width of QLineEdit:

childWidget vertically centered and on the left

I don't understand why the QLineEdit have a smaller width when the childWidget is on the left, their width should be the same, as it's fixed.

AAEM
  • 1,837
  • 2
  • 18
  • 26
Laurent Mesguen
  • 354
  • 2
  • 6
  • 22

0 Answers0