QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);
这里必须要有this吗,SLOT的函数能不能不属于某个类呢?
我想在3秒后MainWindow的w关闭并显示另一个窗口(w2.show()),但是不知道怎样写,上面是官方文档的一段代码
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);
这里必须要有this吗,SLOT的函数能不能不属于某个类呢?
我想在3秒后MainWindow的w关闭并显示另一个窗口(w2.show()),但是不知道怎样写,上面是官方文档的一段代码