Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.2
-
None
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:
- Create a QWizard
- Create and add a QWizardPage
- Create and install a QGridLayout
- Add a QLabel to row 0 column 0, spanning 2 columns and 2 rows
- Set the QLabel boxed (just to make more evident that it is not expanding)
- Set the size policy of the QLabel to "minimumExpanding" or "ignore" for both the directions
- Add a QPushButton to row 0 column 2
- Add a QPushButton to row 1 column 2
- Add a QLabel to row 2 column 0, spanning 2 columns and 2 rows
- Set the QLabel boxed (just to make more evident that it is not expanding)
- Set the size policy of the QLabel to "minimumExpanding" or "ignore" for both the directions
- Add a QPushButton to row 2 column 2
- Add a QPushButton to row 3 column 2
- 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.