[Qt-interest] Object::connect: No such slot

Frank Mertens frank at cyblogic.de
Fri Dec 19 18:09:19 CET 2008


Ying Ma wrote:
>  Research & Development
> 
> ________________________________________________________________________
> Hello,
> 
>     I got a problem when trying to connect signal with slot. my code is:
> 
> class DripPage : public QWizardPage
> {
>     Q_OBJECT
>     public:
>         DripPage( QWidget *parent = 0 );
>         ~DripPage();
>         ... ...
>     public slots:
>         void slotDelete( int which );
>         ... ...
> };
> 
> 
> DripPage::DripPage( QWidget *parent ) : QWizardPage( parent )
> {
>     MyWizard = ( DripConfigWizard * ) parent;
>     ... ...
>     connect(MyWizard, SIGNAL(customButtonClicked(int)), this,
> SLOT(slotDelete(int)));
>     ... ...
> }
> 
> void DripPage::slotDelete(int which)
> {
>     ... ...
> }
> 
>     There is no compile error, but when I run the application, I get an
> error says:
> Object::connect:  No such slot DripPage::slotDelete(int). What's the
> problem with my
> code? I really don't get it. Can you help me?
> 
>     Thanks!
>     Best regards,
> 
>     Ying Ma
> 

Slots are generated by 'moc'. Have you checked your build log, that moc
is run and the moc object is linked? Compare it with one of the Qt
examples.

--
Frank



More information about the Qt-interest-old mailing list