PDA

View Full Version : Signal and slot



seldeepchan
12th March 2008, 09:10
hi
i am using spin box.when ever any changes in spinbox that is updatation in the spin box it should call one more funtion for validate the value what we entered.

connect(m_ctrlSpinFeld1, SIGNAL(valueChanged(int)),
this, SLOT(OnUpdateFeld1()));
i am using code like.but when i am excuting the file the slot not connected.i dont know what is the problem in that.

wysota
12th March 2008, 09:16
How did you declare the slot? Does the class contain the Q_OBJECT macro?

seldeepchan
12th March 2008, 09:18
ya..i declared Q_Object .but still i am getting like

Object::connect: No such slot Einsteig::CTANDatumeingabeDlg::OnUpdateFeld1()
Object::connect: (sender name: 'm_ctrlSpinFeld1')
Object::connect: (receiver name: 'Datum')
Object::connect: No such slot Einsteig::CTANDatumeingabeDlg::OnUpdateFeld2()
Object::connect: (sender name: 'm_ctrlSpinFeld2')
Object::connect: (receiver name: 'Datum')
Object::connect: No such slot Einsteig::CTANDatumeingabeDlg::OnUpdateFeld3()
Object::connect: (sender name: 'm_ctrlSpinFeld3')
Object::connect: (receiver name: 'Datum')

jpn
12th March 2008, 09:30
Could you show us the declaration of Einsteig::CTANDatumeingabeDlg?

seldeepchan
12th March 2008, 09:38
class CTANDatumeingabeDlg : public QDialog,Ui_Datum
{
Q_OBJECT

public:
CTANDatumeingabeDlg(QWidget* pParent = NULL);
}

jpn
12th March 2008, 09:45
I don't see any slots being declared there. Where did you declared OnUpdateFeldN()?

seldeepchan
12th March 2008, 10:05
oh...
thanks..i declared only private: not private slot:
thanks for ur information.