qt中QTest::mouseClick方法不起作用
int main(int argc, char *argv[]){
QApplication app(argc, argv);
QPushButton *button=new QPushButton("Quit");
QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit()));
button->show();
QPoint pos;
pos.setX(30);
pos.setY(30);
QTest::qWait(5000);
QTest::mouseClick(button,Qt::LeftButton,0,pos,-1);
return app.exec();
}
以上是我写的代码,但是QTest::mouseClick方法不起作用
页:
[1]