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. [Solved] Singleton Signal Propogation Question
Forum Update on Tuesday, May 27th 2025

[Solved] Singleton Signal Propogation Question

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 977 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.
  • D Offline
    D Offline
    Duff
    wrote on 14 Aug 2014, 20:48 last edited by
    #1

    Hi,

    I decided to write a c++ class to handle asynchronous database queries. I registered it with my QML application as a singleton. The c++ class emits a signal when the results are ready and I use the QML "connection" type to target the database object in my component and specify the signal handler. That works great, but what if I have several different components in my QML file that need database access? I submit the query from a particular component and the signal comes back that the results are ready, but all of the components that have a signal handler for that signal get called. I guess I could associate an id with each query submission and then return that id with the signal and ignore that signal in handlers where I don't want to process those results. Is there a better way?

    thnx for you thoughts.

    Brian

    --Duff

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Duff
      wrote on 15 Aug 2014, 14:01 last edited by
      #2

      I went with my own solution setting an id for each query that I make to the db and then checking that id to restrict signal handling to a particular handler.

      --Duff

      1 Reply Last reply
      0

      1/2

      14 Aug 2014, 20:48

      • Login

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