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. Viewport size is wrong
Forum Updated to NodeBB v4.3 + New Features

Viewport size is wrong

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 803 Views
  • 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 Offline
    N Offline
    nnething
    wrote on last edited by
    #1

    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
    0

    • Login

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