summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-10 13:56:25 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-10 13:57:40 (GMT)
commit6d44daddab9f36fd8c34bb3776c0fb0d93635e6e (patch)
tree62108a82979bdf09cb9b5bd48423edfab3965dfc /src/gui/kernel
parent28fc7434e0be95527292050bc6dd3980aabd44ca (diff)
downloadQt-6d44daddab9f36fd8c34bb3776c0fb0d93635e6e.zip
Qt-6d44daddab9f36fd8c34bb3776c0fb0d93635e6e.tar.gz
Qt-6d44daddab9f36fd8c34bb3776c0fb0d93635e6e.tar.bz2
Fixed dialog resize not to move the dialog for Symbian.
QDialog::resize() also moved the dialog in Symbian. This occured since adjustPosition was called as an result of resize and that method did not check if dialog position was explicitly set. In addition it was found that in Symbian WA_Resized and WA_Moved attributes were basically set for almost all top-level widgets by system. This was also fixed and a new auto test was introduced to verify these attributes in all platforms. Windows platform also suffers from bug in this area, and a separate task QTBUG-5897 for it was created Task-number: QTBUG-5897 Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 395ceca..79b2bff 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1034,7 +1034,7 @@ void QSymbianControl::HandleResourceChange(int resourceType)
qwidget->adjustSize();
qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize
}
- if (!qwidget->testAttribute(Qt::WA_Moved)) {
+ if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) {
TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
SetPosition(r.iTl);
qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 7fb21d2..81c4198 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1052,6 +1052,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
return;
if (isWindow()) {
+ const bool wasResized = testAttribute(Qt::WA_Resized);
+ const bool wasMoved = testAttribute(Qt::WA_Moved);
QSymbianControl *window = static_cast<QSymbianControl *>(effectiveWinId());
if (window && newstate & Qt::WindowMinimized) {
@@ -1090,7 +1092,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
createWinId();
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
// Ensure the initial size is valid, since we store it as normalGeometry below.
- if (!testAttribute(Qt::WA_Resized) && !isVisible())
+ if (!wasResized && !isVisible())
adjustSize();
QTLWExtra *top = d->topData();
@@ -1105,6 +1107,9 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
//restore normal geometry
top->normalGeometry = normalGeometry;
+
+ setAttribute(Qt::WA_Resized, wasResized);
+ setAttribute(Qt::WA_Moved, wasMoved);
}
data->window_state = newstate;