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. Monitor a Signal of an object not always present(?).
Forum Updated to NodeBB v4.3 + New Features

Monitor a Signal of an object not always present(?).

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.3k 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.
  • C Offline
    C Offline
    chbrandt
    wrote on last edited by
    #1

    Hi guys,

    My question is about monitoring a signal emitted from a particular type of object (class), and not from an object itself (instance).
    I have a "manager" for my data structure, where I handle (centralized) every data inside my program, and I have a set of dialogs that interacts with the user. The dialog objects are created when the proper buttons are clicked. The "manager" is always present, of course, from the start till the end of the program run. On a particular dialog I want to emit a signal, so that the manager can capture it and execute the appropriate slot.
    So, how do I connect a signal from a object that will exist (the dialog) -- but is not always present/instantiated -- to a slot on my program's slot?

    Obs: I've used the Signal/Slot connections already in my program, but always between objects that are always present/instantiated, but I am not seeing how to do the current situation.

    Thanks a lot in advance!
    []
    Carlos

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rupeshbhurke
      wrote on last edited by
      #2

      Hi,

      I am not very proficient but I think following could be done: As you stated that manager is always present, may be it could be implemented as Singleton and a set of classes can be made aware of that Singleton class. So that each object of "Set of classes" can connect itself to a particular slot of "Singleton" manager or call a method on singleton object that will do the connecting. That ways you wont have to worry about connecting them elsewhere.

      I hope it helps!

      Thank you,
      Rupesh

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Simply create the connection at the moment you instantiate the object.

        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