Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved Viewport size is wrong

    QtWebEngine
    1
    1
    520
    Loading More Posts
    • 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.
    • N
      nnething last edited by

      Hello everybody,

      We have builded a webengine browser based on demobrowser.
      When an HTML-page contains the following line:

      <meta name="viewport" content="width=device-width, initial-scale=1.0" />

      then the page size (QWebenginePage::contentsSize() ) is 4 times bigger then it should be. Instead of (800x480) is (3200x1920).

      However in javascript, document.body.clientWidth is 800.

      The Zoom factor (QWebenginePage::zoomFactor()) is 1. The font size and all HTML elements are not zoomed. But i can scroll horizontally and vertically and the 'center positions' are relative to this size and not to the document.body.innerWidth/window.screen.width!! On the linux virtual machine works. On the linux device doesn't work.

      When the attribute 'user-scalable' is set to 'no' then the size is OK but i can not zoom any more.

      We use QT Version 5.9.

      Who does set contentsSize? Is't it possible to avoid/change it? On which QT-setting(s) is contentsSize based on?

      The signal 'contentsSizeChanged' is emitted 2 times. First time with the size (width:800, height:358) and second time with the size (width:3200, height:1432).

      Thank you in advance.

      Nicoleta Nething

      By the way: I'm a beginner in QT.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post