Bitcoin Core
31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
qt
test
util.cpp
Go to the documentation of this file.
1
// Copyright (c) 2018-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
qt/test/util.h
>
6
7
#include <chrono>
8
9
#include <QApplication>
10
#include <QMessageBox>
11
#include <QPushButton>
12
#include <QString>
13
#include <QTimer>
14
#include <QWidget>
15
16
void
ConfirmMessage
(
QString
* text, std::chrono::milliseconds
msec
)
17
{
18
QTimer::singleShot(
msec
, [text]() {
19
for
(QWidget*
widget
: QApplication::topLevelWidgets()) {
20
if
(
widget
->inherits(
"QMessageBox"
)) {
21
QMessageBox*
messageBox
=
qobject_cast<QMessageBox*>
(
widget
);
22
if
(text) *text =
messageBox
->text();
23
messageBox
->defaultButton()->click();
24
}
25
}
26
});
27
}
ConfirmMessage
void ConfirmMessage(QString *text, std::chrono::milliseconds msec)
Press "Ok" button in message box dialog.
Definition
util.cpp:16
util.h
Ticks
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition
time.h:73
Generated on Thu Apr 16 2026 09:42:38 for Bitcoin Core by
1.10.0