summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-11-03 07:40:16 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-11-03 07:40:16 (GMT)
commit6382a038d6394135a4dc2d8e1e47133d9ea0b659 (patch)
tree01fd0cfbfd3a19f20051732d91dfce5e718a45ce /src/gui/dialogs
parent8e2b95b1115bc07f81d0fa22cc2929bb28d3e9bb (diff)
downloadQt-6382a038d6394135a4dc2d8e1e47133d9ea0b659.zip
Qt-6382a038d6394135a4dc2d8e1e47133d9ea0b659.tar.gz
Qt-6382a038d6394135a4dc2d8e1e47133d9ea0b659.tar.bz2
Qt/Symbian: QInputDialog layout and size are wrong
The QInputDialog with anything but QLineEdit as the input widget, will show up as minimal size on device/emulator. Also, the dialog looks bad since the widgets are deployed very close to the dialog borders. As a fix, layout will not get the size policy set on Symbian, but the dialog itself is stretched to occupy screen width and thus, layout grows to occupy the available size. Additionally, style will set layout pixel metrics for dialogs larger than for other widgets, to avoid the layout from putting widgets very close to dialog border. Task-number: QTBUG-14331 Reviewed-by: Janne Anttila
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qdialog.cpp2
-rw-r--r--src/gui/dialogs/qinputdialog.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 9e0437c..b7a0026 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -1111,7 +1111,7 @@ QSize QDialog::sizeHint() const
// if size is not fixed, try to adjust it according to S60 layoutting
if (minimumSize() != maximumSize()) {
// In S60, dialogs are always the width of screen (in portrait, regardless of current layout)
- return QSize(qMax(S60->screenHeightInPixels, S60->screenWidthInPixels), QWidget::sizeHint().height());
+ return QSize(qMin(S60->screenHeightInPixels, S60->screenWidthInPixels), QWidget::sizeHint().height());
} else {
return QWidget::sizeHint();
}
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 700b234..abaaa49 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -231,7 +231,10 @@ void QInputDialogPrivate::ensureLayout()
QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
mainLayout = new QVBoxLayout(q);
+ //we want to let the input dialog grow to available size on Symbian.
+#ifndef Q_OS_SYMBIAN
mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
+#endif
mainLayout->addWidget(label);
mainLayout->addWidget(inputWidget);
mainLayout->addWidget(buttonBox);