diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-12-01 09:27:30 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@digia.com> | 2015-03-26 11:01:27 +0100 |
commit | 6aa71886fbaf3cd0f6f7d7f01825fc8447b32e5e (patch) | |
tree | 6f6f5d941fbff7bf04f4d8d22c6824cb84b8ecd9 /tests/manual | |
parent | 29710e90735326d37e333a8f9a60dfbd41967ddc (diff) |
WIP: highdpi test: Test font pixel sizes as well.
Change-Id: Id453445739b1e219b7199139397f1a6faffcc1fc
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/highdpi/main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp index ae2954cbb5..4be0049fc5 100644 --- a/tests/manual/highdpi/main.cpp +++ b/tests/manual/highdpi/main.cpp @@ -296,8 +296,10 @@ public: void paintEvent(QPaintEvent *) { QPainter painter(this); - int y = 40; - for (int fontSize = 2; fontSize < 18; fontSize += 2) { + + // Points + int y = 10; + for (int fontSize = 6; fontSize < 18; fontSize += 2) { QFont font; font.setPointSize(fontSize); QString string = QString(QStringLiteral("%1 The quick brown fox jumped over the lazy Doug.")).arg(fontSize); @@ -305,6 +307,17 @@ public: painter.drawText(10, y, string); y += (fontSize * 2.5); } + + // Pixels + y = 160; + for (int fontSize = 6; fontSize < 18; fontSize += 2) { + QFont font; + font.setPixelSize(fontSize); + QString string = QString(QStringLiteral("%1 The quick brown fox jumped over the lazy Doug.")).arg(fontSize); + painter.setFont(font); + painter.drawText(10, y, string); + y += (fontSize * 2.5); + } } }; |