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) 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
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to