Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    QML and Qt Quick
    2
    4
    1897
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      trusktr last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • T
        trusktr last edited by

        Aha, wait! I think I found the answer: the QML Loader Element (http://doc.qt.digia.com/qt/qml-loader.html).

        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

        1 Reply Last reply Reply Quote 0
        • J
          Jens last edited by

          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. :)

          1 Reply Last reply Reply Quote 0
          • T
            trusktr last edited by

            That's good info to know.

            If my QML app were to @import FileIO 1.0@ as in "this example":http://www.developer.nokia.com/Community/Wiki/Reading_and_writing_files_in_QML, 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":http://www.developer.nokia.com/Community/Wiki/Reading_and_writing_files_in_QML. 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?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post