PDA

View Full Version : signal doesnt emit



mark2804
25th December 2008, 10:06
hi,
i have problems with a signal.

so i make the signal in the header file

signals:
QString signal_add_to_list(QString, QString);

and emit it in a funktion

emit this->signal_add_to_list(typ, name);

I connected it with a slot in the same class, just to test if it works.

connect(this, SIGNAL(signal_add_to_list(QString,QString)), this, SLOT(slot_test(QString,QString)));

slot:

public slots:
void slot_test(QString atyp, QString aname);

void ClassName::slot_test(QString atyp, QString aname){
cout<<"it works"<<atyp.toStdString()<<aname.toStdString()<<endl;
}
This slot just say "it works" if it would work, but it doesnt. The compiler doesnt say an error or a warning and i already made a few signals in the same class and they works all, but i cant see the reason why this doesnt work.

Thanks for reading and may you know the answer.

mark :)

mark2804
25th December 2008, 11:41
sorry my fault. i sent the signal and then i connected the signal with the slot.

mark

araglin
25th December 2008, 22:36
also signal's return must be "void"