[Qt-interest] Connect with the name of the signal

Scott Aron Bloom scott at onshorecs.com
Tue Feb 16 16:44:48 CET 2010


Yes,

the SIGNAL( XXXX ) is just a macro that creates a string

you can actually (and many Qt internal functions do) have a function  
like this

void MyFunc( const char * XXX, const char * YYY )
{
QObject::connect( obj1, XXX, obj2, YYY )
}

You just need to get the format correct.. which you can do by looking  
at the defintion of SIGNAL and SLOT macros

Scott
On Feb 16, 2010, at 7:35 AM, mmiacca wrote:

> Hi
>
> In my app I know the name of the signal at runtime, but no at design
> time, then is not posible to do connect(this, SIGNAL(clicked())...
> because I know "clicked", "toggled", etc at runtime.
> Can i connect a signal if i know the name?
>
> tks in advance
>
> Marcelo Miacca
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list