Skip to content

Commit

Permalink
Use QModernWindowsStylePlugin for Qt >= 6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jan 20, 2025
1 parent 9786c03 commit 032e22a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
23 changes: 19 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

cmake_minimum_required(VERSION 3.21)

message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
Expand Down Expand Up @@ -2899,8 +2900,16 @@ if(Qt_IS_STATIC)
if(WIN32)
target_link_libraries(mixxx-lib PRIVATE
Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin
Qt${QT_VERSION_MAJOR}::QWindowsVistaStylePlugin
)
if(QT_VERSION VERSION_LESS 6.7)
target_link_libraries(mixxx-lib PRIVATE
Qt${QT_VERSION_MAJOR}::QWindowsVistaStylePlugin
)
else()
target_link_libraries(mixxx-lib PRIVATE
Qt${QT_VERSION_MAJOR}::QModernWindowsStylePlugin
)
endif()
endif()

if(APPLE)
Expand Down Expand Up @@ -3047,9 +3056,15 @@ else()
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/platforms"
COMPONENT applocal)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QWindowsVistaStylePlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/styles"
COMPONENT applocal)
if(QT_VERSION VERSION_LESS 6.7)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QWindowsVistaStylePlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/styles"
COMPONENT applocal)
else()
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QModernWindowsStylePlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/styles"
COMPONENT applocal)
endif()
endif()
if(APPLE)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QCocoaIntegrationPlugin
Expand Down
4 changes: 4 additions & 0 deletions src/mixxxapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
Q_IMPORT_PLUGIN(QWasmIntegrationPlugin)
#elif defined(Q_OS_WIN)
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
Q_IMPORT_PLUGIN(QModernWindowsStylePlugin)
#else
Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)
#endif
#elif defined(Q_OS_IOS)
Q_IMPORT_PLUGIN(QIOSIntegrationPlugin)
#elif defined(Q_OS_MACOS)
Expand Down

0 comments on commit 032e22a

Please sign in to comment.