Symbian-Developers

The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Qt Application Development => Topic started by: yeatse on January 07, 2014, 02:17:23 pm

Title: Embed QWebView into QDeclarativeItem
Post by: yeatse on January 07, 2014, 02:17:23 pm
QML WebView element is a convenient tool for showing a website in qml, but it has some small bugs. They are hard to fix because these bugs come from the backend, called QGraphicsWebView.

To solve this problem, I wrote a class named "QWebViewItem", which embeds QWidget-based QWebView into qml environment. To use this element, include the files in your project, register QWebViewItem in your main.cpp, then use it like this:

WebViewItem {
anchors.fill: parent;
url: "http://www.google.com";
}

You needn't add a Flickable element if the website content is larger than this element. QWebView itself behaviours like a Flickable. So feel free to hack it for your own needs.= =
Title: Re: Embed QWebView into QDeclarativeItem
Post by: huellif on January 08, 2014, 11:05:10 pm
could you tell us about your changes and the new features?
Title: Re: Embed QWebView into QDeclarativeItem
Post by: yeatse on January 13, 2014, 03:30:01 pm
If you have used StarBrowser, you will find that when you tap on the blank space at www.google.com, or click a link pointing to an anchor (open html5test.com, then open the corner menu and select one), the content will go "out" of the screen and cannot be back. This is because the page itself doesn't know the position we scroll it to, so some elements will not perform as we expected. But QWebView in Qt C++ doesn't have problems like this.

So my changes:
Use QWebView as the backend instead of QGraphicsWebView

New features:
Fix bugs in QGraphicsWebView
Title: Re: Embed QWebView into QDeclarativeItem
Post by: symster on January 13, 2014, 03:39:29 pm
Does it behave the way like webview.Are all the signal and properties is the same with webview?
Title: Re: Embed QWebView into QDeclarativeItem
Post by: Allstar12345 on January 15, 2014, 05:21:32 pm
If you have used StarBrowser, you will find that when you tap on the blank space at www.google.com, or click a link pointing to an anchor (open html5test.com, then open the corner menu and select one), the content will go "out" of the screen and cannot be back. This is because the page itself doesn't know the position we scroll it to, so some elements will not perform as we expected. But QWebView in Qt C++ doesn't have problems like this.

So my changes:
Use QWebView as the backend instead of QGraphicsWebView

New features:
Fix bugs in QGraphicsWebView

Only ever does that if you attack the TextField on FP2, seems Qt 4.8.0/4.7.4 has buggier QGraphicWebView's than others.