From 552a7cf157da9c8d2b811b3123138b52dde072f7 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 31 Jul 2009 14:47:07 +0200 Subject: 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 --- tests/manual/qdesktopwidget/main.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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; -- cgit v0.12