summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-12-09 12:25:16 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-12-09 12:25:16 (GMT)
commitad68c845e3e368dc4235e64b54e15a9ee886b078 (patch)
tree0910ec90106c64da32246d997c0d2fa9ebc61a0d /src/gui/dialogs
parent6b9cef34c48759e44eceb4c5ace7da164f4134ae (diff)
downloadQt-ad68c845e3e368dc4235e64b54e15a9ee886b078.zip
Qt-ad68c845e3e368dc4235e64b54e15a9ee886b078.tar.gz
Qt-ad68c845e3e368dc4235e64b54e15a9ee886b078.tar.bz2
QLabel wraps text at fixed lengths
There are multiple problems with text wrapping and dialogs. First, teh CBA height was assumed to be zero, or fetch from previous layout, which caused the dialog to be half under the CBA. Now, CBA height is always asked from AVKON metrics, since asking it from actual component might fail (or produce incorrect results) due to that the component is not created yet (or might still have previous layout active). Additionally, qinputDialog label is now having a size policy to restrict its growing out of dialog borders. Task-number: QT-4354 Reviewed-by: Janne Koskinen
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qdialog.cpp13
-rw-r--r--src/gui/dialogs/qinputdialog.cpp2
2 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index fbdc522..16ea045 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -901,15 +901,13 @@ bool QDialog::symbianAdjustedPosition()
QPoint p;
const bool doS60Positioning = !(isFullScreen()||isMaximized());
if (doS60Positioning) {
+ QPoint oldPos = pos();
// naive way to deduce screen orientation
if (S60->screenHeightInPixels > S60->screenWidthInPixels) {
int cbaHeight;
- const CEikButtonGroupContainer* bgContainer = S60->buttonGroupContainer();
- if (!bgContainer) {
- cbaHeight = 0;
- } else {
- cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
- }
+ TRect rect;
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, rect);
+ cbaHeight = rect.Height();
p.setY(S60->screenHeightInPixels - height() - cbaHeight);
p.setX(0);
} else {
@@ -939,7 +937,8 @@ bool QDialog::symbianAdjustedPosition()
p.setX(qMax(0,S60->screenWidthInPixels - width()));
}
}
- move(p);
+ if (oldPos != p || p.y() < 0)
+ move(p);
}
return doS60Positioning;
#else
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index ce27bd3..a29376a 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -234,6 +234,8 @@ void QInputDialogPrivate::ensureLayout()
//we want to let the input dialog grow to available size on Symbian.
#ifndef Q_OS_SYMBIAN
mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
+#else
+ label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#endif
mainLayout->addWidget(label);
mainLayout->addWidget(inputWidget);