1 | // Copyright (C) 2018 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause |
3 | #include <QTest> |
4 | |
5 | // dummy class |
6 | class MyObject |
7 | { |
8 | public: |
9 | int isReady(); |
10 | }; |
11 | |
12 | // dummy function |
13 | int myNetworkServerNotResponding() |
14 | { |
15 | return 1; |
16 | } |
17 | |
18 | int MyObject::isReady() |
19 | { |
20 | //! [1] |
21 | int i = 0; |
22 | while (myNetworkServerNotResponding() && i++ < 50) |
23 | QTest::qWait(ms: 250); |
24 | //! [1] |
25 | return 1; |
26 | } |
27 |