Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. WebView Content Size Problem
QtWS25 Last Chance

WebView Content Size Problem

Scheduled Pinned Locked Moved QML and Qt Quick
qmlqt5.4.1qt 5.4qtquickwebviewqt applicationos x
3 Posts 2 Posters 2.6k 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.
  • B Offline
    B Offline
    bck25
    wrote on 6 Aug 2015, 08:48 last edited by
    #1

    Hello all,

    I'm writing because I can't seem to get my WebView to behave properly. This is my first time posting here, but I spent quite a long time trying to search for a solution on my own. I'm on Mac OS X with Qt 5.4.1, and I'm trying to write a Qt Quick desktop application. I've attached a picture that shows what is wrong.

    Left is a Qt Quick Application with a WebView. Right is a Safari window. See the size difference?

    Image

    I want the WebView to behave like a normal browser, where resizing the window causes scrollbars to appear. It works for vertical scrolling, but not horizontal. The size of the rendered page seems to be dependent on the width of the WebView. Resizing the window width causes the page to shrink. This makes text super small.

    I looked here and here, but neither the experimental.userAgent nor the Flickable seem to fix this problem.

    This is a huge problem for me and I'm getting desperate :(
    I can't tell you how much I'd appreciate any help.

    Thanks,
    Brian

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Cqoicebordel
      wrote on 7 Aug 2015, 00:37 last edited by
      #2

      I'm not an expert, far from it. But you can try fiddling with experimental.preferredMinimumContentsWidth. It defines the size of the view.
      You can try to set a smallish one, and it will enhance the view greatly.
      If it doesn't work that well, you could set the minimum width to the size of the webview, and update it at each change of size. Hackish, but could work.

      Again, it's just an idea, not a proved solution :)

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bck25
        wrote on 7 Aug 2015, 02:32 last edited by
        #3

        Thanks so much for taking a stab at it. I tried setting the experimental.preferredMinimumContentsWidth to numbers ranging from 1 to 10000, but it doesn't seem to have any sort of affect for me.

        I have tried playing around with experimental.page.scale. I found setting it to 1200/webview.width gives something similar to what I'm looking for. It prevents the page from shrinking when resizing. However, everything ends up getting very blurry, so it can't be a solution for me.

        I'll try digging through the experimental settings some more. It's too bad that it isn't better documented.

        It is so sad that this zooming "feature" can't be turned off. It looks like QWebView behaves properly by default, but it is a Qt widget, not a Qt Quick widget. So I won't be able to use it in my application.

        If anyone out there knows how to fix this, please help!

        1 Reply Last reply
        0

        3/3

        7 Aug 2015, 02:32

        • Login

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