summaryrefslogtreecommitdiffstats
path: root/examples/webengine
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2016-06-15 14:54:38 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2016-06-20 06:54:39 +0000
commitaceda160982dd6faba1a80065c9c1e52c549da2c (patch)
treee3871e4bc2a38f3eaf411170bf5b7dbf20529996 /examples/webengine
parent323f300fd54d3fdb6f7a4565f305b631a27e76d5 (diff)
Make all examples high-dpi aware
Setting the Qt::AA_EnableHighDpiScaling attribute makes sure that the scrollbars are scaled, and that the default zoom level is sensible. Task-number: QTBUG-54113 Change-Id: I0ae7eb97cb9e2824e7f9b92d77cf2986cac66685 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/webengine')
-rw-r--r--examples/webengine/minimal/doc/src/minimal.qdoc7
-rw-r--r--examples/webengine/minimal/main.cpp2
-rw-r--r--examples/webengine/quicknanobrowser/main.cpp2
3 files changed, 9 insertions, 2 deletions
diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webengine/minimal/doc/src/minimal.qdoc
index c0b89ba5a..5d7ca45e7 100644
--- a/examples/webengine/minimal/doc/src/minimal.qdoc
+++ b/examples/webengine/minimal/doc/src/minimal.qdoc
@@ -50,8 +50,11 @@
\skipto #include
\printto main
- In the main function we first instantiate a QGuiApplication object.
- We then call \l{QtWebEngine::initialize}, which makes sure that OpenGL
+ In the \c main function we first set the Qt::AA_EnableHighDpiScaling
+ attribute. This lets the web view automatically scale on high-dpi displays.
+ Then we instantiate a QGuiApplication object.
+
+ Next, we call \l{QtWebEngine::initialize}, which makes sure that OpenGL
contexts can be shared between the main process and the dedicated renderer
process (\c QtWebEngineProcess). This method needs to be called before
any OpenGL context is created.
diff --git a/examples/webengine/minimal/main.cpp b/examples/webengine/minimal/main.cpp
index cc5a1f61e..099b70707 100644
--- a/examples/webengine/minimal/main.cpp
+++ b/examples/webengine/minimal/main.cpp
@@ -44,7 +44,9 @@
int main(int argc, char *argv[])
{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
+
QtWebEngine::initialize();
QQmlApplicationEngine engine;
diff --git a/examples/webengine/quicknanobrowser/main.cpp b/examples/webengine/quicknanobrowser/main.cpp
index b7ab03699..31ab26f6f 100644
--- a/examples/webengine/quicknanobrowser/main.cpp
+++ b/examples/webengine/quicknanobrowser/main.cpp
@@ -68,6 +68,8 @@ static QUrl startupUrl()
int main(int argc, char **argv)
{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+
Application app(argc, argv);
QtWebEngine::initialize();