summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2020-02-12 17:27:36 +0200
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2020-03-03 19:35:11 +0200
commite5f4e1405947bcecd78f15bd76162ad6b54c2502 (patch)
tree02e09b206acee000f14cf29f3262fe79a2ee26ab /examples/widgets/painting
parent466d32160a23e6848fe0a42e74085c79071d7dec (diff)
Examples: enable HighDPI scaling for examples on Android
These examples show very tiny UI elements on Android devices, thus enabling HighDPI. Task-number: QTBUG-80717 Change-Id: I813801d5249dc1fcfc6f61a8d146f60dd19901f6 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'examples/widgets/painting')
-rw-r--r--examples/widgets/painting/affine/main.cpp4
-rw-r--r--examples/widgets/painting/concentriccircles/main.cpp3
-rw-r--r--examples/widgets/painting/fontsampler/main.cpp3
-rw-r--r--examples/widgets/painting/gradients/main.cpp3
-rw-r--r--examples/widgets/painting/pathstroke/main.cpp3
5 files changed, 15 insertions, 1 deletions
diff --git a/examples/widgets/painting/affine/main.cpp b/examples/widgets/painting/affine/main.cpp
index 6ce8efe482..641fc5c204 100644
--- a/examples/widgets/painting/affine/main.cpp
+++ b/examples/widgets/painting/affine/main.cpp
@@ -55,7 +55,9 @@
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(affine);
-
+#ifdef Q_OS_ANDROID
+ qputenv("QT_SCALE_FACTOR", "2");
+#endif
QApplication app(argc, argv);
XFormWidget xformWidget(nullptr);
diff --git a/examples/widgets/painting/concentriccircles/main.cpp b/examples/widgets/painting/concentriccircles/main.cpp
index d9fa2879c4..00456195d9 100644
--- a/examples/widgets/painting/concentriccircles/main.cpp
+++ b/examples/widgets/painting/concentriccircles/main.cpp
@@ -54,6 +54,9 @@
int main(int argc, char *argv[])
{
+#ifdef Q_OS_ANDROID
+ QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
QApplication app(argc, argv);
Window window;
window.show();
diff --git a/examples/widgets/painting/fontsampler/main.cpp b/examples/widgets/painting/fontsampler/main.cpp
index 1bf46b226f..cec6929827 100644
--- a/examples/widgets/painting/fontsampler/main.cpp
+++ b/examples/widgets/painting/fontsampler/main.cpp
@@ -54,6 +54,9 @@
int main(int argc, char *argv[])
{
+#ifdef Q_OS_ANDROID
+ QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
QApplication app(argc, argv);
MainWindow window;
window.show();
diff --git a/examples/widgets/painting/gradients/main.cpp b/examples/widgets/painting/gradients/main.cpp
index 0ddf7a4579..7ffb0326e9 100644
--- a/examples/widgets/painting/gradients/main.cpp
+++ b/examples/widgets/painting/gradients/main.cpp
@@ -55,6 +55,9 @@
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(gradients);
+#ifdef Q_OS_ANDROID
+ qputenv("QT_SCALE_FACTOR", "2");
+#endif
QApplication app(argc, argv);
diff --git a/examples/widgets/painting/pathstroke/main.cpp b/examples/widgets/painting/pathstroke/main.cpp
index 57c85d73a3..35317480a3 100644
--- a/examples/widgets/painting/pathstroke/main.cpp
+++ b/examples/widgets/painting/pathstroke/main.cpp
@@ -55,6 +55,9 @@
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(pathstroke);
+#ifdef Q_OS_ANDROID
+ qputenv("QT_SCALE_FACTOR", "2");
+#endif
QApplication app(argc, argv);