summaryrefslogtreecommitdiffstats
path: root/tests/manual/qdesktopwidget/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qdesktopwidget/main.cpp')
-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;