2 xiaochoutong xiaochoutong 于 2015.06.01 15:39 提问

Qtestlib的鼠标单击方法不起作用

Ui::MainWindow ui;
QMainWindow *window1=new QMainWindow;
ui.setupUi(window1);
ui.retranslateUi(window1);
QTest::keyClick(ui.lineEdit,Qt::Key_1);
QTest::keyClick(ui.lineEdit_2,Qt::Key_2);
QTest::qWait(5000);
QTest::mouseClick(ui.pushButton,Qt::LeftButton);
QTest::qWait(5000);
QCOMPARE(ui.lineEdit->text().toInt(),1);
QCOMPARE(ui.lineEdit_2->text().toInt(),2);
QCOMPARE(ui.lineEdit_3->text().toInt(),3);

Csdn user default icon
上传中...
上传图片
插入图片