Important: Please read the Qt Code of Conduct -

Can a QML app receive QML files through the internet like an HTML app?

  • For example, can I make a QML app that can receive and render QML files from a URL, behaving similar to an HTML app/browser?

  • Aha, wait! I think I found the answer: the QML Loader Element (

    I haven't tested yet, but I'm assuming it will let me get QML from any URL on the net.

    This is good because then you can easily make a server that serves either HTML or QML using a templating engine so the important data is the same. :D

  • Yep this would work. But feeding live QML code through a web server is certainly not a very safe thing to do. Keep in mind that with most html browsers you are sandboxed. With QML you are most likely not unless you write your own sandbox. I would strongly suggest that you let the server send raw json or xml and that you parse the data on the client side instead. :)

  • That's good info to know.

    If my QML app were to @import FileIO 1.0@ as in "this example":, I'd imagine an attacker could intercept and change the QML and/or JavaScript during the internet transaction and wreak havoc.

    Suppose the C++ end of my QML app does not contain any of the FileIO modifications like in "that example": Suppose my app is based strictly on an entry level QML example where the C++ merely implements a QML view. What sort of damage could an attacker do? Another way to ask the same question: What sort of control do I have over the user's system if I start a new QML app in Qt Creator and write strictly QML/JavaScript without writing any C++ code?

Log in to reply