Skip to content

Commit

Permalink
Add new test_bitcoin-qt static library dependencies
Browse files Browse the repository at this point in the history
Avoids following error when qt is statically linked into the test binary, as on
travis:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
  • Loading branch information
ryanofsky authored and xanimo committed Mar 24, 2024
1 parent 7340b01 commit 582980b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/qt/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@

#include <openssl/ssl.h>

#if defined(QT_STATICPLUGIN)
#include <QtPlugin>
#if QT_VERSION < 0x050000
Q_IMPORT_PLUGIN(qcncodecs)
Q_IMPORT_PLUGIN(qjpcodecs)
Q_IMPORT_PLUGIN(qtwcodecs)
Q_IMPORT_PLUGIN(qkrcodecs)
#else
#if defined(QT_QPA_PLATFORM_XCB)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
#elif defined(QT_QPA_PLATFORM_WINDOWS)
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
#elif defined(QT_QPA_PLATFORM_COCOA)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
#endif
#endif
#endif

extern void noui_connect();

static int qt_argc = 1;
Expand Down

0 comments on commit 582980b

Please sign in to comment.