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

QML and threads

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 365 Views
  • 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.
  • A Offline
    A Offline
    AlexanderMason
    wrote on last edited by AlexanderMason
    #1

    Is it possible to have the Qml engine running in its own thread that wouldn’t be the main thread? Is it possible to have objects in the QML context that don’t belong to the same QML thread?

    I’m designing a tool that should operate in the backend and interact with the front end. https://testmyspeed.onl/ https://solitaire.cam/ https://essaywriter.fun/ I have a collection of QObject derivatives that are supposed to make calculations in a different thread and expose properties in QML. At the moment I cannot figure out the right way to do that. Help appreciated.

    jsulmJ 1 Reply Last reply
    0
    • A AlexanderMason

      Is it possible to have the Qml engine running in its own thread that wouldn’t be the main thread? Is it possible to have objects in the QML context that don’t belong to the same QML thread?

      I’m designing a tool that should operate in the backend and interact with the front end. https://testmyspeed.onl/ https://solitaire.cam/ https://essaywriter.fun/ I have a collection of QObject derivatives that are supposed to make calculations in a different thread and expose properties in QML. At the moment I cannot figure out the right way to do that. Help appreciated.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @AlexanderMason said in QML and threads:

      I have a collection of QObject derivatives that are supposed to make calculations in a different thread and expose properties in QML

      And why don't you move these calculations to another thread instead of moving QML parts of your app to a different thread? You can then emit signals from that other thread when UI needs to be updated, but the UI is then changed in the UI thread, just like it should be.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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