Merge pull request #2666 from patricklodder/1.14.5-qt-discard-args

Give QApplication dummy arguments
This commit is contained in:
Ross Nicoll 2021-11-03 22:55:54 +00:00 committed by GitHub
commit 0e917fcf1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -197,7 +197,7 @@ class BitcoinApplication: public QApplication
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit BitcoinApplication(int &argc, char **argv); explicit BitcoinApplication();
~BitcoinApplication(); ~BitcoinApplication();
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
@ -312,8 +312,11 @@ void BitcoinCore::shutdown()
} }
} }
BitcoinApplication::BitcoinApplication(int &argc, char **argv): static int qt_argc = 1;
QApplication(argc, argv), static const char* qt_argv = "dogecoin-qt";
BitcoinApplication::BitcoinApplication():
QApplication(qt_argc, const_cast<char **>(&qt_argv)),
coreThread(0), coreThread(0),
optionsModel(0), optionsModel(0),
clientModel(0), clientModel(0),
@ -550,7 +553,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(bitcoin); Q_INIT_RESOURCE(bitcoin);
Q_INIT_RESOURCE(bitcoin_locale); Q_INIT_RESOURCE(bitcoin_locale);
BitcoinApplication app(argc, argv); BitcoinApplication app;
#if QT_VERSION > 0x050100 #if QT_VERSION > 0x050100
// Generate high-dpi pixmaps // Generate high-dpi pixmaps
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);

View file

@ -33,6 +33,9 @@ Q_IMPORT_PLUGIN(qkrcodecs)
extern void noui_connect(); extern void noui_connect();
static int qt_argc = 1;
static const char* qt_argv = "dogecoin-qt";
// This is all you need to run all the tests // This is all you need to run all the tests
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -46,7 +49,7 @@ int main(int argc, char *argv[])
// Don't remove this, it's needed to access // Don't remove this, it's needed to access
// QCoreApplication:: in the tests // QCoreApplication:: in the tests
QCoreApplication app(argc, argv); QCoreApplication app(qt_argc, const_cast<char **>(&qt_argv));
app.setApplicationName("Bitcoin-Qt-test"); app.setApplicationName("Bitcoin-Qt-test");
SSL_library_init(); SSL_library_init();