标题:qml接受qt信号的问题
作者:dfighoerng
日期:2015-05-10 17:30
内容:
OnSig::OnSig(QObject *parent) :
QObject(parent)
{
connect(this,SIGNAL(sendFun()),this,SLOT(timeSend()));
emit sendFun();
}
void OnSig::timeSend(){
QDateTime t = QDateTime::currentDateTime();
QString s = t.toString("yyyy-MM-dd hh:mm:ss");
emit connectQml(s);
}
Item{
width: 240
height: 200
Text{
id: t
}
OnSig{
onConnectQml:{
t.text = timeText;
}
}
}
qml接受不到qt emit的信号,不知道是什么原因
#1 [rophie 05-12 13:10]
信号要关联啊