×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    7

    Signals and slots?

    Hi,

    Question about signals and slots.

    I have object from class A wich creates objects from class B and class C. Now A owns B and C but B and C don't know anything about each others. What is the right way to connect B's button to C's method with signals and slots, do i have to create function in A that passes message to C's method.

    Thanks.
    Last edited by opartan; 2009-02-22 at 09:37.

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Signals and slots?

    Hi,
    Check this link How to use signal and slot.

    May be it provide some guidence.

    Regards.
    Jajal Mehul

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Signals and slots?

    No, the great thing about signals and slots is that the objects don't need to know anything about one another. You can just connect the signal from B to the slot on C. There are very few restrictions to where you can do this in your code but obviously you need to do it from somewhere that has access to both B & C. Immediately after you've constructed both of them in A would be a fairly logical place.

    Mark

    P.S. This is a general Qt question, not really related to Qt for S60. You might get better help on one of the existing Qt forums elsewhere.

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    7

    Re: Signals and slots?

    Thanks for help.

    Class A was great place to coonect B and C. Also declaring B's button and C's slots as public: helped a bit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×