Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!


OverviewFelgo 2 Support (Qt 5) › Using WebChannel

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #19531


    Hi, I’ m trying to use WebChannel in my V-play app to call QML methods and sginals from remote server, but I don’t know how to do that on Android. WebEngineView is not supported. This is simplified example:

    import Felgo 3.0
    import QtQuick 2.0
    import QtWebView 1.0
    import QtWebChannel 1.0
    App {
        NavigationStack {
            Page {
                title: qsTr("Main Page")
                Rectangle {
                    id: rect
                    width: 50
                    height: 50
                    color: "red"
                    function someMethod() {
                        console.log("in QML");
                WebView {
                    id: webView
                    anchors.left: parent.left
                    anchors.right: parent.right
                    anchors.bottom: parent.bottom
                    url: ""
                    WebChannel {
                        registeredObjects: [rect];

    someFile.html placed on my server. There is qwebchannel.js in the same folder.

    <!DOCTYPE html>
        <script src="qwebchannel.js"></script>
            if(typeof qt == "undefined") console.log("qt is not ok"); 
            else {
                var channel_obj = new QWebChannel(qt.webChannelTransport, function(channel){
                    var rect = channel.objects.rect;


    I suspect that connection I want to realize is not as easy as I think :/. Do you have any ideas how to make my QML objects visible from html?


    Felgo Team

    Hi Lukasz,

    I never tried WebChannel so far – but it is usable for Felgo in the same manner as for general Qt/QML apps. There’s a WebChannel example available here:

    You can try the example and browse the code to see how everything should be set up. If you can run the example, but Qt does not support some of the required features on mobiles (Android, iOS), the same goes for Felgo as well.


Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.