summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qdesktopwidget_win.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@nokia.com>2009-07-17 13:40:49 (GMT)
committerVolker Hilsheimer <volker.hilsheimer@nokia.com>2009-07-17 13:43:50 (GMT)
commit13254da6c3192937812983f44ce95fe8e1bc602c (patch)
tree72a1959c25a9ee9f133fad81bf9ee9f3d5b90696 /src/gui/kernel/qdesktopwidget_win.cpp
parent83d9c5978fd5089457a28f16be6d26b047d80b7d (diff)
downloadQt-13254da6c3192937812983f44ce95fe8e1bc602c.zip
Qt-13254da6c3192937812983f44ce95fe8e1bc602c.tar.gz
Qt-13254da6c3192937812983f44ce95fe8e1bc602c.tar.bz2
Implement QDesktopWidget::screenCountChanged signal on desktop platforms,
and add manual testcase. Provide replacement "screenCount" for numScreens and document numScreens as obsolete to be more consistent with other APIs.
Diffstat (limited to 'src/gui/kernel/qdesktopwidget_win.cpp')
-rw-r--r--src/gui/kernel/qdesktopwidget_win.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/kernel/qdesktopwidget_win.cpp b/src/gui/kernel/qdesktopwidget_win.cpp
index fb176b7..a89e08f 100644
--- a/src/gui/kernel/qdesktopwidget_win.cpp
+++ b/src/gui/kernel/qdesktopwidget_win.cpp
@@ -354,10 +354,8 @@ int QDesktopWidget::screenNumber(const QPoint &point) const
void QDesktopWidget::resizeEvent(QResizeEvent *)
{
Q_D(QDesktopWidget);
- QVector<QRect> oldrects;
- oldrects = *d->rects;
- QVector<QRect> oldworkrects;
- oldworkrects = *d->workrects;
+ const QVector<QRect> oldrects(*d->rects);
+ const QVector<QRect> oldworkrects(*d->workrects);
int oldscreencount = d->screenCount;
QDesktopWidgetPrivate::cleanup();
@@ -368,18 +366,22 @@ void QDesktopWidget::resizeEvent(QResizeEvent *)
#endif
for (int i = 0; i < qMin(oldscreencount, d->screenCount); ++i) {
- QRect oldrect = oldrects[i];
- QRect newrect = d->rects->at(i);
+ const QRect oldrect = oldrects[i];
+ const QRect newrect = d->rects->at(i);
if (oldrect != newrect)
emit resized(i);
}
for (int j = 0; j < qMin(oldscreencount, d->screenCount); ++j) {
- QRect oldrect = oldworkrects[j];
- QRect newrect = d->workrects->at(j);
+ const QRect oldrect = oldworkrects[j];
+ const QRect newrect = d->workrects->at(j);
if (oldrect != newrect)
emit workAreaResized(j);
}
+
+ if (oldscreencount != d->screenCount) {
+ emit screenCountChanged(d->screenCount);
+ }
}
#ifdef Q_CC_MSVC