Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEnginePage HiDpi Problem?
Qt 6.11 is out! See what's new in the release blog

QWebEnginePage HiDpi Problem?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
7 Posts 3 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Hans DijkemaH Offline
    Hans DijkemaH Offline
    Hans Dijkema
    wrote on last edited by
    #1

    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.

    Hans DijkemaH 1 Reply Last reply
    0
    • Hans DijkemaH Hans Dijkema

      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.

      Hans DijkemaH Offline
      Hans DijkemaH Offline
      Hans Dijkema
      wrote on last edited by
      #2

      @Hans-Dijkema

      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.

      1 Reply Last reply
      0
      • Hans DijkemaH Offline
        Hans DijkemaH Offline
        Hans Dijkema
        wrote on last edited by
        #3

        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.

        the_T 1 Reply Last reply
        0
        • Hans DijkemaH Hans Dijkema

          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.

          the_T Offline
          the_T Offline
          the_
          wrote on last edited by
          #4

          @Hans-Dijkema
          Have you read this? High DPI Displays

          -- No support in PM --

          Hans DijkemaH 1 Reply Last reply
          0
          • the_T the_

            @Hans-Dijkema
            Have you read this? High DPI Displays

            Hans DijkemaH Offline
            Hans DijkemaH Offline
            Hans Dijkema
            wrote on last edited by Hans Dijkema
            #5

            @the_ Yes, I read it, but it doesn't help for QWebEnginePage.
            The Qt Application scales oke, but the content of the QWebEnginePage doesn't scale to the correct DPI.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              carter
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • C Offline
                C Offline
                carter
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved