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
9void TestGui::testGui_data()
10{
11QWidget *myParent = nullptr;
12//! [0]
13QTestEventList events;
14events.addKeyClick(ascii: 'a');
15events.addKeyClick(qtKey: Qt::Key_Backspace);
16events.addDelay(msecs: 200);
17QLineEdit *lineEdit = new QLineEdit(myParent);
18// ...
19events.simulate(w: lineEdit);
20events.simulate(w: lineEdit);
21//! [0]
22}
23

source code of qtbase/src/testlib/doc/snippets/code/doc_src_qtestevent.cpp