summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-31 12:47:07 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-06 10:00:47 (GMT)
commit552a7cf157da9c8d2b811b3123138b52dde072f7 (patch)
tree9598b91fa302fd37a92dbd9d14cfcdc151d02490
parent32f1e151cb66da08b8c7578b0701408fcb009ea2 (diff)
downloadQt-552a7cf157da9c8d2b811b3123138b52dde072f7.zip
Qt-552a7cf157da9c8d2b811b3123138b52dde072f7.tar.gz
Qt-552a7cf157da9c8d2b811b3123138b52dde072f7.tar.bz2
Added some debug output to the qdesktopwidget manualtest
To make sure we don't receive same signals several times from a QDesktopWidget, added the debug output whenever the signal is emitted. Reviewed-by: trustme
-rw-r--r--tests/manual/qdesktopwidget/main.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp
index 2cbdfb9..653a5fc 100644
--- a/tests/manual/qdesktopwidget/main.cpp
+++ b/tests/manual/qdesktopwidget/main.cpp
@@ -53,8 +53,11 @@ public:
QDesktopWidget *desktop = QApplication::desktop();
connect(desktop, SIGNAL(resized(int)), this, SLOT(updateScene()));
+ connect(desktop, SIGNAL(resized(int)), this, SLOT(desktopResized(int)));
connect(desktop, SIGNAL(workAreaResized(int)), this, SLOT(updateScene()));
+ connect(desktop, SIGNAL(workAreaResized(int)), this, SLOT(desktopWorkAreaResized(int)));
connect(desktop, SIGNAL(screenCountChanged(int)), this, SLOT(updateScene()));
+ connect(desktop, SIGNAL(screenCountChanged(int)), this, SLOT(desktopScreenCountChanged(int)));
updateScene();
@@ -63,6 +66,7 @@ public:
setTransform(transform);
setBackgroundBrush(Qt::darkGray);
+ desktopScreenCountChanged(-1);
}
protected:
@@ -169,6 +173,33 @@ private slots:
return rect;
}
+ void desktopResized(int screen)
+ {
+ qDebug() << "Screen was resized: " << screen
+ << ", new size =" << QApplication::desktop()->screenGeometry(screen);
+ }
+ void desktopWorkAreaResized(int screen)
+ {
+ qDebug() << "Screen workarea was resized: " << screen
+ << ", new size =" << QApplication::desktop()->availableGeometry(screen);
+ }
+ void desktopScreenCountChanged(int screenCount)
+ {
+ QDesktopWidget *desktop = QApplication::desktop();
+ qDebug() << "";
+ if (screenCount != -1) {
+ qDebug() << "Screen count was changed to " << screenCount;
+ } else {
+ screenCount = desktop->screenCount();
+ qDebug() << "Screen count: " << screenCount;
+ }
+ for (int i = 0; i < screenCount; ++i) {
+ qDebug() << " #" << i << ": geometry =" << desktop->screenGeometry(i)
+ << "; available geometry =" << desktop->availableGeometry(i);
+ }
+ qDebug() << "";
+ }
+
private:
QGraphicsScene *scene;
QGraphicsRectItem *that;