How to use QMetaMethod with QObject::connect
Posted
by VestniK
on Stack Overflow
See other posts from Stack Overflow
or by VestniK
Published on 2010-05-09T22:21:47Z
Indexed on
2010/05/09
22:28 UTC
Read the original article
Hit count: 282
I have two instances of QObject subclasses and two QMetaMethod instances of signal in one of objects and slot in another object. I want to connect this signal and slot with each other.
I've looked through the qobject.h file and find that SIGNAL() and SLOT() macro are just add "1" or "2" character to the beginning of method signature so it looks like it should be possible to add the same character to the beginning of string returned by QMetaMethod::signature() but this approach depends on some undocumented internals of toolkit and may be broken at any time by a new version of Qt.
Does anybody know reliable way to connect signals and slots through their QMetaMethod reflection representation?
© Stack Overflow or respective owner