di_zou
8th September 2009, 22:11
I have a widget:
//foo.h
#include <QTimer>
...
class foo : public QWidget
{
...
private slots:
void on_timer_timeout();
...
private:
QTimer *timer;
...
}
and
//foo.cpp
#include "foo.h"
foo::foo(QWidget *parent)
: QWidget(parent)
{
...
timer = new QTimer(this);
timer->start(5);
...
}
void foo::on_timer_timeout()
{
//do stuff
}
When I run the program that creates the widget foo, I get the error:
QMetaObject::connectSlotsByName: No matching signal for on_timer_timeout().
What is the problem?
//foo.h
#include <QTimer>
...
class foo : public QWidget
{
...
private slots:
void on_timer_timeout();
...
private:
QTimer *timer;
...
}
and
//foo.cpp
#include "foo.h"
foo::foo(QWidget *parent)
: QWidget(parent)
{
...
timer = new QTimer(this);
timer->start(5);
...
}
void foo::on_timer_timeout()
{
//do stuff
}
When I run the program that creates the widget foo, I get the error:
QMetaObject::connectSlotsByName: No matching signal for on_timer_timeout().
What is the problem?