Changeset View
Changeset View
Standalone View
Standalone View
tests/kcollapsiblegroupboxtest.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 43 | { | |||
---|---|---|---|---|---|
47 | auto innerLayout = new QVBoxLayout; | 47 | auto innerLayout = new QVBoxLayout; | ||
48 | for (int i =0; i<6;i++) { | 48 | for (int i =0; i<6;i++) { | ||
49 | auto checkBox = new QCheckBox(QStringLiteral("Some text")); | 49 | auto checkBox = new QCheckBox(QStringLiteral("Some text")); | ||
50 | innerLayout->addWidget(checkBox); | 50 | innerLayout->addWidget(checkBox); | ||
51 | } | 51 | } | ||
52 | auto checkBox = new QCheckBox(QStringLiteral("Some really long text that goes on and on and on for ever and ever")); | 52 | auto checkBox = new QCheckBox(QStringLiteral("Some really long text that goes on and on and on for ever and ever")); | ||
53 | innerLayout->addWidget(checkBox); | 53 | innerLayout->addWidget(checkBox); | ||
54 | 54 | | |||
55 | auto label = new QLabel(groupBox); | ||||
56 | label->setText(QStringLiteral("Some input field:")); | ||||
57 | // Word-wrapping in labels triggers a bug in the layout positioning. | ||||
58 | label->setWordWrap(true); | ||||
59 | innerLayout->addWidget(label); | ||||
60 | | ||||
55 | auto lineEdit = new QLineEdit(groupBox); | 61 | auto lineEdit = new QLineEdit(groupBox); | ||
56 | innerLayout->addWidget(lineEdit); | 62 | innerLayout->addWidget(lineEdit); | ||
57 | 63 | | |||
58 | auto hiddenCheckBox = new QCheckBox(QStringLiteral("This will be always hidden")); | 64 | auto hiddenCheckBox = new QCheckBox(QStringLiteral("This will be always hidden")); | ||
59 | innerLayout->addWidget(hiddenCheckBox); | 65 | innerLayout->addWidget(hiddenCheckBox); | ||
60 | hiddenCheckBox->hide(); | 66 | hiddenCheckBox->hide(); | ||
61 | 67 | | |||
62 | groupBox->setLayout(innerLayout); | 68 | groupBox->setLayout(innerLayout); | ||
Show All 25 Lines |