Qt 回调函数的问题
int CtiBoardEventCb(WORD wEvent,int nReference,WORD dwParam)
{
WORD newS;
switch(wEvent)
{
case EVT_CHSTAT_CHG:
newS = (WORD)(dwParam & 0xffff);
pState->nCh = nReference;
switch(newS)
{
case 1: break;
case CH_STATE_FREE:break;
case CH_STATE_PICKUPED:qDebug()<<pState->nCh<<" PICKEDUP"<<endl;break;
case CH_STATE_ALERTING:qDebug()<<pState->nCh<<" ALERTING"<<endl;break;
case CH_STATE_RINGBACK:qDebug()<<pState->nCh<<" RINGBACK"<<endl;break;
case CH_STATE_CALLOUT:qDebug()<<pState->nCh<<" CALLOUT"<<endl;break;
case CH_STATE_CONNECT:qDebug()<<pState->nCh<<" CONNECT"<<endl;break;
case CH_STATE_WAITHUNGUP:qDebug()<<pState->nCh<<" WAITHUNGUP"<<endl;break;
default:
break;
}
default:
break;
}
pState->State = newS;
return 0;
}
这是一个回调函数,我想达到的一个目的就是在回调函数的case语句中,去控制ui中的控件(上面qDebug的语句就是我要在控件内加入的信息,我现在只能打印在下面,不能打印在控件中),比如edit之类的,但是这个函数有又不是在这个mainwindow这个类中,不能直接去控制ui内的控件,我该如何去解决这个问题!请大神指导啊! qt ui
[解决办法]