diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-01-11 11:49:35 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-11 22:22:34 +0100 |
commit | 1fbe8242ece70fe5aa2b50e9a782ec509b163b78 (patch) | |
tree | 4b2a9c4499fee0534509098a3d0648c70dba1e95 /src/testlib/qtest.h | |
parent | f65a10b733800f83dae47ce1694fbeaf29ce5b5c (diff) |
QStyleHelper: Base DPI-calculation on QScreen.
- Use qt_defaultDpiX() to obtain the resolution, which
obtains it from QScreen. This implies that for X11,
which previously used a hardcoded default of 96 DPI,
the real resolution will be used (typically 75).
- Since many tests (layouts, graphicsview) contain
test data for 96 DPI, add an attribute to
QCoreApplication making it possible to set the
resolution to 96 DPI for testing.
Change-Id: I77c8233a96b0d75de07406f58d48886a89c3de06
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r-- | src/testlib/qtest.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 53b29e1064..da3a836636 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -254,6 +254,7 @@ int main(int argc, char *argv[]) \ int main(int argc, char *argv[]) \ { \ QApplication app(argc, argv); \ + app.setAttribute(Qt::AA_Use96Dpi, true); \ QTEST_DISABLE_KEYPAD_NAVIGATION \ TestObject tc; \ return QTest::qExec(&tc, argc, argv); \ @@ -267,6 +268,7 @@ int main(int argc, char *argv[]) \ int main(int argc, char *argv[]) \ { \ QGuiApplication app(argc, argv); \ + app.setAttribute(Qt::AA_Use96Dpi, true); \ TestObject tc; \ return QTest::qExec(&tc, argc, argv); \ } @@ -277,6 +279,7 @@ int main(int argc, char *argv[]) \ int main(int argc, char *argv[]) \ { \ QCoreApplication app(argc, argv); \ + app.setAttribute(Qt::AA_Use96Dpi, true); \ TestObject tc; \ return QTest::qExec(&tc, argc, argv); \ } @@ -287,6 +290,7 @@ int main(int argc, char *argv[]) \ int main(int argc, char *argv[]) \ { \ QCoreApplication app(argc, argv); \ + app.setAttribute(Qt::AA_Use96Dpi, true); \ TestObject tc; \ return QTest::qExec(&tc, argc, argv); \ } |