我正在尝试运行一个后台线程(qthread),需要监视GUI中的复选框,但它无法运行!它可以构建,但在运行时,我收到以下错误:
"Unhandled exception at 0x0120f494 in program.exe: 0xC0000005: Access violation reading location 0xcdcdce55."
并且它会在"connect"行上断开。最好的方法是什么?
guiclass::guiclass(){
thread *t = new thread();
}
thread::thread(){
guiclass *c = new guiclass();
connect(c->checkBox, SIGNAL(stateChanged(int)), this, SLOT(checked(int)));
....
start work
....
}
bool thread::checked(int c){
return(c==0);
}
void thread::run(){
if(checked()){
do stuff
}
}
c->checkBox
?你如何处理new guiclass
调用new thread
,new guiclass
调用new thread
,new guiclass
调用new thread
,new guiclass
调用new thread
的事实? - Mat