Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Behaviour of a c++ model update from a different thread from which the QML QtQuick2 engine is running
Qt 6.12 LTS is out! See what's new in the release blog

Behaviour of a c++ model update from a different thread from which the QML QtQuick2 engine is running

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 671 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    The scenario has following components:

    • C++ QAbstractItemModel derived model class created in main thread
    • QML QtQuick2 Engine instantiated in main thread
    • Worker boost::thread spawned from main thread upon user interaction

    The relations between these components:

    • The C++ model is exposed through a Q_PROPERTY of a type registered with qmlRegisterSingletonType<>() to the QML Engine.
    • The worker thread updates the model through a method that invokes "emit data_changed(...)"

    The question: in which thread does the callback of the "emit data_changed(...)" happen?

    Note

    A key element in this question is that the started thread is not qt aware.

    This question is also posted here

    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
    • Unsolved