Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108503

Qt Designer: Would like to set QBoxLayout setAlignment

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.4.1
    • Tools: Designer
    • None
    • Windows

    Description

      I would like to be able to set the alignment property of layouts from within Qt Designer.

      The final code should look like the following.

       

      layout = QVBoxLayout()
      layout.setAlignment(Qt.AlignCenter)

      It is possible to set the alignment of individual widgets within a layout but not for the layout itself.

      Here is the documentation for the method.

      https://doc.qt.io/qt-6/qlayoutitem.html#setAlignment

      It is functionally identical to the QLabel setAlignment property.

      https://doc.qt.io/qt-6/qlabel.html#alignment-prop

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            gentlegiantjgc J C
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: