LCOV - code coverage report
Current view: top level - src/qt/test - util.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 0 11 0.0 %
Date: 2020-09-26 01:30:44 Functions: 0 2 0.0 %

          Line data    Source code
       1             : // Copyright (c) 2018-2019 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 <QApplication>
       6             : #include <QMessageBox>
       7             : #include <QPushButton>
       8             : #include <QString>
       9             : #include <QTimer>
      10             : #include <QWidget>
      11             : 
      12           0 : void ConfirmMessage(QString* text, int msec)
      13             : {
      14           0 :     QTimer::singleShot(msec, [text]() {
      15           0 :         for (QWidget* widget : QApplication::topLevelWidgets()) {
      16           0 :             if (widget->inherits("QMessageBox")) {
      17           0 :                 QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
      18           0 :                 if (text) *text = messageBox->text();
      19           0 :                 messageBox->defaultButton()->click();
      20           0 :             }
      21           0 :         }
      22           0 :     });
      23           0 : }

Generated by: LCOV version 1.15