1 Attachment(s)
problem with connecting signals with slots"
I've been programming with signals and slots for several years with no problems, but now!!
I am trying to put togather a standered user interface for several of my programs.
I want to use both pushbuttons and the function keys
See attachement (i hope it is there );
Code:
connect( Pb1, SIGNAL( clicked() ), this, SLOT( slotPb1() ) );
connect( Pb2, SIGNAL( clicked() ), this, SLOT( slotPb2() ) );
connect( Pb3, SIGNAL( clicked() ), this, SLOT( slotPb3() ) );
and i have
Code:
public slots:
void slotPb1();
void slotPb2();
void slotPb3();
in the headerfile.The program compiles without a wimper, but when I run it I get the "image" ok, but no signal slot connection
Quote:
pete@myComputer:~/Desktop/straight/baseform/test$ ./test
Object::connect: No such slot QWidget::slotPb1()
Object::connect: No such slot QWidget::slotPb2()
Object::connect: No such slot QWidget::slotPb3()
the "keyPressEvent" won't even compile of course. I have compared it with a similar program that runs fine and can't find any descrepcies. I am at a total loss.
any help would be most appreciated.
thanks
Re: problem with connecting signals with slots"
Hi, Have you inserted Q_OBJECT macro in your classes declarations?
Classes have to be derrived from QObject and have this macro defined to be able to work on signals/slots.
Re: problem with connecting signals with slots"
Thanks
I feel very stupid