diff --git a/CMakeLists.txt b/CMakeLists.txt index f54ae9bc5e47..3a7412101ff0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -776,20 +776,6 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/preferences/settingsmanager.cpp src/preferences/upgrade.cpp src/recording/recordingmanager.cpp - src/qml/asyncimageprovider.cpp - src/qml/qmlapplication.cpp - src/qml/qmlcontrolproxy.cpp - src/qml/qmlconfigproxy.cpp - src/qml/qmldlgpreferencesproxy.cpp - src/qml/qmleffectmanifestparametersmodel.cpp - src/qml/qmleffectsmanagerproxy.cpp - src/qml/qmleffectslotproxy.cpp - src/qml/qmllibraryproxy.cpp - src/qml/qmllibrarytracklistmodel.cpp - src/qml/qmlplayermanagerproxy.cpp - src/qml/qmlplayerproxy.cpp - src/qml/qmlvisibleeffectsmodel.cpp - src/qml/qmlwaveformoverview.cpp src/skin/legacy/skincontext.cpp src/skin/legacy/tooltips.cpp src/skin/skinloader.cpp @@ -904,7 +890,24 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/util/workerthreadscheduler.cpp src/util/xml.cpp ) -if(NOT QT6) +if(QT6) + target_sources(mixxx-lib PRIVATE + src/qml/asyncimageprovider.cpp + src/qml/qmlapplication.cpp + src/qml/qmlcontrolproxy.cpp + src/qml/qmlconfigproxy.cpp + src/qml/qmldlgpreferencesproxy.cpp + src/qml/qmleffectmanifestparametersmodel.cpp + src/qml/qmleffectsmanagerproxy.cpp + src/qml/qmleffectslotproxy.cpp + src/qml/qmllibraryproxy.cpp + src/qml/qmllibrarytracklistmodel.cpp + src/qml/qmlplayermanagerproxy.cpp + src/qml/qmlplayerproxy.cpp + src/qml/qmlvisibleeffectsmodel.cpp + src/qml/qmlwaveformoverview.cpp + ) +else() target_sources(mixxx-lib PRIVATE src/library/banshee/bansheedbconnection.cpp src/library/banshee/bansheefeature.cpp diff --git a/src/main.cpp b/src/main.cpp index 0fd5e14140da..64c9eab9ddba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,16 +10,18 @@ #include "coreservices.h" #include "errordialoghandler.h" #include "mixxxapplication.h" -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include "mixxxmainwindow.h" -#endif -#include "qml/qmlapplication.h" #include "sources/soundsourceproxy.h" #include "util/cmdlineargs.h" #include "util/console.h" #include "util/logging.h" #include "util/versionstore.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include "qml/qmlapplication.h" +#else +#include "mixxxmainwindow.h" +#endif + namespace { // Exit codes @@ -36,18 +38,14 @@ int runMixxx(MixxxApplication* pApp, const CmdlineArgs& args) { CmdlineArgs::Instance().parseForUserFeedback(); int exitCode; - // TODO: remove --qml command line option and make QML only available - // with Qt6 when Mixxx can build with Qt6. -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (args.getQml()) { -#endif + // This scope ensures that the main window is destroyed *before* + // CoreServices is shut down. Otherwise a debug assertion complaining about + // leaked COs may be triggered. + { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) mixxx::qml::QmlApplication qmlApplication(pApp, pCoreServices); exitCode = pApp->exec(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - } else { - // This scope ensures that `MixxxMainWindow` is destroyed *before* - // CoreServices is shut down. Otherwise a debug assertion complaining about - // leaked COs may be triggered. +#else MixxxMainWindow mainWindow(pCoreServices); pApp->processEvents(); pApp->installEventFilter(&mainWindow); @@ -70,8 +68,8 @@ int runMixxx(MixxxApplication* pApp, const CmdlineArgs& args) { qDebug() << "Running Mixxx"; exitCode = pApp->exec(); } - } #endif + } return exitCode; } diff --git a/src/util/cmdlineargs.cpp b/src/util/cmdlineargs.cpp index 1fe6d1cc04f5..a3b87f7035a0 100644 --- a/src/util/cmdlineargs.cpp +++ b/src/util/cmdlineargs.cpp @@ -189,12 +189,6 @@ bool CmdlineArgs::parse(const QStringList& arguments, CmdlineArgs::ParseMode mod : QString()); parser.addOption(developer); - const QCommandLineOption qml(QStringLiteral("qml"), - forUserFeedback ? QCoreApplication::translate("CmdlineArgs", - "Loads experimental QML GUI instead of legacy QWidget skin") - : QString()); - parser.addOption(qml); - const QCommandLineOption safeMode(QStringLiteral("safe-mode"), forUserFeedback ? QCoreApplication::translate("CmdlineArgs", "Enables safe-mode. Disables OpenGL waveforms, and " @@ -327,7 +321,6 @@ bool CmdlineArgs::parse(const QStringList& arguments, CmdlineArgs::ParseMode mod m_midiDebug = parser.isSet(controllerDebug) || parser.isSet(controllerDebugDeprecated); m_developer = parser.isSet(developer); - m_qml = parser.isSet(qml); m_safeMode = parser.isSet(safeMode) || parser.isSet(safeModeDeprecated); m_debugAssertBreak = parser.isSet(debugAssertBreak) || parser.isSet(debugAssertBreakDeprecated); diff --git a/src/util/cmdlineargs.h b/src/util/cmdlineargs.h index 331ecdce8adf..485e75ee9f35 100644 --- a/src/util/cmdlineargs.h +++ b/src/util/cmdlineargs.h @@ -33,9 +33,6 @@ class CmdlineArgs final { bool getStartInFullscreen() const { return m_startInFullscreen; } bool getMidiDebug() const { return m_midiDebug; } bool getDeveloper() const { return m_developer; } - bool getQml() const { - return m_qml; - } bool getSafeMode() const { return m_safeMode; } bool useColors() const { return m_useColors; @@ -72,7 +69,6 @@ class CmdlineArgs final { bool m_startInFullscreen; // Start in fullscreen mode bool m_midiDebug; bool m_developer; // Developer Mode - bool m_qml; bool m_safeMode; bool m_debugAssertBreak; bool m_settingsPathSet; // has --settingsPath been set on command line ?