summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-03-05 10:53:39 (GMT)
committerCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-03-05 10:54:50 (GMT)
commit3fdad84b40b62979844c2d37d16093a0b67222df (patch)
treeaf69f89b5cb6d59597782e045b9b673b1767893c /src/gui
parent78a16df5bbfabf8f463ea7211cd5cd028c46dabe (diff)
downloadQt-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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp13
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);