WebView Content Size Problem
-
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?
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 -
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 :)
-
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!