So I have a class defined in a header file like so...
#ifndef TIMER_H
#define TIMER_H
#include <QObject>
{
Q_OBJECT
public slots:
void StartTimer();
signals:
void TimeOut();
};
#endif // TIMER_H
#ifndef TIMER_H
#define TIMER_H
#include <QObject>
class Timer : public QObject
{
Q_OBJECT
public slots:
void StartTimer();
signals:
void TimeOut();
};
#endif // TIMER_H
To copy to clipboard, switch view to plain text mode
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[])
{
window w;
Timer t;
t::connect(w, SIGNAL(w::on_textEdit_textChanged()),t,SLOT(t::StartTimer()));
w.show();
return a.exec();
}
#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::StartTimer()));
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
So can anyone explain why I get the error message "'t' is not a class, namespace or enumeration"?
Bookmarks