Merge #14527: qa: Revert "Make qt wallet test compatible with qt4" (#4547)

fadffae17f31507a3d79a7b7f1cef71660767e0d Revert "Make qt wallet test compatible with qt4" (MarcoFalke)

Pull request description:

  This removes the file added in #10098

Tree-SHA512: 4aa887ec02aec943f3d74f469c935acf57e43ddbea6f979bb37d3a14670571fa2276cf578e8978de92b5854d8b462f24e5e0addfb27b92fbedf90726eb5d985e

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
This commit is contained in:
Odysseas Gabrielides 2021-10-26 21:22:54 +03:00 committed by GitHub
parent c151ccaf1a
commit db77905703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 46 deletions

View File

@ -62,7 +62,6 @@ QT_MOC_CPP = \
qt/moc_bitcoinamountfield.cpp \ qt/moc_bitcoinamountfield.cpp \
qt/moc_bitcoingui.cpp \ qt/moc_bitcoingui.cpp \
qt/moc_bitcoinunits.cpp \ qt/moc_bitcoinunits.cpp \
qt/moc_callback.cpp \
qt/moc_clientmodel.cpp \ qt/moc_clientmodel.cpp \
qt/moc_coincontroldialog.cpp \ qt/moc_coincontroldialog.cpp \
qt/moc_coincontroltreewidget.cpp \ qt/moc_coincontroltreewidget.cpp \
@ -112,7 +111,6 @@ BITCOIN_MM = \
QT_MOC = \ QT_MOC = \
qt/bitcoinamountfield.moc \ qt/bitcoinamountfield.moc \
qt/callback.moc \
qt/intro.moc \ qt/intro.moc \
qt/overviewpage.moc \ qt/overviewpage.moc \
qt/rpcconsole.moc qt/rpcconsole.moc
@ -142,7 +140,6 @@ BITCOIN_QT_H = \
qt/bitcoinamountfield.h \ qt/bitcoinamountfield.h \
qt/bitcoingui.h \ qt/bitcoingui.h \
qt/bitcoinunits.h \ qt/bitcoinunits.h \
qt/callback.h \
qt/clientmodel.h \ qt/clientmodel.h \
qt/coincontroldialog.h \ qt/coincontroldialog.h \
qt/coincontroltreewidget.h \ qt/coincontroltreewidget.h \

View File

@ -1,30 +0,0 @@
#ifndef BITCOIN_QT_CALLBACK_H
#define BITCOIN_QT_CALLBACK_H
#include <QObject>
class Callback : public QObject
{
Q_OBJECT
public Q_SLOTS:
virtual void call() = 0;
};
template <typename F>
class FunctionCallback : public Callback
{
F f;
public:
explicit FunctionCallback(F f_) : f(std::move(f_)) {}
~FunctionCallback() override {}
void call() override { f(this); }
};
template <typename F>
FunctionCallback<F>* makeCallback(F f)
{
return new FunctionCallback<F>(std::move(f));
}
#endif // BITCOIN_QT_CALLBACK_H

View File

@ -7,14 +7,13 @@
#include <qt/addressbookpage.h> #include <qt/addressbookpage.h>
#include <qt/addresstablemodel.h> #include <qt/addresstablemodel.h>
#include <qt/editaddressdialog.h> #include <qt/editaddressdialog.h>
#include <qt/callback.h>
#include <qt/optionsmodel.h> #include <qt/optionsmodel.h>
#include <qt/qvalidatedlineedit.h> #include <qt/qvalidatedlineedit.h>
#include <qt/walletmodel.h> #include <qt/walletmodel.h>
#include <key.h> #include <key.h>
#include <pubkey.h>
#include <key_io.h> #include <key_io.h>
#include <pubkey.h>
#include <wallet/wallet.h> #include <wallet/wallet.h>
#include <QApplication> #include <QApplication>

View File

@ -1,15 +1,13 @@
#include <qt/callback.h>
#include <QApplication> #include <QApplication>
#include <QMessageBox> #include <QMessageBox>
#include <QTimer>
#include <QString>
#include <QPushButton> #include <QPushButton>
#include <QString>
#include <QTimer>
#include <QWidget> #include <QWidget>
void ConfirmMessage(QString* text, int msec) void ConfirmMessage(QString* text, int msec)
{ {
QTimer::singleShot(msec, makeCallback([text](Callback* callback) { QTimer::singleShot(msec, [text]() {
for (QWidget* widget : QApplication::topLevelWidgets()) { for (QWidget* widget : QApplication::topLevelWidgets()) {
if (widget->inherits("QMessageBox")) { if (widget->inherits("QMessageBox")) {
QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget); QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
@ -17,6 +15,5 @@ void ConfirmMessage(QString* text, int msec)
messageBox->defaultButton()->click(); messageBox->defaultButton()->click();
} }
} }
delete callback; });
}), &Callback::call);
} }

View File

@ -6,7 +6,6 @@
#include <interfaces/node.h> #include <interfaces/node.h>
#include <base58.h> #include <base58.h>
#include <qt/bitcoinamountfield.h> #include <qt/bitcoinamountfield.h>
#include <qt/callback.h>
#include <qt/clientmodel.h> #include <qt/clientmodel.h>
#include <qt/optionsmodel.h> #include <qt/optionsmodel.h>
#include <qt/qvalidatedlineedit.h> #include <qt/qvalidatedlineedit.h>
@ -42,7 +41,7 @@ namespace
//! Press "Yes" or "Cancel" buttons in modal send confirmation dialog. //! Press "Yes" or "Cancel" buttons in modal send confirmation dialog.
void ConfirmSend(QString* text = nullptr, bool cancel = false) void ConfirmSend(QString* text = nullptr, bool cancel = false)
{ {
QTimer::singleShot(0, makeCallback([text, cancel](Callback* callback) { QTimer::singleShot(0, [text, cancel]() {
for (QWidget* widget : QApplication::topLevelWidgets()) { for (QWidget* widget : QApplication::topLevelWidgets()) {
if (widget->inherits("SendConfirmationDialog")) { if (widget->inherits("SendConfirmationDialog")) {
SendConfirmationDialog* dialog = qobject_cast<SendConfirmationDialog*>(widget); SendConfirmationDialog* dialog = qobject_cast<SendConfirmationDialog*>(widget);
@ -52,8 +51,7 @@ void ConfirmSend(QString* text = nullptr, bool cancel = false)
button->click(); button->click();
} }
} }
delete callback; });
}), &Callback::call);
} }
//! Send coins to address and return txid. //! Send coins to address and return txid.