splashfreeze
26th February 2019, 02:46
So I have a class defined in a header file like so...
#ifndef TIMER_H
#define TIMER_H
#include <QObject>
class Timer : public QObject
{
Q_OBJECT
public slots:
void StartTimer();
signals:
void TimeOut();
};
#endif // TIMER_H
and what my main function does is simply create an instance of the timer class and make a connect with a signal from
a textedit object
Below is the main function
#include "window.h"
#include <QApplication>
#include "timer.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
window w;
Timer t;
t::connect(w, SIGNAL(w::on_textEdit_textChanged()),t,SLOT(t::Sta rtTimer()));
w.show();
return a.exec();
}
So can anyone explain why I get the error message "'t' is not a class, namespace or enumeration"?
#ifndef TIMER_H
#define TIMER_H
#include <QObject>
class Timer : public QObject
{
Q_OBJECT
public slots:
void StartTimer();
signals:
void TimeOut();
};
#endif // TIMER_H
and what my main function does is simply create an instance of the timer class and make a connect with a signal from
a textedit object
Below is the main function
#include "window.h"
#include <QApplication>
#include "timer.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
window w;
Timer t;
t::connect(w, SIGNAL(w::on_textEdit_textChanged()),t,SLOT(t::Sta rtTimer()));
w.show();
return a.exec();
}
So can anyone explain why I get the error message "'t' is not a class, namespace or enumeration"?