Create a method to use as an intermediate slot, like this.
Point p(a,b);
connect(timer, SIGNAL(timedout()), this, q);
q() {
startDestruction(this->p)
}
本文介绍如何通过Qt的信号槽机制,利用定时器的超时信号来间接调用成员函数,并传递一个Point对象作为参数。文章提供了一个具体的示例代码,展示了如何创建中间槽函数以实现这一目标。
In this I want to call a function, that function will receive a point . But this function should be invoked by a timer's timedout signal. Can anybody say how to achieve this. Below is the required/error code
Point p(a,b);
connect(timer,SIGNAL(timedout()),this,startDestruction(p));
Can anybody say how to achieve this?
Create a method to use as an intermediate slot, like this.
Point p(a,b);
connect(timer, SIGNAL(timedout()), this, q);
q() {
startDestruction(this->p)
}
633
1129

被折叠的 条评论
为什么被折叠?