标题:SIGNAL SIGSEGV 错误请教( 凡是带Q_OBJECT就出错 )
作者:kmine
日期:2008-08-05 22:12
内容:
我做了一个QThread类线程的测试,有段错误出现,整个程序源码如下:
//main.cpp
#include
#include "test.h"
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
Test w;
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
//threadTest.h
#ifndef THREADTEST_H
#define THREADTEST_H
#include
class MyThread : public QThread
{
protected :
virtual void run();
};
#endif
//threadTest.cpp
#include "threadTest.h"
#include
void MyThread::run()
{
for(int i=0;i