file.h:
#ifndef FILE_H
#define FILE_H
#include <QObject>
#include "fthread.h"
class File : public QObject
{
Q_OBJECT
public:
File(QObject *parent = 0);
FThread *thread; /// <<------------------ here is error
void test();
};
#endif // FILE_H
fthread.h
#ifndef FTHREAD_H
#define FTHREAD_H
#include <QThread>
#include "file.h"
class FThread : public QThread
{
Q_OBJECT
public:
explicit FThread(QObject *parent = 0);
virtual void run();
File *f;
signals:
void done();
public slots: //basically suppose to be in file.h
void print();
};
#endif // FTHREAD_H
file.cpp
#include "file.h"
#include <QDebug>
File::File(QObject *parent) :
QObject(parent)
{
QObject::connect(&thread,SIGNAL(done()),&thread,SL OT(print()),Qt::QueuedConnection);
}
void File::test(){
qDebug()<<"in test process";
emit thread->done();
}
fthread.cpp
#include "fthread.h"
#include <QDebug>
FThread::FThread(QObject *parent) :
QThread(parent)
{
}
void FThread::run(){
f->test();
}
void FThread:rint(){
qDebug()<<"running print() in thread";
}
can any body please help me with this as everythiing is defined properly
Bookmarks