daisy_xiaotong 发表于 2015-5-29 11:05:08

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]
查看完整版本: qt中QTest::mouseClick方法不起作用