| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause |
| 3 | |
| 4 | #include <QTest> |
| 5 | #include <QLineEdit> |
| 6 | |
| 7 | #include "doc_src_qtestevent.h" |
| 8 | |
| 9 | void TestGui::testGui_data() |
| 10 | { |
| 11 | QWidget *myParent = nullptr; |
| 12 | //! [0] |
| 13 | QTestEventList events; |
| 14 | events.addKeyClick(ascii: 'a'); |
| 15 | events.addKeyClick(qtKey: Qt::Key_Backspace); |
| 16 | events.addDelay(msecs: 200); |
| 17 | QLineEdit *lineEdit = new QLineEdit(myParent); |
| 18 | // ... |
| 19 | events.simulate(w: lineEdit); |
| 20 | events.simulate(w: lineEdit); |
| 21 | //! [0] |
| 22 | } |
| 23 |
