mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-22 05:19:42 +00:00
23 lines
648 B
C++
23 lines
648 B
C++
#include <qt/callback.h>
|
|
|
|
#include <QApplication>
|
|
#include <QMessageBox>
|
|
#include <QTimer>
|
|
#include <QString>
|
|
#include <QPushButton>
|
|
#include <QWidget>
|
|
|
|
void ConfirmMessage(QString* text, int msec)
|
|
{
|
|
QTimer::singleShot(msec, makeCallback([text](Callback* callback) {
|
|
for (QWidget* widget : QApplication::topLevelWidgets()) {
|
|
if (widget->inherits("QMessageBox")) {
|
|
QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
|
|
if (text) *text = messageBox->text();
|
|
messageBox->defaultButton()->click();
|
|
}
|
|
}
|
|
delete callback;
|
|
}), SLOT(call()));
|
|
}
|