51Testing软件测试论坛

标题: qt中QTest::mouseClick方法不起作用 [打印本页]

作者: daisy_xiaotong    时间: 2015-5-29 11:05
标题: 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:eftButton,0,pos,-1);
return app.exec();
}

以上是我写的代码,但是QTest::mouseClick方法不起作用




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2