From 61908af46700c7c1f2e59ce98daeadc2529fef1b Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 27 Jul 2010 16:27:21 +0200 Subject: 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 --- src/gui/kernel/qdesktopwidget_s60.cpp | 22 ++++++++++++++++------ 1 file 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(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(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 { -- cgit v0.12