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

Child widgets of layouts other than a QFormLayout installed in a QWizardPage will not expand

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.2
    • Widgets: Layout
    • None
    • Linux/X11, Windows

    Description

      The QGridLayout seems to inherit different constraints when it is installed in a QDialog than when it is installed in a QWizardPage.

      In a QWizardPage, whether installed directly as the main layout manager or as a sub-layout in the right column of a QFormLayout, the QGridLayout behaves strangely: all of its child QWidgets, in fact, ignore any directive that invites them to expand by occupying all the space they have available.

      How to reproduce:

      1. Create a QWizard
      2. Create and add a QWizardPage
      3. Create and install a QGridLayout
      4. Add a QLabel to row 0 column 0, spanning 2 columns and 2 rows
      5. Set the QLabel boxed (just to make more evident that it is not expanding)
      6. Set the size policy of the QLabel to "minimumExpanding" or "ignore" for both the directions
      7. Add a QPushButton to row 0 column 2
      8. Add a QPushButton to row 1 column 2
      9. Add a QLabel to row 2 column 0, spanning 2 columns and 2 rows
      10. Set the QLabel boxed (just to make more evident that it is not expanding)
      11. Set the size policy of the QLabel to "minimumExpanding" or "ignore" for both the directions
      12. Add a QPushButton to row 2 column 2
      13. Add a QPushButton to row 3 column 2
      14. Run the QWizard

      The problem can also be seen by installing the QGridLayout in the right column of a QFormLayout on which the setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow) call has been made.

      I observed the issue on both Linux (X11) and Windows 11. I have no instruments to check on other platforms.

      I do not understand if what I observe is intended (but evidently not documented on either the QWizard or QWizardPage) or if I have run into a bug.

      I have already written in the forum and also verified that the automatically generated source code from .ui files, where the expansion works correctly, in the context of QWizardPage does not work.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            flinco Lorenzo Buzzi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes