[Qt-qml] S60 WebView

joona.t.petrell at nokia.com joona.t.petrell at nokia.com
Wed Jun 9 05:29:09 CEST 2010


Hi,



Webkitqmlplugin already includes qimportbase.pri, which adds line "TARGET.CAPABILITY = All -Tcb" to the project file.



There is a different bug about QML Viewer not having enough capabilities to initiate WebView elements:

http://bugreports.qt.nokia.com/browse/QTBUG-11256



Cheers,



Joona


From: qt-qml-bounces at trolltech.com [mailto:qt-qml-bounces at trolltech.com] On Behalf Of ext Jack Wootton
Sent: Wednesday, June 09, 2010 1:04 AM
To: qt-qml at trolltech.com
Subject: Re: [Qt-qml] S60 WebView

Hello,

I have found a solution to this problem :)

It seems this was because webkitqmlplugin.dll was being built without the correct capabilities.  I modified the *.pro file of the webkitqmlplugin and added the line: "TARGET.CAPABILITY=ALL -tcb" into "symbian" block of the *.pro file.

Once I had made this change I then modified the *.pkg file of my app to include the webkit plugin binaries (since they are not installed onto the device when using the Qt installer).  And then I could finally load local html files into a QMl WebView.

Is this something that needs to be corrected - I know All -tcb isn't required, but it seems the *.pro file is incorrect for the webkitqmlplugin?
On Tue, Jun 8, 2010 at 9:33 AM, Jack Wootton <jackwootton at gmail.com<mailto:jackwootton at gmail.com>> wrote:
Hello,

I posted this problem a while back, but waited until I could recreate the problem on a new device before posting again (I can).

I have a new N97 with Qt 4.7 installed using qt_installer.sis.  I have a QML application which contains a few CPP files, just to load the main QML file.  The application installs onto the N97 without a problem and the Qt demos and exampls run on the device (apart from the declarative demos, but I understand this issue is already known about).

I had to do the following steps to get this far:

1. Modify the *.pkg file to include the following the webkit pkugin binaries and the webkit plugin stub files

"/epoc32/release/$(PLATFORM)/$(TARGET)/webkitqmlplugin.dll"    - "!:\sys\bin\webkitqmlplugin.dll"
"/epoc32/winscw/c/resource/qt/imports/org/webkit/qmldir"    -"!:\resource\qt\imports\org\webkit\qmldir"
"/epoc32/winscw/c/resource/qt/imports/org/webkit/webkitqmlplugin.qtplugin"    - "!:\resource\qt\imports\org\webkit\webkitqmlplugin.qtplugin"

2. Modified the mmp file to change capability to All -tcb (just to ensure there were no issues here)

3. Add QML, HTML and JavaScript files to the Qt resource file.

The QML WebView component does load because I added an onCompleted listener to modify the UI when the WebView component is loaded:

WebView {
    id:myWebView

    function init() {
    myRectangle.visible = true
    myRectangle.color = "blue"
    }

    Component.onCompleted: init();

    width:500
    height:500
    scale:1
    url: "qrc:/MyFile.html"
}

Rectangle {
    id: myRectangle
    color:"red"
    visible:false
}


The component rectangle is just there so I can check the WebView component loads...and it does (i.e  myRectangle becomes visible and is blue).  However the html file MyFile.html is never displayed.  I have tried loading a an external URL (www.google.com<http://www.google.com/>) too.  Neither of these work, all I get is a blank screen.  There are other QMl components, such as buttons which do display, even basic animation works.  So it seems QML is working correctly.

I have also added some code to a QML button so that when pressed it forced the URL of WebView to be "http://www.google.com" i.e.

onClicked: {
    webView.url = "http://www.google.com"
    console.debug(webView.url);
    console.debug(webView.progress);
    console.log(webView.Error);
}

The output was:

[Qt Message] http://www.google.com

[Qt Message] 0.10000000149011612

[Qt Message] undefined

I pressed it a second time and the output was:

[Qt Message] http://www.google.com

[Qt Message] 1

[Qt Message] undefined


This all seems correct, no errors and the "1" means the page has loaded.

I can use the browser on the device, so I don't think there is an issue there.  As I mentioned before, I modfied the *.mmp to provide All -tcb capabilties.

Is there anything obvious I've missed?  I've reached a bit of a dead-end trying to get WebView to work on a S60 device.


--
Regards
Jack



--
Regards
Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100609/476166c8/attachment.html 


More information about the Qt-qml mailing list