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. Using QSqlQueryModel in another thread and access it from main thread?
Forum Updated to NodeBB v4.3 + New Features

Using QSqlQueryModel in another thread and access it from main thread?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.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.
  • H Offline
    H Offline
    herophuong
    wrote on last edited by
    #1

    I'm not good at multithread programming so I really need someone who will shed some light for me on the way to do this.

    My program is updating database frequently and each time the database is updated, the QSqlQueryModel also needs to be re-query as well to reflect the change. So I think if I leave the query model in another thread, the UI will not be blocked until the query is done.

    Note: My program is QML-based. The query models need to be passed directly to the QML object by pointer. So how do I access QSqlQueryModel from another thread from main thread by pointer? Or may be this is just impossible, in which case, I also need you guys to help me out.

    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