summaryrefslogtreecommitdiffstats
path: root/tests/manual/highdpi
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-06-29 14:35:30 +0200
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-06-29 12:38:06 +0000
commit47b3e5327500eaeb4dfdccb827139a8f3c75e6c9 (patch)
tree235a38c2665c8956204151ee742be156abbc3c6f /tests/manual/highdpi
parente5d9584b630425fcdac3bd9c5c91f49b47859692 (diff)
Fixup screens display.
Support cases where one or more screens have negative positions. Make the text size a (constant) fraction of the painted screen rectangle height. Change-Id: Iea39aa49281cfe2b97c3e9b2414ee5db6dfe1fbb Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'tests/manual/highdpi')
-rw-r--r--tests/manual/highdpi/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp
index 819425b54f..b69353ae25 100644
--- a/tests/manual/highdpi/main.cpp
+++ b/tests/manual/highdpi/main.cpp
@@ -921,14 +921,16 @@ public:
p.fillRect(rect(), Qt::black);
p.scale(scaleFactor, scaleFactor);
+ p.translate(-total.topLeft());
p.setPen(QPen(Qt::white, 10));
p.setBrush(Qt::gray);
- QFont f = font();
- f.setPixelSize(height());
- p.setFont(f);
+
foreach (QScreen *screen, screens) {
p.drawRect(screen->geometry());
+ QFont f = font();
+ f.setPixelSize(screen->geometry().height() / 8);
+ p.setFont(f);
p.drawText(screen->geometry(), Qt::AlignCenter, screen->name());
}
p.setBrush(QColor(200,220,255,127));