Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QFormLayout with QLineEdit which has clear button, size problem



  • QFormLayout with QLineEdit which clear button,
    by default when the clear button shows, the width of QLineEdit changes.
    If set horizontal size policy to Ignore and min width of QLineEdit to 100, the QLineEdit work as expected (i.e. fixed width),
    but the labels got problems as in the screenshots below.

    Design view
    a.png

    Running view
    b.png



  • By setting both min width and max width of QLineEdit, the problem is solved.
    However, what is the proper way?


Log in to reply