QWebEnginePage HiDpi Problem?
-
I'm developing on a HiDpi screen. My screen's density is 216dpi. "Normal" screen densities are 96dpi.
When I display an html page, it is about 4 times smaller (x and y directions both 2 times smaller) than on a real webbrowser (chrome, ie, firefox).
I'm using Qt 5.6
Is there a way to solve this problem?
Thanks in advance.
-
On my Dell XPS laptop with 166dpi screen density, the QWebEnginePage displays the correct font sizes. My current work-around is as follows:
Given a css: body { font-size: 14pt; } and relative font sizes for the rest of my classes, I process the css and recalculate the body font size:
font-size = (QGuiApplication::primaryScreen()->physicalDotsPerInch() / 166.0) * 1.10;
Thus giving a font size of 20pt on the Surface Pro device.
Then the Chrome displayed font-size is the same as in Qt.
-
Chromium seems to have a command-line flag for high dpi:
/high-dpi-support=1
But when I add this command line option to my command line of my application in Qt Creator, it doesn't have any effect.
-
@Hans-Dijkema
Have you read this? High DPI Displays -
I report this issue to official and but them not yet solved, you can vote it. My solution is automatically zoom in webpage when the dpi is high.
https://bugreports.qt.io/browse/QTBUG-53449 -
I report this issue to official and but them not yet solved, you can vote it. My solution is automatically zoom in webpage when the dpi is high.
https://bugreports.qt.io/browse/QTBUG-53449