I have a widget:
//foo.h
#include <QTimer>
...
{
...
private slots:
void on_timer_timeout();
...
private:
...
}
//foo.h
#include <QTimer>
...
class foo : public QWidget
{
...
private slots:
void on_timer_timeout();
...
private:
QTimer *timer;
...
}
To copy to clipboard, switch view to plain text mode
and
//foo.cpp
#include "foo.h"
{
...
timer->start(5);
...
}
void foo::on_timer_timeout()
{
//do stuff
}
//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
}
To copy to clipboard, switch view to plain text mode
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?
Bookmarks