271 // aligned in all styles - the extra QVBoxLayout is a workaround |
271 // aligned in all styles - the extra QVBoxLayout is a workaround |
272 // for bug in QFormLayout |
272 // for bug in QFormLayout |
273 QWidget *pageEdit = new QWidget(toolbar); |
273 QWidget *pageEdit = new QWidget(toolbar); |
274 QVBoxLayout *vboxLayout = new QVBoxLayout; |
274 QVBoxLayout *vboxLayout = new QVBoxLayout; |
275 vboxLayout->setContentsMargins(0, 0, 0, 0); |
275 vboxLayout->setContentsMargins(0, 0, 0, 0); |
|
276 #ifdef Q_WS_MAC |
|
277 // We query the widgets about their size and then we fix the size. |
|
278 // This should do the trick for the laying out part... |
|
279 QSize pageNumEditSize, pageNumLabelSize; |
|
280 pageNumEditSize = pageNumEdit->minimumSizeHint(); |
|
281 pageNumLabelSize = pageNumLabel->minimumSizeHint(); |
|
282 pageNumEdit->resize(pageNumEditSize); |
|
283 pageNumLabel->resize(pageNumLabelSize); |
|
284 #endif |
276 QFormLayout *formLayout = new QFormLayout; |
285 QFormLayout *formLayout = new QFormLayout; |
|
286 #ifdef Q_WS_MAC |
|
287 // We have to change the growth policy in Mac. |
|
288 formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); |
|
289 #endif |
277 formLayout->setWidget(0, QFormLayout::LabelRole, pageNumEdit); |
290 formLayout->setWidget(0, QFormLayout::LabelRole, pageNumEdit); |
278 formLayout->setWidget(0, QFormLayout::FieldRole, pageNumLabel); |
291 formLayout->setWidget(0, QFormLayout::FieldRole, pageNumLabel); |
279 vboxLayout->addLayout(formLayout); |
292 vboxLayout->addLayout(formLayout); |
280 vboxLayout->setAlignment(Qt::AlignVCenter); |
293 vboxLayout->setAlignment(Qt::AlignVCenter); |
281 pageEdit->setLayout(vboxLayout); |
294 pageEdit->setLayout(vboxLayout); |