Results 1 to 2 of 2

Thread: Signal/Slot Query

  1. #1
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Signal/Slot Query

    Hi,

    I am trying to implement a signal slot connection as follows:
    connect (Object1, signal1, Object2, slot1);

    the class the connection is being generated is a sub class of a Qt designer ui file where Object1 was actually implemented in the .ui file.

    Will the subclass successfully inherit this action?

    Also Object2 is not in scope of the connection function and therefore to try to give it access to the object i have used a singleton pattern and tired to get access to the option as object 2 was instantiated within the singleton object, as shown below:

    connect ( ui_DesignerAction, SIGNAL(activated), Singleton::Instance()->getObject2, SLOT(obj2slot()));

    im assuming from my code not working that you cannot call functions from within the string?

    does anyone have a better idea of how i can implement this?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signal/Slot Query

    What action are you talking about?
    You had a small mistake in there:
    Qt Code:
    1. connect ( ui_DesignerAction, SIGNAL(activated()), Singleton::Instance()->getObject2(), SLOT(obj2slot()));
    To copy to clipboard, switch view to plain text mode 

    Singletons will work just fine and it is preferred in this cases. There is no problem( if you implemented it ok).

    im assuming from my code not working that you cannot call functions from within the string?
    No, it must be something else.
    If after correcting the connect statement, if it still doesn't work, then post some code.

    Regards

  3. The following user says thank you to marcel for this useful post:

    nleverin (3rd August 2007)

Similar Threads

  1. Mysql query question
    By twells55555 in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 23:41
  2. What argument types for Signal/Slot?
    By DPinLV in forum Qt Programming
    Replies: 5
    Last Post: 2nd August 2006, 19:08
  3. Aborting a query set on a TableModel
    By Quid in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2006, 22:36
  4. What if not Signal/Slot
    By munna in forum General Discussion
    Replies: 2
    Last Post: 26th May 2006, 06:48
  5. Replies: 4
    Last Post: 23rd January 2006, 16:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.