summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Barron <jason.barron@nokia.com>2010-07-27 14:27:21 (GMT)
committerJason Barron <jason.barron@nokia.com>2010-07-27 14:50:22 (GMT)
commit61908af46700c7c1f2e59ce98daeadc2529fef1b (patch)
treec38a967ff974681ce4f392acd874a1be8961a84e
parentd82d8d1fc90b4237e483fea9813ec084633f6f2d (diff)
downloadQt-61908af46700c7c1f2e59ce98daeadc2529fef1b.zip
Qt-61908af46700c7c1f2e59ce98daeadc2529fef1b.tar.gz
Qt-61908af46700c7c1f2e59ce98daeadc2529fef1b.tar.bz2
Fix signal emission of QDesktopWidget on Symbian.
QDesktopWidget on Symbian was not properly emitting the resized() and the workAreaResized() signals. Qt was properly translating the system event and sending the QResizeEvent to the widget, but the signal emission is determined solely based on changes in the QVectors of QRects outlining the screen dimensions. On Symbian, these vectors were never being set and as a result the signals were never omitted. The fix is to set the rects correctly in the init() function which is called by the resizeEvent() handler. Also modify the accessor functions to return the rectangles stored in the vector instead of querying for them each time. Task-number: QTBUG-11433 Reviewed-by: axis Autotest: PASSES
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index e4d0bf3..a07f4a7 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -103,6 +103,10 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that)
rects->resize(QDesktopWidgetPrivate::screenCount);
workrects->resize(QDesktopWidgetPrivate::screenCount);
+
+ (*rects)[0].setRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
+ QRect wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+ (*workrects)[0].setRect(wr.x(), wr.y(), wr.width(), wr.height());
}
void QDesktopWidgetPrivate::cleanup()
@@ -146,17 +150,23 @@ QWidget *QDesktopWidget::screen(int /* screen */)
return this;
}
-const QRect QDesktopWidget::availableGeometry(int /* screen */) const
+const QRect QDesktopWidget::availableGeometry(int screen) const
{
- TRect clientRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- return qt_TRect2QRect(clientRect);
+ Q_D(const QDesktopWidget);
+ if (screen < 0 || screen >= d->screenCount)
+ screen = d->primaryScreen;
+
+ return d->workrects->at(screen);
}
-const QRect QDesktopWidget::screenGeometry(int /* screen */) const
+const QRect QDesktopWidget::screenGeometry(int screen) const
{
Q_D(const QDesktopWidget);
- return QRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
- }
+ if (screen < 0 || screen >= d->screenCount)
+ screen = d->primaryScreen;
+
+ return d->rects->at(screen);
+}
int QDesktopWidget::screenNumber(const QWidget * /* widget */) const
{