mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-06 10:18:44 -05:00
19 lines
551 B
C++
19 lines
551 B
C++
#include <QApplication>
|
|
#include <QMessageBox>
|
|
#include <QPushButton>
|
|
#include <QString>
|
|
#include <QTimer>
|
|
#include <QWidget>
|
|
|
|
void ConfirmMessage(QString* text, int msec)
|
|
{
|
|
QTimer::singleShot(msec, [text]() {
|
|
for (QWidget* widget : QApplication::topLevelWidgets()) {
|
|
if (widget->inherits("QMessageBox")) {
|
|
QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
|
|
if (text) *text = messageBox->text();
|
|
messageBox->defaultButton()->click();
|
|
}
|
|
}
|
|
});
|
|
}
|