Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QDeclarativeEngine in a QThread
Forum Updated to NodeBB v4.3 + New Features

QDeclarativeEngine in a QThread

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 2.4k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    bunjee
    wrote on last edited by
    #1

    Greetings Qt enthusiasts,

    I would like to "sandbox" the execution of a QML file.

    Is it possible to run QDeclarativeEngine or QDeclarativeComponent inside a QThread.

    The goal is to prevent my program to freeze if a malicious javascript infinite loop is executed.

    Thanks.

    B.A.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      Since those are GUI-related classes, they must run in the main thread.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        You can try to use WorkerScript in your qml for heavy js calculations.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bunjee
          wrote on last edited by
          #4

          Thanks guys.

          @mlong: What happens if my QML is only based on QObject(s) ?

          @Denis: The idea is to be able to load any QML file without risking to crash the app. Just like HTML in the browser. I cannot force anyone to use WorkerScript in their QML.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved