[Qt-creator] Some bunch of errors on very simple class (newby question)
Kosta
userqt at gmail.com
Sat May 23 12:01:46 CEST 2009
Can somebody tell me what's the problem here ? Here is my class :
.h :
#ifndef SYSTEMCONFIGTABMGR_H
#define SYSTEMCONFIGTABMGR_H
#include <QThread>
class SystemConfigTabMgr : public QThread
{
Q_OBJECT
public:
SystemConfigTabMgr(QObject *parent = 0);
void run();
};
#endif // SYSTEMCONFIGTABMGR_H
.cpp :
#include "SystemConfigTabMgr.h"
SystemConfigTabMgr::SystemConfigTabMgr(QObject *parent)
:QThread(parent)
{
}
Errors on compile :
In file included from d:/Qt/2009.02/qt/include/QtCore/qthread.h:1,
from d:/Qt/2009.02/qt/include/QtCore/QThread:1,
from SystemConfigTabMgr.h:4,
from SystemConfigTabMgr.cpp:1:
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/thread/qthread.h:67: error: ISO C++ forbids declaration of `QThread' with no type
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/thread/qthread.h:67: error: only declarations of constructors can be `explicit'
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/thread/qthread.h:67: error: declaration of `int QObjectQThread::QThread(QObject*)'
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/kernel/qobject.h:68: error: changes meaning of `QThread' from `struct QThread'
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/thread/qthread.h:68: error: expected class-name before '(' token
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/thread/qthread.h:126: error: ISO C++ forbids declaration of `QThread' with no type
In file included from SystemConfigTabMgr.cpp:1:
SystemConfigTabMgr.h:7: error: invalid use of undefined type `struct QThread'
d:/Qt/2009.02/qt/include/QtCore/../../src/corelib/kernel/qobject.h:68: error: forward declaration of `struct QThread'
SystemConfigTabMgr.cpp: In constructor `SystemConfigTabMgr::SystemConfigTabMgr(QObject*)':
SystemConfigTabMgr.cpp:4: error: type `struct QThread' is not a direct base of `SystemConfigTabMgr'
mingw32-make.exe[1]: Leaving directory `D:/Documents and Settings/Secret/Desktop/workspace/TestProject
D:\Qt\2009.02\mingw\bin\mingw32-make.exe: Leaving directory `D:/Documents and Settings/Secret/Desktop/workspace/TestProject
mingw32-make.exe[1]: *** [debug/SystemConfigTabMgr.o] Error 1
D:\Qt\2009.02\mingw\bin\mingw32-make.exe: *** [debug] Error 2
Exited with code 2.
Error while building project TestProject
When executing build step 'Make'
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090523/562fa0bf/attachment.html
More information about the Qt-creator-old
mailing list