Results 1 to 2 of 2

Thread: Auto connect slots(Without parent relationship)

  1. #1
    Join Date
    Feb 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Auto connect slots(Without parent relationship)

    Hello everyone!
    I've been looking for a way of auto-connecting signals, found QMetaObject::connectSlotsByName() , which relies/assumes that you want to connect child's signals to his parent's slots.
    I'm wondering if there is a way to do it against any (Q)object, something like:

    this->connectSlotsByName(obj);

    Expecting 'obj signals' to be connected to 'this slots' matching the on_obj_signal() pattern.
    Any ideas will be appeciated

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Auto connect slots(Without parent relationship)

    You can write a foreach loop that will do it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Parent child relationship in Qt
    By TheIndependentAquarius in forum Newbie
    Replies: 18
    Last Post: 14th July 2011, 09:43
  2. Qt signal/slot auto connect problem in TREE
    By kamlmish in forum Newbie
    Replies: 2
    Last Post: 10th December 2010, 13:47
  3. Replies: 16
    Last Post: 16th February 2010, 14:17
  4. qt signal/slot auto-connect issue
    By parnedo in forum Qt Programming
    Replies: 9
    Last Post: 16th July 2009, 13:55
  5. Auto-connecting slots for object *this*?
    By hickscorp in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2007, 15:22

Tags for this Thread

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.