Results 1 to 2 of 2

Thread: Auto connect slots(Without parent relationship)

  1. #1
    Join Date
    Feb 2012
    Qt products

    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:


    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
    Warsaw, Poland
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    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, 08:43
  2. Qt signal/slot auto connect problem in TREE
    By kamlmish in forum Newbie
    Replies: 2
    Last Post: 10th December 2010, 12:47
  3. Replies: 16
    Last Post: 16th February 2010, 13:17
  4. qt signal/slot auto-connect issue
    By parnedo in forum Qt Programming
    Replies: 9
    Last Post: 16th July 2009, 12:55
  5. Auto-connecting slots for object *this*?
    By hickscorp in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2007, 14:22

Tags for this Thread


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.