Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/apptests.cpp
Show All 25 Lines | |||||
#include <QAction> | #include <QAction> | ||||
#include <QEventLoop> | #include <QEventLoop> | ||||
#include <QLineEdit> | #include <QLineEdit> | ||||
#include <QScopedPointer> | #include <QScopedPointer> | ||||
#include <QTest> | #include <QTest> | ||||
#include <QTextEdit> | #include <QTextEdit> | ||||
#include <QtGlobal> | #include <QtGlobal> | ||||
/* | |||||
* FIXME: <QtTest/QtTestGui> requires QT_WIDGETS_LIB to be defined prior | |||||
* inclusion to export the QtTest::keyClicks symbol. | |||||
* On some older Qt versions the definition end up being set by the inclusion of | |||||
* <QtTest/QtTestWidgets>. | |||||
* This only occurs when building with autotools, as QMake and CMake define | |||||
* QT_WIDGETS_LIB on the command line. As a workaround for autotools, | |||||
* <QtTest/QtTestWidgets> should be included before <QtTest/QtTestGui>. | |||||
* Also prevent the linter from sorting the includes. | |||||
*/ | |||||
// clang-format off | |||||
#include <QtTest/QtTestWidgets> | |||||
#include <QtTest/QtTestGui> | #include <QtTest/QtTestGui> | ||||
// clang-format on | #include <QtTest/QtTestWidgets> | ||||
namespace { | namespace { | ||||
//! Call getblockchaininfo RPC and check first field of JSON output. | //! Call getblockchaininfo RPC and check first field of JSON output. | ||||
void TestRpcCommand(RPCConsole *console) { | void TestRpcCommand(RPCConsole *console) { | ||||
QEventLoop loop; | QEventLoop loop; | ||||
QTextEdit *messagesWidget = | QTextEdit *messagesWidget = | ||||
console->findChild<QTextEdit *>("messagesWidget"); | console->findChild<QTextEdit *>("messagesWidget"); | ||||
QObject::connect(messagesWidget, &QTextEdit::textChanged, &loop, | QObject::connect(messagesWidget, &QTextEdit::textChanged, &loop, | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |