myfirst::myfirst(QObject *parent) :
QObject(parent)
{
connect(this,SIGNAL(set(QString)),this,SLOT(seting(QString),Qt::QueuedConnection);
connect(this,SIGNAL(set(QString)),this,SLOT(seting2(QString)),Qt::QueuedConnection);
}
void myfirst::seting(const QString &slot1)
{
qDebug()<<&slot1;
}
void myfirst::seting2( const QString &slot2)
{
qDebug()<<&slot2;
}
void myfirst::hjk(QString & j) //this is mu public method just emitting signal
{
emit set(j);
}
If i am not use reference then both printing same addresses
if i use reference then printing different addresses.
what is the difference
↧