i tried to make inline class using following header:
Qt Code:
#include <QString> #include <QFile> #include <QThread> { Q_OBJECT public: _File(); _File(const _File& file); public: FThread(); FThread(_File *par); virtual void run(); FThread& operator=(const FThread& other); private: _File *parentFile; }; void setProgress(qint64 val); ...//goes onTo copy to clipboard, switch view to plain text mode
and i am trying to create new instance of FThread in other file main.cpp
fileObj->fthread=new _File::FThread(fileObj);
and its giving me error as it doesn't recognize =new operator...it works fine if i dont add "new" keyword, but i need to create new instance in order to achieve my goal...
i am getting following error
../engine/main.cpp:22: error: no match for ‘operator=’ in ‘fileObj->_File::fthread = (operator new(12u), (<statement>, ((_File::FThread*)<anonymous>)))’
../engine/_file.h:25: candidates are: _File::FThread& _File::FThread:perator=(const _File::FThread&)
please help
any help please?
Bookmarks