Skip to content

Commit

Permalink
Merge #834: qt, build: remove unneeded Q_IMPORT_PLUGIN macro calls
Browse files Browse the repository at this point in the history
7346b01 qt, build: remove unneeded `Q_IMPORT_PLUGIN` macro calls (Sebastian Falbesoner)

Pull request description:

  After the recent full removal of Autotools (PR [#30664](bitcoin/bitcoin#30664)), these macros are not needed anymore in the .cpp files according to the TODO in qt's CMakeLists.txt. Tested building on OpenBSD 7.5, where the XCB plugin was still imported according to the debug log:
  ```
  2024-09-02T21:13:27Z Bitcoin Core version v28.99.0-7346b0109208 (release build)
  2024-09-02T21:13:27Z Qt 5.15.12 (dynamic), plugin=xcb
  2024-09-02T21:13:27Z No static plugins.
  2024-09-02T21:13:27Z Style: fusion / QFusionStyle
  2024-09-02T21:13:27Z System: OpenBSD 7.5, x86_64-little_endian-lp64
  ```

ACKs for top commit:
  hebasto:
    ACK 7346b01.

Tree-SHA512: ffa033fc6e0412a99d2c167044cc7af89512a731172d6911db71434f5353e811802c268d853a76d3732e9da954444cf6c39a852aeb25938c435826e117a16fca
  • Loading branch information
hebasto committed Sep 5, 2024
2 parents 6852d1d + 7346b01 commit d6a1b94
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
3 changes: 0 additions & 3 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ endif()

get_target_property(qt_lib_type Qt5::Core TYPE)

# TODO: After the transition from Autotools to CMake,
# all `Q_IMPORT_PLUGIN` macros can be deleted from the
# qt/bitcoin.cpp and qt/test/test_main.cpp source files.
function(import_plugins target)
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
set(plugins Qt5::QMinimalIntegrationPlugin)
Expand Down
15 changes: 0 additions & 15 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@
#include <QTranslator>
#include <QWindow>

#if defined(QT_STATIC)
#include <QtPlugin>
#if defined(QT_QPA_PLATFORM_XCB)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
#elif defined(QT_QPA_PLATFORM_WINDOWS)
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin);
#elif defined(QT_QPA_PLATFORM_COCOA)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
Q_IMPORT_PLUGIN(QMacStylePlugin);
#elif defined(QT_QPA_PLATFORM_ANDROID)
Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
#endif
#endif

// Declare meta types used for QMetaObject::invokeMethod
Q_DECLARE_METATYPE(bool*)
Q_DECLARE_METATYPE(CAmount)
Expand Down
16 changes: 0 additions & 16 deletions src/qt/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,6 @@

#include <functional>

#if defined(QT_STATIC)
#include <QtPlugin>
#if defined(QT_QPA_PLATFORM_MINIMAL)
Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin);
#endif
#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);
#elif defined(QT_QPA_PLATFORM_ANDROID)
Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
#endif
#endif

const std::function<void(const std::string&)> G_TEST_LOG_FUN{};

const std::function<std::vector<const char*>()> G_TEST_COMMAND_LINE_ARGUMENTS{};
Expand Down

0 comments on commit d6a1b94

Please sign in to comment.