Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.8.0
-
None
-
-
8c38b08343b226883ef368d31a085b0a620f7995
Description
Take a look at the code below:
#include <QtWidgets> int main(int argc, char** argv) { QApplication app(argc, argv); QWidget w; QFormLayout* ll = new QFormLayout(&w); ll->setWidget(0, QFormLayout::LabelRole, new QLabel("123245689")); ll->setWidget(0, QFormLayout::FieldRole, new QSpinBox); ll->setWidget(1, QFormLayout::FieldRole, new QCheckBox("some other text")); w.show(); app.exec(); }
Here is how it looks:
A simple change in code
ll->setWidget(0, QFormLayout::LabelRole, new QLabel("123245689"));
ll->setWidget(0, QFormLayout::FieldRole, new QSpinBox);
ll->setWidget(1, QFormLayout::LabelRole, new QLabel("123245689"));
ll->setWidget(1, QFormLayout::FieldRole, new QCheckBox("some other text"));
will fix it:
Attachments
Issue Links
- is duplicated by
-
QTBUG-18308 QFormLayout computes wrong minimumSizeHint
- Closed
For Gerrit Dashboard: QTBUG-60800 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
246476,3 | QFormLayout: Fix width calculation when a row has no label | dev | qt/qtbase | Status: MERGED | +2 | 0 |