diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-03-05 10:53:39 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-03-05 10:54:50 (GMT) |
commit | 3fdad84b40b62979844c2d37d16093a0b67222df (patch) | |
tree | af69f89b5cb6d59597782e045b9b673b1767893c | |
parent | 78a16df5bbfabf8f463ea7211cd5cd028c46dabe (diff) | |
download | Qt-3fdad84b40b62979844c2d37d16093a0b67222df.zip Qt-3fdad84b40b62979844c2d37d16093a0b67222df.tar.gz Qt-3fdad84b40b62979844c2d37d16093a0b67222df.tar.bz2 |
QPrintPreviewDialog number of pages is partially blocked from view in OSX
The problem here is caused by the FormLayout. This patch queries the
widget for its sizeHint and then forces it to resize to that size.
Once that is done, we add the widget to the layout.
Code is #ifdef protected so other platforms are not affected by it.
Task-number: QTBUG-7760
Reviewed-by: Trond
-rw-r--r-- | src/gui/dialogs/qprintpreviewdialog.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp index 6723b53..f21343e 100644 --- a/src/gui/dialogs/qprintpreviewdialog.cpp +++ b/src/gui/dialogs/qprintpreviewdialog.cpp @@ -273,7 +273,20 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer) QWidget *pageEdit = new QWidget(toolbar); QVBoxLayout *vboxLayout = new QVBoxLayout; vboxLayout->setContentsMargins(0, 0, 0, 0); +#ifdef Q_WS_MAC + // We query the widgets about their size and then we fix the size. + // This should do the trick for the laying out part... + QSize pageNumEditSize, pageNumLabelSize; + pageNumEditSize = pageNumEdit->minimumSizeHint(); + pageNumLabelSize = pageNumLabel->minimumSizeHint(); + pageNumEdit->resize(pageNumEditSize); + pageNumLabel->resize(pageNumLabelSize); +#endif QFormLayout *formLayout = new QFormLayout; +#ifdef Q_WS_MAC + // We have to change the growth policy in Mac. + formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); +#endif formLayout->setWidget(0, QFormLayout::LabelRole, pageNumEdit); formLayout->setWidget(0, QFormLayout::FieldRole, pageNumLabel); vboxLayout->addLayout(formLayout); |