From a2f8fb89ddb5527490fa60dd430b9c7a1d476846 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:58:56 +0200 Subject: [PATCH 01/18] Update minimum macOS deployment target to 10.15 which is required for Qt 6.5.0 --- buildscripts/ci/macos/setup.sh | 2 +- buildscripts/cmake/SetupBuildEnvironment.cmake | 4 ++-- .../ui/internal/platform/macos/macosplatformtheme.mm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildscripts/ci/macos/setup.sh b/buildscripts/ci/macos/setup.sh index e03ab78868761..78e47a9449552 100644 --- a/buildscripts/ci/macos/setup.sh +++ b/buildscripts/ci/macos/setup.sh @@ -22,7 +22,7 @@ echo "Setup macOS build environment" trap 'echo Setup failed; exit 1' ERR -export MACOSX_DEPLOYMENT_TARGET=10.14 +export MACOSX_DEPLOYMENT_TARGET=10.15 # Install build tools echo "Install build tools" diff --git a/buildscripts/cmake/SetupBuildEnvironment.cmake b/buildscripts/cmake/SetupBuildEnvironment.cmake index 5e024ab0f9e62..316758d723da2 100644 --- a/buildscripts/cmake/SetupBuildEnvironment.cmake +++ b/buildscripts/cmake/SetupBuildEnvironment.cmake @@ -60,8 +60,8 @@ endif() # Mac-specific if(OS_IS_MAC) - set(MACOSX_DEPLOYMENT_TARGET 10.14) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14) + set(MACOSX_DEPLOYMENT_TARGET 10.15) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) endif(OS_IS_MAC) # MSVC-specific diff --git a/src/framework/ui/internal/platform/macos/macosplatformtheme.mm b/src/framework/ui/internal/platform/macos/macosplatformtheme.mm index dc98f293c89a0..c61077523689f 100644 --- a/src/framework/ui/internal/platform/macos/macosplatformtheme.mm +++ b/src/framework/ui/internal/platform/macos/macosplatformtheme.mm @@ -56,7 +56,7 @@ bool MacOSPlatformTheme::isFollowSystemThemeAvailable() const { - // Supported from macOS 10.14, which is our minimum supported version + // Supported from macOS 10.14, while our minimum supported version is 10.15 return true; } From d756aff42b3c8c245569df81f3bd6493899158ef Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sat, 14 May 2022 15:53:06 +0200 Subject: [PATCH 02/18] Don't use deprecated constructor of QMouseEvent It was deprecated in Qt 6.4. Basically, just need to specify `globalPos` --- src/framework/uicomponents/view/widgetview.cpp | 1 + src/notation/tests/notationviewinputcontroller_tests.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/framework/uicomponents/view/widgetview.cpp b/src/framework/uicomponents/view/widgetview.cpp index cab9e151dad76..5f4497e7fb258 100644 --- a/src/framework/uicomponents/view/widgetview.cpp +++ b/src/framework/uicomponents/view/widgetview.cpp @@ -90,6 +90,7 @@ bool WidgetView::handleHoverEvent(QHoverEvent* event) if (convertedType == QEvent::MouseMove) { QMouseEvent mouseEvent(convertedType, event->position(), + event->scenePosition(), event->globalPosition(), Qt::NoButton, Qt::NoButton, event->modifiers()); mouseEvent.setAccepted(event->isAccepted()); mouseEvent.setTimestamp(event->timestamp()); diff --git a/src/notation/tests/notationviewinputcontroller_tests.cpp b/src/notation/tests/notationviewinputcontroller_tests.cpp index 3a383af4bd767..5b085ebc4e40e 100644 --- a/src/notation/tests/notationviewinputcontroller_tests.cpp +++ b/src/notation/tests/notationviewinputcontroller_tests.cpp @@ -120,7 +120,7 @@ class NotationViewInputControllerTests : public ::testing::Test Qt::KeyboardModifiers modifiers = Qt::NoModifier, QPointF pos = QPointF(100, 100)) const { - QMouseEvent* ev = new QMouseEvent(QMouseEvent::Type::MouseButtonPress, pos, button, {}, modifiers); + QMouseEvent* ev = new QMouseEvent(QMouseEvent::Type::MouseButtonPress, pos, pos, button, {}, modifiers); m_events << ev; From c899d4816437c5f59ec981a5a942fe1c5ff692f4 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:00:00 +0200 Subject: [PATCH 03/18] Don't use deprecated QCheckBox::stateChanged It was deprecated during the Qt 6.8 beta phase, but it looks like this deprecation has been postponed to Qt 6.9. Anyway, there is now a better alternative called `checkStateChanged`, that uses `Qt::CheckState` instead of `int`. --- src/notation/view/widgets/editstyle.cpp | 2 +- src/palette/view/widgets/symboldialog.cpp | 4 ++-- src/palette/view/widgets/symboldialog.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/notation/view/widgets/editstyle.cpp b/src/notation/view/widgets/editstyle.cpp index a9a4d423fb062..a9e28b7d7b8cf 100644 --- a/src/notation/view/widgets/editstyle.cpp +++ b/src/notation/view/widgets/editstyle.cpp @@ -1048,7 +1048,7 @@ EditStyle::EditStyle(QWidget* parent) } else if (auto radioButton = qobject_cast(sw.widget)) { connect(radioButton, &QRadioButton::toggled, setSignalMapper, mapFunction); } else if (auto checkBox = qobject_cast(sw.widget)) { - connect(checkBox, &QCheckBox::stateChanged, setSignalMapper, mapFunction); + connect(checkBox, &QCheckBox::checkStateChanged, setSignalMapper, mapFunction); } else if (auto button = qobject_cast(sw.widget)) { connect(button, &QAbstractButton::toggled, setSignalMapper, mapFunction); } else if (auto groupBox = qobject_cast(sw.widget)) { diff --git a/src/palette/view/widgets/symboldialog.cpp b/src/palette/view/widgets/symboldialog.cpp index aea1940ea27d4..1b27da75745e1 100644 --- a/src/palette/view/widgets/symboldialog.cpp +++ b/src/palette/view/widgets/symboldialog.cpp @@ -107,7 +107,7 @@ SymbolDialog::SymbolDialog(const QString& s, QWidget* parent) m_symbolsWidget->setDrawGrid(true); m_symbolsWidget->setSelectable(true); - connect(systemFlag, &QCheckBox::stateChanged, this, &SymbolDialog::systemFlagChanged); + connect(systemFlag, &QCheckBox::checkStateChanged, this, &SymbolDialog::systemFlagChanged); connect(fontList, &QComboBox::currentIndexChanged, this, &SymbolDialog::systemFontChanged); symbolsArea->setWidget(m_symbolsWidget); @@ -120,7 +120,7 @@ SymbolDialog::SymbolDialog(const QString& s, QWidget* parent) // systemFlagChanged //--------------------------------------------------------- -void SymbolDialog::systemFlagChanged(int state) +void SymbolDialog::systemFlagChanged(Qt::CheckState state) { bool sysFlag = state == Qt::Checked; for (int i = 0; i < m_symbolsWidget->actualCellCount(); ++i) { diff --git a/src/palette/view/widgets/symboldialog.h b/src/palette/view/widgets/symboldialog.h index 9728b3616f6ce..3ea415e605e5a 100644 --- a/src/palette/view/widgets/symboldialog.h +++ b/src/palette/view/widgets/symboldialog.h @@ -46,7 +46,7 @@ class SymbolDialog : public QWidget, Ui::SymbolDialogBase SymbolDialog(const QString&, QWidget* parent = 0); private slots: - void systemFlagChanged(int); + void systemFlagChanged(Qt::CheckState); void systemFontChanged(int); void on_search_textChanged(const QString& searchPhrase); void on_clearSearch_clicked(); From c32b0351e7674af492f9c16602b7f2c33251a01b Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:46:36 +0200 Subject: [PATCH 04/18] Windows package.bat: microcleanup --- buildscripts/ci/windows/package.bat | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/buildscripts/ci/windows/package.bat b/buildscripts/ci/windows/package.bat index a6b3a47a17058..3721a66ea31f2 100644 --- a/buildscripts/ci/windows/package.bat +++ b/buildscripts/ci/windows/package.bat @@ -74,6 +74,8 @@ IF %DO_SIGN% == ON ( ) ) +SET SIGN="buildscripts\ci\windows\sign.bat" + SET /p BUILD_VERSION=<%ARTIFACTS_DIR%\env\build_version.env SET /p BUILD_NUMBER=<%ARTIFACTS_DIR%\env\build_number.env SET /p BUILD_BRANCH=<%ARTIFACTS_DIR%\env\build_branch.env @@ -90,15 +92,10 @@ ECHO "BUILD_DIR: %BUILD_DIR%" ECHO "INSTALL_DIR: %INSTALL_DIR%" ECHO "PACKAGE_TYPE: %PACKAGE_TYPE%" -:: For MSI -SET SIGN="buildscripts\ci\windows\sign.bat" -SET UUIDGEN="C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64\uuidgen.exe" -SET WIX_DIR=%WIX% - -IF %PACKAGE_TYPE% == "portable" ( GOTO PACK_PORTABLE) ELSE ( -IF %PACKAGE_TYPE% == "7z" ( GOTO PACK_7z ) ELSE ( -IF %PACKAGE_TYPE% == "msi" ( GOTO PACK_MSI ) ELSE ( -IF %PACKAGE_TYPE% == "dir" ( GOTO PACK_DIR ) ELSE ( +IF %PACKAGE_TYPE% == "portable" (GOTO PACK_PORTABLE) ELSE ( +IF %PACKAGE_TYPE% == "7z" (GOTO PACK_7z) ELSE ( +IF %PACKAGE_TYPE% == "msi" (GOTO PACK_MSI) ELSE ( +IF %PACKAGE_TYPE% == "dir" (GOTO PACK_DIR) ELSE ( ECHO "Unknown package type: %PACKAGE_TYPE%" GOTO END_ERROR )))) @@ -144,6 +141,7 @@ IF %DO_SIGN% == ON ( ) :: generate unique GUID +SET UUIDGEN="C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64\uuidgen.exe" %UUIDGEN% > uuid.txt SET /p PACKAGE_UUID= Date: Sat, 5 Oct 2024 04:25:55 +0200 Subject: [PATCH 05/18] Bump `cmake_minimum_required` to 3.21.1 To be sure that we're using a new-enough version for all Qt 6.8 features --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 283796d6beeea..3ac34e4d4d85b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,9 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.21.1) # Min. required by Qt 6.8 project(MuseScore LANGUAGES C CXX) From 917632d628a2867cdc548c5e60e19f2f9cfdf2cf Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Wed, 15 Dec 2021 02:20:21 +0100 Subject: [PATCH 06/18] Update CI for Qt 6.8 --- .github/workflows/build_backend.yml | 14 +++++- .github/workflows/build_linux.yml | 12 ++++- .github/workflows/build_linux_arm.yml | 8 +-- .github/workflows/build_macos.yml | 12 ++++- .github/workflows/build_windows.yml | 32 ++++++++---- .github/workflows/check_unit_tests.yml | 10 ++++ .github/workflows/check_visual_tests.yml | 26 ++++++++-- .github/workflows/translate_lupdate.yml | 14 ++++-- .github/workflows/translate_tx_pull_to_s3.yml | 13 ++++- buildscripts/ci/linux/local/workflow.sh | 2 +- buildscripts/ci/linux/setup-arm.sh | 26 +++++----- buildscripts/ci/linux/setup.sh | 42 +++------------- buildscripts/ci/linux/tools/make_appimage.sh | 6 +-- buildscripts/ci/macos/setup.sh | 12 ----- buildscripts/ci/translation/qt_install.sh | 49 ------------------- buildscripts/ci/translation/run_lupdate.sh | 27 ---------- buildscripts/ci/windows/build.bat | 4 +- buildscripts/ci/windows/make_environment.sh | 34 ------------- buildscripts/ci/windows/setup.bat | 11 ----- 19 files changed, 141 insertions(+), 213 deletions(-) delete mode 100644 buildscripts/ci/translation/qt_install.sh delete mode 100644 buildscripts/ci/translation/run_lupdate.sh delete mode 100644 buildscripts/ci/windows/make_environment.sh diff --git a/.github/workflows/build_backend.yml b/.github/workflows/build_backend.yml index c25ec56822654..cecc9eee60906 100644 --- a/.github/workflows/build_backend.yml +++ b/.github/workflows/build_backend.yml @@ -48,9 +48,9 @@ jobs: BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env) DO_PUBLISH='false' - if [ "${{ inputs.publish }}" = "on" ]; then + if [ "${{ inputs.publish }}" = "on" ]; then DO_PUBLISH='true'; - if [ -z "${{ secrets.S3_KEY_CONVERTER }}" ]; then + if [ -z "${{ secrets.S3_KEY_CONVERTER }}" ]; then echo "::warning::S3_KEY_CONVERTER is empty; publishing to S3 disabled" DO_PUBLISH='false' fi @@ -74,6 +74,16 @@ jobs: echo "VERSION_MAJOR_MINOR=$VERSION_MAJOR_MINOR" | tee -a $GITHUB_ENV echo "GITHUB_ARTIFACT_NAME=$GITHUB_ARTIFACT_NAME" | tee -a $GITHUB_ENV + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' + - name: Setup environment run: | bash ./buildscripts/ci/backend/setup.sh diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 26665fe97de48..6d62a5c395b46 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -133,15 +133,25 @@ jobs: sudo apt-get update && sudo apt-get install -y ccache bash ./buildscripts/ci/tools/setup_ccache_config.sh + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | bash ./buildscripts/ci/linux/setup.sh + - name: Generate _en.ts files env: LUPDATE_ARGS: "" POSTPROCESS_ARGS: ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }} run: | - bash ./buildscripts/ci/translation/run_lupdate.sh + bash ./tools/translations/run_lupdate.sh - name: Update .ts files if: env.DO_UPDATE_TS == 'true' run: | diff --git a/.github/workflows/build_linux_arm.yml b/.github/workflows/build_linux_arm.yml index 9b79c22ac98c0..070729b4b6974 100644 --- a/.github/workflows/build_linux_arm.yml +++ b/.github/workflows/build_linux_arm.yml @@ -140,7 +140,7 @@ jobs: # LUPDATE_ARGS: "" # POSTPROCESS_ARGS: ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }} # run: | - # bash ./buildscripts/ci/translation/run_lupdate.sh + # bash ./tools/translations/run_lupdate.sh - name: Update .ts files if: env.DO_UPDATE_TS == 'true' run: | @@ -160,7 +160,7 @@ jobs: cd /MuseScore && \ export QT_SELECT=qt6 && \ bash /MuseScore/buildscripts/ci/linux/setup-arm.sh --arch armv7l && \ - bash /MuseScore/buildscripts/ci/translation/run_lupdate.sh && \ + bash /MuseScore/tools/translations/run_lupdate.sh && \ bash /MuseScore/buildscripts/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --crash_log_url $C_URL --arch armv7l && \ bash /MuseScore/buildscripts/ci/linux/package.sh --arch armv7l && \ bash /MuseScore/buildscripts/ci/tools/checksum.sh \ @@ -269,7 +269,7 @@ jobs: # LUPDATE_ARGS: "" # POSTPROCESS_ARGS: ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }} # run: | - # bash ./buildscripts/ci/translation/run_lupdate.sh + # bash ./tools/translations/run_lupdate.sh - name: Update .ts files if: env.DO_UPDATE_TS == 'true' run: | @@ -289,7 +289,7 @@ jobs: cd /MuseScore && \ export QT_SELECT=qt6 && \ bash /MuseScore/buildscripts/ci/linux/setup-arm.sh --arch aarch64 && \ - bash /MuseScore/buildscripts/ci/translation/run_lupdate.sh && \ + bash /MuseScore/tools/translations/run_lupdate.sh && \ bash /MuseScore/buildscripts/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --crash_log_url $C_URL --arch aarch64 && \ bash /MuseScore/buildscripts/ci/linux/package.sh --arch aarch64 && \ bash /MuseScore/buildscripts/ci/tools/checksum.sh \ diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index fdba9fed11a83..f3eeb25f7d406 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -151,15 +151,25 @@ jobs: brew install ccache bash ./buildscripts/ci/tools/setup_ccache_config.sh + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'mac' + target: 'desktop' + arch: 'clang_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | bash ./buildscripts/ci/macos/setup.sh + - name: Generate _en.ts files env: LUPDATE_ARGS: "" POSTPROCESS_ARGS: "--warn-only ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }}" run: | - bash ./buildscripts/ci/translation/run_lupdate.sh + bash ./tools/translations/run_lupdate.sh - name: Update .ts files if: env.DO_UPDATE_TS == 'true' run: | diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index f730ff9a19626..1a2ade2ae9037 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -132,13 +132,19 @@ jobs: echo "DO_PUBLISH=$DO_PUBLISH" | tee -a $GITHUB_ENV echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'windows' + target: 'desktop' + arch: 'win64_msvc2022_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | buildscripts\ci\windows\setup.bat - - name: Make environment file - shell: bash - run: | - bash ./buildscripts/ci/windows/make_environment.sh + - name: Generate _en.ts files shell: bash env: @@ -146,7 +152,7 @@ jobs: POSTPROCESS_ARGS: "--warn-only ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }}" POSTPROCESS_LAUNCHER: "python3 -X utf8" run: | - bash ./buildscripts/ci/translation/run_lupdate.sh + bash ./tools/translations/run_lupdate.sh - name: Update .ts files if: env.DO_UPDATE_TS == 'true' shell: bash @@ -253,13 +259,19 @@ jobs: echo "DO_PUBLISH=$DO_PUBLISH" | tee -a $GITHUB_ENV echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'windows' + target: 'desktop' + arch: 'win64_msvc2022_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | buildscripts\ci\windows\setup.bat --portable ON - - name: Make environment file - shell: bash - run: | - bash ./buildscripts/ci/windows/make_environment.sh + - name: Generate _en.ts files shell: bash env: @@ -267,7 +279,7 @@ jobs: POSTPROCESS_ARGS: "--warn-only ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }}" POSTPROCESS_LAUNCHER: "python3 -X utf8" run: | - bash ./buildscripts/ci/translation/run_lupdate.sh + bash ./tools/translations/run_lupdate.sh - name: Update .ts files if: env.DO_UPDATE_TS == 'true' shell: bash diff --git a/.github/workflows/check_unit_tests.yml b/.github/workflows/check_unit_tests.yml index ae47efd07bb1e..6eb2553c46a13 100644 --- a/.github/workflows/check_unit_tests.yml +++ b/.github/workflows/check_unit_tests.yml @@ -34,9 +34,19 @@ jobs: sudo apt-get update && sudo apt-get install -y ccache bash ./buildscripts/ci/tools/setup_ccache_config.sh + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | bash ./buildscripts/ci/linux/setup.sh + - name: Build run: | mkdir -p build.artifacts/env diff --git a/.github/workflows/check_visual_tests.yml b/.github/workflows/check_visual_tests.yml index 6ad60baaa27f8..85953a9167184 100644 --- a/.github/workflows/check_visual_tests.yml +++ b/.github/workflows/check_visual_tests.yml @@ -41,9 +41,9 @@ jobs: if: github.event_name == 'push' run: | REFERENCE_SHA=${{ github.event.before }} - if [[ -z "$REFERENCE_SHA" || "$REFERENCE_SHA" == 0000000000000000000000000000000000000000 ]]; then - DO_RUN='false' - else + if [[ -z "$REFERENCE_SHA" || "$REFERENCE_SHA" == 0000000000000000000000000000000000000000 ]]; then + DO_RUN='false' + else DO_RUN='true' fi echo "REFERENCE_SHA=$REFERENCE_SHA" >> $GITHUB_ENV @@ -79,9 +79,19 @@ jobs: sudo apt-get update && sudo apt-get install -y ccache bash ./buildscripts/ci/tools/setup_ccache_config.sh + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | bash ./buildscripts/ci/linux/setup.sh + - name: Build and Pack run: | bash ./buildscripts/ci/vtests/build_and_pack.sh @@ -117,9 +127,19 @@ jobs: sudo apt-get update && sudo apt-get install -y ccache bash ./buildscripts/ci/tools/setup_ccache_config.sh + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + modules: 'qt5compat qtnetworkauth qtscxml qtshadertools qtwebsockets' - name: Setup environment run: | bash ./buildscripts/ci/linux/setup.sh + - name: Build and Pack run: | bash ./buildscripts/ci/vtests/build_and_pack.sh diff --git a/.github/workflows/translate_lupdate.yml b/.github/workflows/translate_lupdate.yml index 0ea5a890806df..526990d388697 100644 --- a/.github/workflows/translate_lupdate.yml +++ b/.github/workflows/translate_lupdate.yml @@ -28,13 +28,19 @@ jobs: echo "LUPDATE_ARGS=$LUPDATE_ARGS" | tee -a $GITHUB_ENV - - name: Setup environment - run: | - bash ./buildscripts/ci/translation/qt_install.sh + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + archives: 'qttools' - name: Run lupdate run: | - bash ./buildscripts/ci/translation/run_lupdate.sh + bash ./tools/translations/run_lupdate.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v7 diff --git a/.github/workflows/translate_tx_pull_to_s3.yml b/.github/workflows/translate_tx_pull_to_s3.yml index e72d06d6e2e0d..acfb6f57e2b81 100644 --- a/.github/workflows/translate_tx_pull_to_s3.yml +++ b/.github/workflows/translate_tx_pull_to_s3.yml @@ -72,11 +72,20 @@ jobs: run: | bash ./buildscripts/ci/translation/tx_install.sh -t ${{ secrets.TRANSIFEX_API_TOKEN }} -s linux + - name: Install Qt for lrelease + if: env.DO_PUSH_TO_S3 == 'true' + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + archives: 'qttools' + - name: Setup environment for pushing to S3 if: env.DO_PUSH_TO_S3 == 'true' run: | - # lrelease - bash ./buildscripts/ci/translation/qt_install.sh bash ./buildscripts/ci/tools/s3_install.sh --s3_key ${{ secrets.S3_KEY }} --s3_secret ${{ secrets.S3_SECRET }} bash ./buildscripts/ci/tools/make_build_number.sh diff --git a/buildscripts/ci/linux/local/workflow.sh b/buildscripts/ci/linux/local/workflow.sh index b87ffdf6263e3..4e9d2114a2b2d 100755 --- a/buildscripts/ci/linux/local/workflow.sh +++ b/buildscripts/ci/linux/local/workflow.sh @@ -37,7 +37,7 @@ fi # - name: Generate _en.ts files # run: | - bash ./buildscripts/ci/translation/run_lupdate.sh + bash ./tools/translations/run_lupdate.sh # - name: Update .ts files # if: env.DO_UPDATE_TS == 'true' diff --git a/buildscripts/ci/linux/setup-arm.sh b/buildscripts/ci/linux/setup-arm.sh index 052a67904ac26..cc4c0408a4041 100755 --- a/buildscripts/ci/linux/setup-arm.sh +++ b/buildscripts/ci/linux/setup-arm.sh @@ -72,7 +72,8 @@ apt_packages=( wget xxd p7zip-full - libasound2-dev + libasound2-dev + libcups2-dev libfontconfig1-dev libfreetype6-dev libfreetype6 @@ -101,7 +102,6 @@ apt_packages=( # MuseScore compiles without these but won't run without them apt_packages_runtime=( - libcups2 libdbus-1-3 libegl1-mesa-dev libgles2-mesa-dev @@ -128,8 +128,8 @@ apt_packages_runtime=( apt_packages_ffmpeg=( ffmpeg - libavcodec-dev - libavformat-dev + libavcodec-dev + libavformat-dev libswscale-dev ) @@ -146,6 +146,7 @@ git config --global --add safe.directory /MuseScore # GET QT ########################################################################## +# TODO: Update to Qt 6.8 apt_packages_qt6=( qt6-base-dev qt6-declarative-dev @@ -194,6 +195,15 @@ fi # https://askubuntu.com/questions/1460242/ubuntu-22-04-with-qt6-qmake-could-not-find-a-qt-installation-of qtchooser -install qt6 $(which qmake6) +echo export QT_ROOT_DIR="${qt_dir}" >> ${ENV_FILE} +echo export QT_PLUGIN_PATH="${qt_dir}/plugins" >> ${ENV_FILE} +echo export QML2_IMPORT_PATH="${qt_dir}/qml" >> ${ENV_FILE} + +echo export CFLAGS="-Wno-psabi" >> ${ENV_FILE} +echo export CXXFLAGS="-Wno-psabi" >> ${ENV_FILE} +# explicitly set QMAKE path for linuxdeploy-plugin-qt +echo export QMAKE="/usr/bin/qmake6" >> ${ENV_FILE} + ########################################################################## # GET TOOLS ########################################################################## @@ -218,14 +228,6 @@ apt-get install -y --no-install-recommends ninja-build echo "ninja version" ninja --version -echo export QT_PATH="${qt_dir}" >> ${ENV_FILE} -echo export QT_PLUGIN_PATH="${qt_dir}/plugins" >> ${ENV_FILE} -echo export QML2_IMPORT_PATH="${qt_dir}/qml" >> ${ENV_FILE} -echo export CFLAGS="-Wno-psabi" >> ${ENV_FILE} -echo export CXXFLAGS="-Wno-psabi" >> ${ENV_FILE} -# explicitly set QMAKE path for linuxdeploy-plugin-qt -echo export QMAKE="/usr/bin/qmake6" >> ${ENV_FILE} - ########################################################################## # POST INSTALL ########################################################################## diff --git a/buildscripts/ci/linux/setup.sh b/buildscripts/ci/linux/setup.sh index da0ea3daba315..d1b2ea19de56d 100644 --- a/buildscripts/ci/linux/setup.sh +++ b/buildscripts/ci/linux/setup.sh @@ -52,25 +52,23 @@ echo "echo 'Setup MuseScore build environment'" >> $ENV_FILE # DISTRIBUTION PACKAGES -# These are installed by default on Travis CI, but not on Docker apt_packages_basic=( # Alphabetical order please! desktop-file-utils file git + p7zip-full software-properties-common # installs `add-apt-repository` unzip - p7zip-full ) -# These are the same as on Travis CI apt_packages_standard=( # Alphabetical order please! curl - libasound2-dev + libasound2-dev + libcups2-dev libfontconfig1-dev libfreetype6-dev - libfreetype6 libgl1-mesa-dev libjack-dev libnss3-dev @@ -84,7 +82,6 @@ apt_packages_standard=( # MuseScore compiles without these but won't run without them apt_packages_runtime=( # Alphabetical order please! - libcups2 libdbus-1-3 libegl1-mesa-dev libodbc1 @@ -111,41 +108,18 @@ apt_packages_runtime=( apt_packages_ffmpeg=( ffmpeg - libavcodec-dev - libavformat-dev + libavcodec-dev + libavformat-dev libswscale-dev ) -sudo apt-get update +sudo apt-get update sudo apt-get install -y --no-install-recommends \ "${apt_packages_basic[@]}" \ "${apt_packages_standard[@]}" \ "${apt_packages_runtime[@]}" \ "${apt_packages_ffmpeg[@]}" -########################################################################## -# GET QT -########################################################################## - -# Get newer Qt (only used cached version if it is the same) -qt_version="624" -qt_revision="r2" # added websocket module -qt_dir="$BUILD_TOOLS/Qt/${qt_version}" -if [[ ! -d "${qt_dir}" ]]; then - mkdir -p "${qt_dir}" - qt_url="https://s3.amazonaws.com/utils.musescore.org/Qt${qt_version}_gcc64_${qt_revision}.7z" - wget -q --show-progress -O qt.7z "${qt_url}" - 7z x -y qt.7z -o"${qt_dir}" - rm qt.7z -fi - -echo export PATH="${qt_dir}/bin:\${PATH}" >> ${ENV_FILE} -echo export LD_LIBRARY_PATH="${qt_dir}/lib:\${LD_LIBRARY_PATH}" >> ${ENV_FILE} -echo export QT_PATH="${qt_dir}" >> ${ENV_FILE} -echo export QT_PLUGIN_PATH="${qt_dir}/plugins" >> ${ENV_FILE} -echo export QML2_IMPORT_PATH="${qt_dir}/qml" >> ${ENV_FILE} - - ########################################################################## # GET TOOLS ########################################################################## @@ -174,7 +148,7 @@ elif [ "$COMPILER" == "clang" ]; then clang --version clang++ --version -else +else echo "Unknown compiler: $COMPILER" fi @@ -184,7 +158,7 @@ cmake_version="3.24.0" cmake_dir="$BUILD_TOOLS/cmake/${cmake_version}" if [[ ! -d "$cmake_dir" ]]; then mkdir -p "$cmake_dir" - cmake_url="https://cmake.org/files/v${cmake_version%.*}/cmake-${cmake_version}-linux-x86_64.tar.gz" + cmake_url="https://cmake.org/files/v${cmake_version%.*}/cmake-${cmake_version}-linux-x86_64.tar.gz" wget -q --show-progress --no-check-certificate -O - "${cmake_url}" | tar --strip-components=1 -xz -C "${cmake_dir}" fi echo export PATH="$cmake_dir/bin:\${PATH}" >> ${ENV_FILE} diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index 95eb810f226d3..74e33b3d08538 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -145,8 +145,8 @@ mv "${appdir}/bin/findlib" "${appdir}/../findlib" # Remove Qt plugins for MySQL and PostgreSQL to prevent # linuxdeploy-plugin-qt from failing due to missing dependencies. # SQLite plugin alone should be enough for our AppImage. -# rm -f ${QT_PATH}/plugins/sqldrivers/libqsql{mysql,psql}.so -qt_sql_drivers_path="${QT_PATH}/plugins/sqldrivers" +# rm -f ${QT_ROOT_DIR}/plugins/sqldrivers/libqsql{mysql,psql}.so +qt_sql_drivers_path="${QT_ROOT_DIR}/plugins/sqldrivers" qt_sql_drivers_tmp="/tmp/qtsqldrivers" mkdir -p "$qt_sql_drivers_tmp" [ -f "${qt_sql_drivers_path}/libqsqlmysql.so" ] && mv "${qt_sql_drivers_path}/libqsqlmysql.so" "${qt_sql_drivers_tmp}/libqsqlmysql.so" @@ -276,7 +276,7 @@ for file in "${additional_qt_components[@]}"; do continue fi mkdir -p "${appdir}/$(dirname "${file}")" - cp -Lr "${QT_PATH}/${file}" "${appdir}/${file}" + cp -Lr "${QT_ROOT_DIR}/${file}" "${appdir}/${file}" done for lib in "${additional_libraries[@]}"; do diff --git a/buildscripts/ci/macos/setup.sh b/buildscripts/ci/macos/setup.sh index 78e47a9449552..af2a3173496b4 100644 --- a/buildscripts/ci/macos/setup.sh +++ b/buildscripts/ci/macos/setup.sh @@ -36,18 +36,6 @@ mkdir -p $HOME/musescore_deps_macos tar xf musescore_deps_macos.tar.gz -C $HOME/musescore_deps_macos rm musescore_deps_macos.tar.gz -# Qt -export QT_SHORT_VERSION=6.2.4 -echo "Download Qt $QT_SHORT_VERSION" -export QT_PATH=$HOME/Qt/$QT_SHORT_VERSION/ -export PATH=$PATH:$QT_PATH/macos/bin -echo "PATH=$PATH" >> $GITHUB_ENV -# r2 - added websocket support -wget -nv -O qt.7z https://s3.amazonaws.com/utils.musescore.org/Qt624_mac_r2.7z -mkdir -p $QT_PATH -7z x -y qt.7z -o$QT_PATH -rm qt.7z - # VST SDK echo "Download VST SDK" wget -q --show-progress -O vst_sdk.7z "https://s3.amazonaws.com/utils.musescore.org/VST3_SDK_379.7z" diff --git a/buildscripts/ci/translation/qt_install.sh b/buildscripts/ci/translation/qt_install.sh deleted file mode 100644 index b9a797238f4ec..0000000000000 --- a/buildscripts/ci/translation/qt_install.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-3.0-only -# MuseScore-Studio-CLA-applies -# -# MuseScore Studio -# Music Composition & Notation -# -# Copyright (C) 2021 MuseScore Limited -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -echo "Setup environment for run lupdate" -trap 'echo Setup failed; exit 1' ERR - -BUILD_TOOLS=$HOME/build_tools -mkdir -p $BUILD_TOOLS - -ENV_FILE=$BUILD_TOOLS/environment.sh -rm -f $ENV_FILE - -echo "echo 'Setup environment for run lupdate'" >> ${ENV_FILE} - -########################################################################## -# GET QT -########################################################################## -qt_version="624" -qt_dir="$BUILD_TOOLS/Qt/${qt_version}" -if [[ ! -d "${qt_dir}" ]]; then - mkdir -p "${qt_dir}" - qt_url="https://s3.amazonaws.com/utils.musescore.org/Qt${qt_version}_gcc64.7z" - wget -q --show-progress -O qt.7z "${qt_url}" - 7z x -y qt.7z -o"${qt_dir}" - rm qt.7z -fi - -echo export PATH="${qt_dir}/bin:\${PATH}" >> ${ENV_FILE} - -chmod +x "${ENV_FILE}" - -echo "Setup script done" diff --git a/buildscripts/ci/translation/run_lupdate.sh b/buildscripts/ci/translation/run_lupdate.sh deleted file mode 100644 index c16e02ccac530..0000000000000 --- a/buildscripts/ci/translation/run_lupdate.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-3.0-only -# MuseScore-Studio-CLA-applies -# -# MuseScore Studio -# Music Composition & Notation -# -# Copyright (C) 2021 MuseScore Limited -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -BUILD_TOOLS=$HOME/build_tools -ENV_FILE=$BUILD_TOOLS/environment.sh - -source $ENV_FILE - -bash ./tools/translations/run_lupdate.sh $@ diff --git a/buildscripts/ci/windows/build.bat b/buildscripts/ci/windows/build.bat index 9f660de8683e6..2b444e5af6e82 100644 --- a/buildscripts/ci/windows/build.bat +++ b/buildscripts/ci/windows/build.bat @@ -43,10 +43,8 @@ ECHO "BUILD_WIN_PORTABLE: %BUILD_WIN_PORTABLE%" XCOPY "C:\musescore_dependencies" %CD% /E /I /Y ECHO "Finished copy dependencies" - -SET "QT_DIR=C:\Qt\6.2.4" -SET "PATH=%QT_DIR%\msvc2019_64\bin;%JACK_DIR%;%PATH%" SET "JACK_DIR=C:\Program Files (x86)\Jack" +SET "PATH=%JACK_DIR%;%PATH%" :: At the moment not compiling yet. SET BUILD_VST=ON diff --git a/buildscripts/ci/windows/make_environment.sh b/buildscripts/ci/windows/make_environment.sh deleted file mode 100644 index ec4f9b6d30f16..0000000000000 --- a/buildscripts/ci/windows/make_environment.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: GPL-3.0-only -# MuseScore-Studio-CLA-applies -# -# MuseScore Studio -# Music Composition & Notation -# -# Copyright (C) 2021 MuseScore Limited -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -BUILD_TOOLS=$HOME/build_tools -ENV_FILE=$BUILD_TOOLS/environment.sh - -mkdir -p $BUILD_TOOLS -rm -f $ENV_FILE - -QT_DIR="/c/Qt/6.2.4" - -echo export PATH="${QT_DIR}/msvc2019_64/bin:\${PATH}" >> ${ENV_FILE} - -chmod +x "$ENV_FILE" - -cat $ENV_FILE diff --git a/buildscripts/ci/windows/setup.bat b/buildscripts/ci/windows/setup.bat index 8fa95e763d6d9..e0d9212c91628 100644 --- a/buildscripts/ci/windows/setup.bat +++ b/buildscripts/ci/windows/setup.bat @@ -36,17 +36,6 @@ IF ERRORLEVEL 1 ( choco install -y 7zip.install ) SET TEMP_DIR="c:\TEMP\musescore" MKDIR %TEMP_DIR% -:: Install Qt -ECHO "=== Install Qt ===" - -:: r2 - added websocket module -SET "Qt_ARCHIVE=Qt624_msvc2019_64_r2.7z" -SET "QT_DIR=C:\Qt\6.2.4" -SET "QT_URL=https://s3.amazonaws.com/utils.musescore.org/%Qt_ARCHIVE%" - -CALL "wget.exe" -q --show-progress --no-check-certificate "%QT_URL%" -O "%TEMP_DIR%\%Qt_ARCHIVE%" -CALL "7z" x -y "%TEMP_DIR%\%Qt_ARCHIVE%" "-o%QT_DIR%" - :: Install dependencies ECHO "=== Install dependencies ===" CALL "wget.exe" -q --show-progress --no-check-certificate "https://s3.amazonaws.com/utils.musescore.org/musescore_dependencies_win32.7z" -O %TEMP_DIR%\musescore_dependencies_win32.7z From 73791605f7ca2bacd83ddde3047d83cce898c293 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 3 Oct 2024 03:46:07 +0200 Subject: [PATCH 07/18] Update unit tests --- .../tests/data/testSystemDividers.xml | 518 +++++++++--------- 1 file changed, 259 insertions(+), 259 deletions(-) diff --git a/src/importexport/musicxml/tests/data/testSystemDividers.xml b/src/importexport/musicxml/tests/data/testSystemDividers.xml index cdc9fb61ba1e5..c2e92ea4ed59c 100644 --- a/src/importexport/musicxml/tests/data/testSystemDividers.xml +++ b/src/importexport/musicxml/tests/data/testSystemDividers.xml @@ -136,11 +136,11 @@ - + - 126.97 + 126.16 0 170 @@ -160,242 +160,242 @@ 2 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + - 68.1 + 68.5 0 143.84 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + - 68.1 + 68.5 0 143.84 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 @@ -406,7 +406,7 @@ - + 57.53 @@ -426,234 +426,234 @@ 2 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + 57.53 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + 57.53 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 @@ -664,7 +664,7 @@ - + 57.53 @@ -684,234 +684,234 @@ 3 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + 57.53 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + 57.53 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 @@ -922,7 +922,7 @@ - + 57.53 @@ -942,234 +942,234 @@ 4 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + 57.53 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - + 57.53 - + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 - - + + 4 1 From 4d1830eb58da1a61735e4d48300358194babda3f Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 28 Apr 2022 00:06:35 +0200 Subject: [PATCH 08/18] Clean up how we link to Qt --- CMakeLists.txt | 1 - buildscripts/cmake/DeclareModuleSetup.cmake | 10 +- buildscripts/cmake/QtInstallPaths.cmake | 56 +++++++++ buildscripts/cmake/SetupQt6.cmake | 122 +++++++++----------- sandbox/cpad/CMakeLists.txt | 7 +- sandbox/engraving/CMakeLists.txt | 19 +-- src/app/CMakeLists.txt | 59 ---------- src/appshell/CMakeLists.txt | 4 + src/braille/CMakeLists.txt | 4 + src/converter/CMakeLists.txt | 4 + src/engraving/CMakeLists.txt | 5 +- src/framework/accessibility/CMakeLists.txt | 4 + src/framework/actions/CMakeLists.txt | 4 + src/framework/autobot/CMakeLists.txt | 2 + src/framework/cloud/CMakeLists.txt | 2 + src/framework/diagnostics/CMakeLists.txt | 4 + src/framework/draw/CMakeLists.txt | 4 + src/framework/extensions/CMakeLists.txt | 4 + src/framework/global/CMakeLists.txt | 20 +++- src/framework/languages/CMakeLists.txt | 5 +- src/framework/learn/CMakeLists.txt | 5 +- src/framework/midi/CMakeLists.txt | 4 + src/framework/mpe/CMakeLists.txt | 4 + src/framework/multiinstances/CMakeLists.txt | 4 + src/framework/network/CMakeLists.txt | 6 +- src/framework/shortcuts/CMakeLists.txt | 2 + src/framework/ui/CMakeLists.txt | 8 ++ src/framework/ui/tests/CMakeLists.txt | 1 + src/framework/uicomponents/CMakeLists.txt | 6 +- src/framework/update/CMakeLists.txt | 4 + src/framework/update/tests/CMakeLists.txt | 1 + src/framework/vst/CMakeLists.txt | 4 + src/framework/workspace/CMakeLists.txt | 4 + src/importexport/midi/CMakeLists.txt | 4 + src/importexport/ove/CMakeLists.txt | 4 + src/inspector/CMakeLists.txt | 1 + src/instrumentsscene/CMakeLists.txt | 1 + src/musesounds/CMakeLists.txt | 2 + src/notation/CMakeLists.txt | 3 + src/palette/CMakeLists.txt | 3 + src/playback/CMakeLists.txt | 8 +- src/print/CMakeLists.txt | 4 + src/project/CMakeLists.txt | 2 + src/workspacescene/CMakeLists.txt | 4 + 44 files changed, 259 insertions(+), 170 deletions(-) create mode 100644 buildscripts/cmake/QtInstallPaths.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ac34e4d4d85b..082db48929250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,7 +151,6 @@ if (MUE_COMPILE_MACOS_PRECOMPILED_DEPS_PATH) set(MUE_COMPILE_USE_SYSTEM_OPUS ON) endif() -set(QT_MIN_VERSION "6.2.4") set(QT_ADD_STATEMACHINE ON) if (MUSE_MODULE_NETWORK_WEBSOCKET) set(QT_ADD_WEBSOCKET ON) diff --git a/buildscripts/cmake/DeclareModuleSetup.cmake b/buildscripts/cmake/DeclareModuleSetup.cmake index f95b365f6ea83..fbfecfca8d32e 100644 --- a/buildscripts/cmake/DeclareModuleSetup.cmake +++ b/buildscripts/cmake/DeclareModuleSetup.cmake @@ -30,6 +30,7 @@ # set(MODULE_DEF ...) - set definitions # set(MODULE_SRC ...) - set sources and headers files # set(MODULE_LINK ...) - set libraries for link +# set(MODULE_LINK_PUBLIC ...) - set libraries for link and transitive link # set(MODULE_LINK_GLOBAL ON/OFF) - set whether to link with `global` module (default ON) # set(MODULE_QRC somename.qrc) - set resource (qrc) file # set(MODULE_BIG_QRC somename.qrc) - set big resource (qrc) file @@ -53,6 +54,7 @@ macro(declare_module name) unset(MODULE_DEF) unset(MODULE_SRC) unset(MODULE_LINK) + unset(MODULE_LINK_PUBLIC) set(MODULE_LINK_GLOBAL ON) unset(MODULE_QRC) unset(MODULE_BIG_QRC) @@ -78,7 +80,6 @@ endmacro() macro(setup_module) - if (MODULE_IS_STUB) message(STATUS "Configuring ${MODULE} <${MODULE_ALIAS}> [stub]") else() @@ -183,8 +184,7 @@ macro(setup_module) set(MODULE_LINK muse_global ${MODULE_LINK}) endif() - set(MODULE_LINK ${CMAKE_DL_LIBS} ${QT_LIBRARIES} ${MODULE_LINK}) - - target_link_libraries(${MODULE} PRIVATE ${MODULE_LINK} ) - + target_link_libraries(${MODULE} + PRIVATE ${MODULE_LINK} + PUBLIC ${MODULE_LINK_PUBLIC}) endmacro() diff --git a/buildscripts/cmake/QtInstallPaths.cmake b/buildscripts/cmake/QtInstallPaths.cmake new file mode 100644 index 0000000000000..0c91281d764cf --- /dev/null +++ b/buildscripts/cmake/QtInstallPaths.cmake @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: GPL-3.0-only +# MuseScore-Studio-CLA-applies +# +# MuseScore Studio +# Music Composition & Notation +# +# Copyright (C) 2024 MuseScore Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Adapted from KDQtInstallPaths.cmake, from the KDAB CMake modules + +if(TARGET Qt::qmake) + get_target_property(QT_QMAKE_EXECUTABLE Qt${Qt_VERSION_MAJOR}::qmake LOCATION) +else() + message(FATAL_ERROR "No supported Qt version found. Make sure you find Qt before calling this") +endif() + +execute_process( + COMMAND ${QT_QMAKE_EXECUTABLE} -query + RESULT_VARIABLE return_code + OUTPUT_VARIABLE ALL_VARS +) +if(NOT return_code EQUAL 0) + message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query") + message(FATAL_ERROR "QMake call failed: ${return_code}") +endif() + +string(REPLACE "\n" ";" VARS_LIST ${ALL_VARS}) +foreach(QVAL ${VARS_LIST}) + if(QVAL MATCHES "QT_INSTALL_") + string(REPLACE ":" ";" QVAL_LIST ${QVAL}) + list(LENGTH QVAL_LIST listlen) + list(GET QVAL_LIST 0 var) + if(WIN32 AND ${listlen} GREATER 2) + list(GET QVAL_LIST 2 path) + list(GET QVAL_LIST 1 drive) + set(path "${drive}:${path}") + else() + list(GET QVAL_LIST 1 path) + endif() + if(NOT ${var}) #if set already on the command line for example + set(${var} ${path} CACHE PATH "Qt install path for ${var}") + endif() + endif() +endforeach() diff --git a/buildscripts/cmake/SetupQt6.cmake b/buildscripts/cmake/SetupQt6.cmake index ba2b58d2bbb3c..2331cce2066de 100644 --- a/buildscripts/cmake/SetupQt6.cmake +++ b/buildscripts/cmake/SetupQt6.cmake @@ -1,14 +1,24 @@ +# SPDX-License-Identifier: GPL-3.0-only +# MuseScore-Studio-CLA-applies +# +# MuseScore Studio +# Music Composition & Notation +# +# Copyright (C) 2024 MuseScore Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . -include(GetUtilsFunctions) # library of CMake functions ("fn__" namespace) - -# Print Qt version or fail the build if Qt (qmake) is not in PATH. -fn__require_program(QMAKE Qt --version "https://musescore.org/en/handbook/developers-handbook/compilation" qmake6 qmake) - -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) - -set(_components +set(qt_components Core Gui Widgets @@ -17,82 +27,56 @@ set(_components Qml Quick QuickControls2 - QuickTemplates2 QuickWidgets Xml Svg PrintSupport - OpenGL LinguistTools Core5Compat ) -if (NOT OS_IS_WASM) - set(_components - ${_components} - Concurrent - ) +set(QT_LIBRARIES + Qt::Core + Qt::Gui + Qt::Widgets + Qt::Network + Qt::NetworkAuth + Qt::Qml + Qt::Quick + Qt::QuickControls2 + Qt::QuickWidgets + Qt::Xml + Qt::Svg + Qt::PrintSupport + + Qt::Core5Compat +) + +if(NOT OS_IS_WASM) + list(APPEND qt_components Concurrent) + list(APPEND QT_LIBRARIES Qt::Concurrent) endif() -if (OS_IS_LIN) - set(_components - ${_components} - DBus - ) +if(OS_IS_LIN) + list(APPEND qt_components DBus) + list(APPEND QT_LIBRARIES Qt::DBus) endif() if (QT_ADD_STATEMACHINE) - set(_components ${_components} - # Note: only used in ExampleView class. - # When that class is removed, don't forget to remove this dependency. - StateMachine - ) + # Note: only used in ExampleView class. + # When that class is removed, don't forget to remove this dependency. + list(APPEND qt_components StateMachine) + list(APPEND QT_LIBRARIES Qt::StateMachine) endif() -if (QT_ADD_WEBSOCKET) - set(_components ${_components} - WebSockets - ) +if(QT_ADD_WEBSOCKET) + list(APPEND qt_components WebSockets) + list(APPEND QT_LIBRARIES Qt::WebSockets) endif() -foreach(_component ${_components}) - find_package(Qt6${_component} REQUIRED) - list(APPEND QT_LIBRARIES ${Qt6${_component}_LIBRARIES}) - list(APPEND QT_INCLUDES ${Qt6${_component}_INCLUDE_DIRS}) - add_definitions(${Qt6${_component}_DEFINITIONS}) -endforeach() - -include_directories(${QT_INCLUDES}) - -find_program(QT_QMAKE_EXECUTABLE qmake) -set(_qmake_vars - QT_INSTALL_ARCHDATA - QT_INSTALL_BINS - QT_INSTALL_CONFIGURATION - QT_INSTALL_DATA - QT_INSTALL_DOCS - QT_INSTALL_EXAMPLES - QT_INSTALL_HEADERS - QT_INSTALL_IMPORTS - QT_INSTALL_LIBEXECS - QT_INSTALL_LIBS - QT_INSTALL_PLUGINS - QT_INSTALL_PREFIX - QT_INSTALL_QML - QT_INSTALL_TESTS - QT_INSTALL_TRANSLATIONS -) -foreach(_var ${_qmake_vars}) - execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} "-query" ${_var} - RESULT_VARIABLE _return_val - OUTPUT_VARIABLE _out - OUTPUT_STRIP_TRAILING_WHITESPACE - ) +find_package(Qt6 6.3 REQUIRED COMPONENTS ${qt_components}) - if(_return_val EQUAL 0) - set(${_var} "${_out}") - endif(_return_val EQUAL 0) -endforeach(_var) +include(QtInstallPaths) -#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) +qt_standard_project_setup() diff --git a/sandbox/cpad/CMakeLists.txt b/sandbox/cpad/CMakeLists.txt index 4adb53f441c91..6f5e03b598a47 100644 --- a/sandbox/cpad/CMakeLists.txt +++ b/sandbox/cpad/CMakeLists.txt @@ -25,12 +25,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_FLAGS "-g") -set(QT_MIN_VERSION "6.2.4") -find_package(Qt6Core ${QT_MIN_VERSION} REQUIRED) - -include_directories( - ${Qt6Core_INCLUDE_DIRS} -) +find_package(Qt6Core 6.3 REQUIRED) add_executable(app main.cpp diff --git a/sandbox/engraving/CMakeLists.txt b/sandbox/engraving/CMakeLists.txt index a244715e7baf9..151aae05eb335 100644 --- a/sandbox/engraving/CMakeLists.txt +++ b/sandbox/engraving/CMakeLists.txt @@ -22,23 +22,9 @@ set(CMAKE_MODULE_PATH include(SetupBuildEnvironment) include(GetPlatformInfo) -set(QT_MIN_VERSION "6.2.4") -find_package(Qt6Core ${QT_MIN_VERSION} REQUIRED) -find_package(Qt6Gui ${QT_MIN_VERSION} REQUIRED) -# find_package(Qt6Svg ${QT_MIN_VERSION} REQUIRED) -# find_package(Qt6Widgets ${QT_MIN_VERSION} REQUIRED) -set(QT_LIBRARIES - Qt6::Core - Qt6::Gui - # Qt6::Svg - # Qt6::Widgets -) +find_package(Qt6 6.3 REQUIRED COMPONENTS Core Gui) include_directories( - ${Qt6Core_INCLUDE_DIRS} - ${Qt6Gui_INCLUDE_DIRS} - # ${Qt6Svg_INCLUDE_DIRS} - # ${Qt6Widgets_INCLUDE_DIRS} ${CMAKE_CURRENT_LIST_DIR} ${MU_ROOT}/thirdparty/dtl ) @@ -80,7 +66,8 @@ target_include_directories(engraving_app PUBLIC ) target_link_libraries(engraving_app - ${QT_LIBRARIES} global engraving + Qt6::Core + Qt6::Gui ) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 2341a879d7397..a0525d0986164 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -335,65 +335,6 @@ if (OS_IS_WIN) endif(CC_IS_MINGW) - # Install Qt - foreach (QtLibrary ${QT_LIBRARIES}) - #message(STATUS "Library ${QtLibrary}") - # always use release libs - # TODO: remove this - # That's not trivial, because for the libraries that are installed manually - # below, we would need to manually specify the correct debug/release names. - # The real solution would be to use windeployqt. - set_target_properties(${QtLibrary} PROPERTIES MAP_IMPORTED_CONFIG_DEBUG "RELEASE") - get_target_property(QtSharedLibrary ${QtLibrary} LOCATION_RELEASE) - if (EXISTS ${QtSharedLibrary}) - list (APPEND QtInstallLibraries ${QtSharedLibrary}) - endif (EXISTS ${QtSharedLibrary}) - endforeach (QtLibrary ${QT_LIBRARIES}) - list(REMOVE_DUPLICATES QtInstallLibraries) - - install(FILES - ${QtInstallLibraries} - #${QT_INSTALL_BINS}/libEGL.dll - #${QT_INSTALL_BINS}/libGLESv2.dll - ${QT_INSTALL_BINS}/opengl32sw.dll - ${QT_INSTALL_BINS}/d3dcompiler_47.dll - ${QT_INSTALL_BINS}/Qt6QuickControls2Impl.dll - ${QT_INSTALL_BINS}/Qt6QuickLayouts.dll - ${QT_INSTALL_BINS}/Qt6QmlModels.dll - ${QT_INSTALL_BINS}/Qt6QmlWorkerScript.dll - DESTINATION bin) - - install(FILES - ${QT_INSTALL_PLUGINS}/iconengines/qsvgicon.dll - DESTINATION bin/iconengines) - - install(FILES - ${QT_INSTALL_PLUGINS}/imageformats/qjpeg.dll - ${QT_INSTALL_PLUGINS}/imageformats/qsvg.dll - DESTINATION bin/imageformats) - - install(FILES - ${QT_INSTALL_PLUGINS}/platforms/qwindows.dll - ${QT_INSTALL_PLUGINS}/platforms/qoffscreen.dll - DESTINATION bin/platforms) - - install(FILES - ${QT_INSTALL_PLUGINS}/tls/qcertonlybackend.dll - ${QT_INSTALL_PLUGINS}/tls/qopensslbackend.dll - ${QT_INSTALL_PLUGINS}/tls/qschannelbackend.dll - DESTINATION bin/tls) - - install(DIRECTORY - ${QT_INSTALL_QML} - DESTINATION . - REGEX ".*d\\.dll" EXCLUDE - REGEX ".pdb" EXCLUDE - REGEX ".*QtMultimedia.*" EXCLUDE - REGEX ".*QtSensors.*" EXCLUDE - REGEX ".*QtTest.*" EXCLUDE - REGEX ".*QtWebkit.*" EXCLUDE - ) - if (SNDFILE_DLL) install(FILES ${SNDFILE_DLL} DESTINATION bin) endif() diff --git a/src/appshell/CMakeLists.txt b/src/appshell/CMakeLists.txt index 812b5b740c8c6..c0a717ba2c06a 100644 --- a/src/appshell/CMakeLists.txt +++ b/src/appshell/CMakeLists.txt @@ -148,4 +148,8 @@ if (NOT OS_IS_MAC) set(MODULE_INCLUDE_PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS} ) endif(NOT OS_IS_MAC) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Core5Compat Qt::Quick Qt::Svg Qt::Widgets) +endif() + setup_module() diff --git a/src/braille/CMakeLists.txt b/src/braille/CMakeLists.txt index abe8c213618c5..246add3fdeed3 100644 --- a/src/braille/CMakeLists.txt +++ b/src/braille/CMakeLists.txt @@ -40,6 +40,10 @@ set(MODULE_LINK liblouis ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() if (MUE_BUILD_BRAILLE_TESTS) diff --git a/src/converter/CMakeLists.txt b/src/converter/CMakeLists.txt index 750993ffe637b..91c9956e0c7c5 100644 --- a/src/converter/CMakeLists.txt +++ b/src/converter/CMakeLists.txt @@ -45,5 +45,9 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/internal/compat/notationmeta.h ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() diff --git a/src/engraving/CMakeLists.txt b/src/engraving/CMakeLists.txt index 8ef81aa18a84d..a452312d9448e 100644 --- a/src/engraving/CMakeLists.txt +++ b/src/engraving/CMakeLists.txt @@ -272,7 +272,6 @@ set(MODULE_LINK muse::draw ) - if (MUE_ENABLE_ENGRAVING_RENDER_DEBUG) set(MODULE_DEF ${MODULE_DEF} -DMUE_ENABLE_ENGRAVING_RENDER_DEBUG) endif() @@ -289,6 +288,10 @@ if (MUE_BUILD_ENGRAVING_DEVTOOLS) set(MODULE_DEF ${MODULE_DEF} -DMUE_BUILD_ENGRAVING_DEVTOOLS) endif() +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Quick) +endif() + set(MODULE_ROOT ${CMAKE_CURRENT_LIST_DIR}) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/accessibility/CMakeLists.txt b/src/framework/accessibility/CMakeLists.txt index 4c357a1a8568f..cdb8c08923882 100644 --- a/src/framework/accessibility/CMakeLists.txt +++ b/src/framework/accessibility/CMakeLists.txt @@ -56,6 +56,10 @@ if (MUSE_MODULE_ACCESSIBILITY_TRACE) set(MODULE_DEF ${MODULE_DEF} -DMUSE_MODULE_ACCESSIBILITY_TRACE ) endif() +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Quick) +endif() + setup_module() if (MUSE_MODULE_ACCESSIBILITY_TESTS) diff --git a/src/framework/actions/CMakeLists.txt b/src/framework/actions/CMakeLists.txt index 037a1191348d7..762da9ce96822 100644 --- a/src/framework/actions/CMakeLists.txt +++ b/src/framework/actions/CMakeLists.txt @@ -35,6 +35,10 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/internal/actionsdispatcher.h ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Quick) +endif() + setup_module() if (MUSE_MODULE_ACTIONS_TESTS) diff --git a/src/framework/autobot/CMakeLists.txt b/src/framework/autobot/CMakeLists.txt index 19e2adc96bf4e..b8ebfb7761088 100644 --- a/src/framework/autobot/CMakeLists.txt +++ b/src/framework/autobot/CMakeLists.txt @@ -75,5 +75,7 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/view/testcaserunmodel.h ) +list(APPEND MODULE_LINK Qt::Quick) + setup_module() diff --git a/src/framework/cloud/CMakeLists.txt b/src/framework/cloud/CMakeLists.txt index 71ff3fc1befdf..2b6ad3f09a64d 100644 --- a/src/framework/cloud/CMakeLists.txt +++ b/src/framework/cloud/CMakeLists.txt @@ -59,4 +59,6 @@ if (MUSE_MODULE_CLOUD_MUSESCORECOM) set(MODULE_DEF ${MODULE_DEF} -DMUSE_MODULE_CLOUD_MUSESCORECOM) endif() +list(APPEND MODULE_LINK Qt::Qml Qt::Network Qt::NetworkAuth) + setup_module() diff --git a/src/framework/diagnostics/CMakeLists.txt b/src/framework/diagnostics/CMakeLists.txt index b6ac8007d9ed4..21288724ace46 100644 --- a/src/framework/diagnostics/CMakeLists.txt +++ b/src/framework/diagnostics/CMakeLists.txt @@ -135,6 +135,10 @@ if (MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT) endif() # MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT # ---------------- +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Gui Qt::Quick) +endif() + setup_module() if (MUSE_MODULE_DIAGNOSTICS_TESTS) diff --git a/src/framework/draw/CMakeLists.txt b/src/framework/draw/CMakeLists.txt index e30fed850204e..44e0e5eed7d57 100644 --- a/src/framework/draw/CMakeLists.txt +++ b/src/framework/draw/CMakeLists.txt @@ -121,6 +121,10 @@ if (MUSE_MODULE_DRAW_TRACE) set(MODULE_DEF ${MODULE_DEF} -DMUSE_MODULE_DRAW_TRACE) endif() +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Gui Qt::Svg) +endif() + setup_module() if (MUSE_MODULE_DRAW_TESTS) diff --git a/src/framework/extensions/CMakeLists.txt b/src/framework/extensions/CMakeLists.txt index 32b0c7091a119..3925cae56fccf 100644 --- a/src/framework/extensions/CMakeLists.txt +++ b/src/framework/extensions/CMakeLists.txt @@ -84,4 +84,8 @@ set(MODULE_SRC set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Quick) +endif() + setup_module() diff --git a/src/framework/global/CMakeLists.txt b/src/framework/global/CMakeLists.txt index 66afe5d8df96b..4b12b98695fbb 100644 --- a/src/framework/global/CMakeLists.txt +++ b/src/framework/global/CMakeLists.txt @@ -245,16 +245,24 @@ else () set(Z_LIB z) endif () -list(APPEND MODULE_INCLUDE_PRIVATE - ${Z_INCLUDE} - ) +list(APPEND MODULE_INCLUDE_PRIVATE ${Z_INCLUDE}) +list(APPEND MODULE_LINK ${Z_LIB}) -list(APPEND MODULE_LINK - ${Z_LIB} -) list(APPEND MODULE_LINK ${TINYXML_MODULE_LINK}) set(MODULE_DEF ${TINYXML_MODULE_DEF}) +if (QT_SUPPORT) + # These are needed by so many modules, that we make them public here, + # so that other modules get them transitively. + list(APPEND MODULE_LINK_PUBLIC Qt::Core Qt::Gui) + + # These are needed by the PCH; if we don't make them public, modules + # that don't use them won't be able to use the PCH with some compilers. + list(APPEND MODULE_LINK_PUBLIC Qt::Quick Qt::Widgets) +endif() + +list(APPEND MODULE_LINK_PUBLIC ${CMAKE_DL_LIBS}) + if (MUSE_ENABLE_CUSTOM_ALLOCATOR) set(MODULE_DEF ${MODULE_DEF} -DMUSE_ENABLE_CUSTOM_ALLOCATOR) endif() diff --git a/src/framework/languages/CMakeLists.txt b/src/framework/languages/CMakeLists.txt index 3877279e76ce3..511662164286b 100644 --- a/src/framework/languages/CMakeLists.txt +++ b/src/framework/languages/CMakeLists.txt @@ -34,5 +34,8 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/internal/languagesservice.h ) -setup_module() +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Concurrent Qt::Gui Qt::Network Qt::Qml) +endif() +setup_module() diff --git a/src/framework/learn/CMakeLists.txt b/src/framework/learn/CMakeLists.txt index a2eb45eb66063..24aaa31a6a17c 100644 --- a/src/framework/learn/CMakeLists.txt +++ b/src/framework/learn/CMakeLists.txt @@ -39,5 +39,8 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/view/learnpagemodel.h ) -setup_module() +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Concurrent Qt::Network Qt::Qml) +endif() +setup_module() diff --git a/src/framework/midi/CMakeLists.txt b/src/framework/midi/CMakeLists.txt index af737341c397d..08fa68be91e16 100644 --- a/src/framework/midi/CMakeLists.txt +++ b/src/framework/midi/CMakeLists.txt @@ -91,4 +91,8 @@ set(MODULE_QRC midi.qrc) set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() diff --git a/src/framework/mpe/CMakeLists.txt b/src/framework/mpe/CMakeLists.txt index dae4b529b0fda..7766c774e68ed 100644 --- a/src/framework/mpe/CMakeLists.txt +++ b/src/framework/mpe/CMakeLists.txt @@ -46,6 +46,10 @@ set(MODULE_QRC mpe.qrc) set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() if (MUSE_MODULE_MPE_TESTS) diff --git a/src/framework/multiinstances/CMakeLists.txt b/src/framework/multiinstances/CMakeLists.txt index dad100bc3fa7b..95934ca7b5125 100644 --- a/src/framework/multiinstances/CMakeLists.txt +++ b/src/framework/multiinstances/CMakeLists.txt @@ -55,4 +55,8 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/dev/multiinstancesdevmodel.h ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() diff --git a/src/framework/network/CMakeLists.txt b/src/framework/network/CMakeLists.txt index fe63376b53248..187031ba3d4cb 100644 --- a/src/framework/network/CMakeLists.txt +++ b/src/framework/network/CMakeLists.txt @@ -35,6 +35,9 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/internal/networkmanagercreator.h ) +list(APPEND MODULE_LINK Qt::Qml) +list(APPEND MODULE_LINK_PUBLIC Qt::Network) + if (MUSE_MODULE_NETWORK_WEBSOCKET) set(MODULE_SRC ${MODULE_SRC} ${CMAKE_CURRENT_LIST_DIR}/api/websocketapi.cpp @@ -43,7 +46,8 @@ if (MUSE_MODULE_NETWORK_WEBSOCKET) ${CMAKE_CURRENT_LIST_DIR}/api/websocketserverapi.h ) - set(MODULE_DEF -DMUSE_MODULE_NETWORK_WEBSOCKET) + list(APPEND MODULE_DEF -DMUSE_MODULE_NETWORK_WEBSOCKET) + list(APPEND MODULE_LINK Qt::WebSockets) endif() setup_module() diff --git a/src/framework/shortcuts/CMakeLists.txt b/src/framework/shortcuts/CMakeLists.txt index 829d82cefeed6..0d62a70df8d4e 100644 --- a/src/framework/shortcuts/CMakeLists.txt +++ b/src/framework/shortcuts/CMakeLists.txt @@ -79,5 +79,7 @@ if (OS_IS_MAC) ) endif(OS_IS_MAC) +list(APPEND MODULE_LINK Qt::Gui Qt::Qml) + setup_module() diff --git a/src/framework/ui/CMakeLists.txt b/src/framework/ui/CMakeLists.txt index b2ce44a00195d..d2d5926c58e3c 100644 --- a/src/framework/ui/CMakeLists.txt +++ b/src/framework/ui/CMakeLists.txt @@ -155,6 +155,14 @@ set(MODULE_UI ${CMAKE_CURRENT_LIST_DIR}/dev/testdialog.ui ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Quick Qt::Widgets) + + if (OS_IS_LIN) + list(APPEND MODULE_LINK Qt::DBus) + endif() +endif() + if (OS_IS_MAC) find_library(AppKit NAMES AppKit) set(MODULE_LINK ${MODULE_LINK} ${AppKit}) diff --git a/src/framework/ui/tests/CMakeLists.txt b/src/framework/ui/tests/CMakeLists.txt index 3edae2eb7d5ff..6c62dfcf25ed6 100644 --- a/src/framework/ui/tests/CMakeLists.txt +++ b/src/framework/ui/tests/CMakeLists.txt @@ -33,6 +33,7 @@ set(MODULE_TEST_SRC set(MODULE_TEST_LINK muse_actions muse_ui + Qt::Quick ) include(SetupGTest) diff --git a/src/framework/uicomponents/CMakeLists.txt b/src/framework/uicomponents/CMakeLists.txt index 7df3ae48e766a..dd54195b5ff28 100644 --- a/src/framework/uicomponents/CMakeLists.txt +++ b/src/framework/uicomponents/CMakeLists.txt @@ -119,6 +119,10 @@ if (MUSE_MODULE_UI_DISABLE_MODALITY) set(MODULE_DEF ${MODULE_DEF} -DMUSE_MODULE_UI_DISABLE_MODALITY) endif() +if(QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Widgets Qt::Quick) +endif() + set(MODULE_USE_UNITY OFF) setup_module() @@ -126,5 +130,3 @@ setup_module() if (MUSE_MODULE_UI_TESTS) add_subdirectory(tests) endif() - - diff --git a/src/framework/update/CMakeLists.txt b/src/framework/update/CMakeLists.txt index d6e7168bedf63..7e421530667bc 100644 --- a/src/framework/update/CMakeLists.txt +++ b/src/framework/update/CMakeLists.txt @@ -57,6 +57,10 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/view/updatemodel.h ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Concurrent Qt::Qml) +endif() + setup_module() if (MUSE_MODULE_UPDATE_TESTS) diff --git a/src/framework/update/tests/CMakeLists.txt b/src/framework/update/tests/CMakeLists.txt index 4dcf99dee0b23..ab58c8824a240 100644 --- a/src/framework/update/tests/CMakeLists.txt +++ b/src/framework/update/tests/CMakeLists.txt @@ -27,6 +27,7 @@ set(MODULE_TEST_SRC set(MODULE_TEST_LINK muse_update + Qt::Network ) set(MODULE_TEST_DATA_ROOT ${CMAKE_CURRENT_LIST_DIR}) diff --git a/src/framework/vst/CMakeLists.txt b/src/framework/vst/CMakeLists.txt index 7fe1568326621..886f410a9b3d2 100644 --- a/src/framework/vst/CMakeLists.txt +++ b/src/framework/vst/CMakeLists.txt @@ -92,6 +92,10 @@ if (OS_IS_LIN) ) endif() +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml Qt::Widgets) +endif() + setup_module() target_no_warning(${MODULE} -Wno-deprecated-declarations) diff --git a/src/framework/workspace/CMakeLists.txt b/src/framework/workspace/CMakeLists.txt index c5748f1606f41..a4bd8583bb5c4 100644 --- a/src/framework/workspace/CMakeLists.txt +++ b/src/framework/workspace/CMakeLists.txt @@ -51,5 +51,9 @@ if (NOT MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VER set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy") endif (NOT MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() diff --git a/src/importexport/midi/CMakeLists.txt b/src/importexport/midi/CMakeLists.txt index b003731a21278..f514f516012ed 100644 --- a/src/importexport/midi/CMakeLists.txt +++ b/src/importexport/midi/CMakeLists.txt @@ -46,6 +46,10 @@ set(MODULE_LINK engraving ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Core5Compat) +endif() + setup_module() if (MUE_BUILD_IMPORTEXPORT_TESTS) diff --git a/src/importexport/ove/CMakeLists.txt b/src/importexport/ove/CMakeLists.txt index cc6a03fb1b876..72948d6446d39 100644 --- a/src/importexport/ove/CMakeLists.txt +++ b/src/importexport/ove/CMakeLists.txt @@ -37,5 +37,9 @@ set(MODULE_LINK engraving ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Core5Compat) +endif() + setup_module() diff --git a/src/inspector/CMakeLists.txt b/src/inspector/CMakeLists.txt index 59711a2125e33..371f7e36d314b 100644 --- a/src/inspector/CMakeLists.txt +++ b/src/inspector/CMakeLists.txt @@ -236,6 +236,7 @@ endif (NOT MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_ set(MODULE_LINK muse::uicomponents engraving + Qt::Quick ) setup_module() diff --git a/src/instrumentsscene/CMakeLists.txt b/src/instrumentsscene/CMakeLists.txt index 3106284614c00..38df016ee26a6 100644 --- a/src/instrumentsscene/CMakeLists.txt +++ b/src/instrumentsscene/CMakeLists.txt @@ -60,6 +60,7 @@ set(MODULE_SRC set(MODULE_LINK engraving + Qt::Qml ) setup_module() diff --git a/src/musesounds/CMakeLists.txt b/src/musesounds/CMakeLists.txt index 544785354e9e1..d696c942e25c4 100644 --- a/src/musesounds/CMakeLists.txt +++ b/src/musesounds/CMakeLists.txt @@ -39,4 +39,6 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/view/musesoundslistmodel.h ) +set(MODULE_LINK Qt::Concurrent) + setup_module() diff --git a/src/notation/CMakeLists.txt b/src/notation/CMakeLists.txt index 88097a34b9336..995b4e1a1d8d3 100644 --- a/src/notation/CMakeLists.txt +++ b/src/notation/CMakeLists.txt @@ -209,6 +209,9 @@ set(MODULE_LINK commonscene muse::uicomponents muse::ui + Qt::Quick + Qt::StateMachine + Qt::Widgets ) if (MUE_BUILD_NOTATION_TESTS) diff --git a/src/palette/CMakeLists.txt b/src/palette/CMakeLists.txt index 3d11df58e2d6f..46880ea9afc22 100644 --- a/src/palette/CMakeLists.txt +++ b/src/palette/CMakeLists.txt @@ -82,6 +82,9 @@ set(MODULE_UI set(MODULE_LINK engraving commonscene + Qt::Quick + Qt::StateMachine + Qt::Widgets ) setup_module() diff --git a/src/playback/CMakeLists.txt b/src/playback/CMakeLists.txt index 64754f2f378ae..2fa488d1afbf1 100644 --- a/src/playback/CMakeLists.txt +++ b/src/playback/CMakeLists.txt @@ -73,8 +73,12 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/view/soundprofilesmodel.h ) -if (MUE_BUILD_PLAYBACK_TESTS) - add_subdirectory(tests) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Quick) endif() setup_module() + +if (MUE_BUILD_PLAYBACK_TESTS) + add_subdirectory(tests) +endif() diff --git a/src/print/CMakeLists.txt b/src/print/CMakeLists.txt index 8b8710960710c..4462b3c776d21 100644 --- a/src/print/CMakeLists.txt +++ b/src/print/CMakeLists.txt @@ -29,5 +29,9 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/internal/printprovider.h ) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::PrintSupport) +endif() + setup_module() diff --git a/src/project/CMakeLists.txt b/src/project/CMakeLists.txt index cf0947fa7695b..3439e4397777c 100644 --- a/src/project/CMakeLists.txt +++ b/src/project/CMakeLists.txt @@ -146,6 +146,8 @@ set(MODULE_SRC set(MODULE_LINK muse::uicomponents notation + Qt::Concurrent + Qt::Quick ) setup_module() diff --git a/src/workspacescene/CMakeLists.txt b/src/workspacescene/CMakeLists.txt index 392c265bee198..647e451fa1c48 100644 --- a/src/workspacescene/CMakeLists.txt +++ b/src/workspacescene/CMakeLists.txt @@ -35,5 +35,9 @@ if (NOT MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VER set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy") endif (NOT MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) +if (QT_SUPPORT) + list(APPEND MODULE_LINK Qt::Qml) +endif() + setup_module() From ad0bd11bd99c34410cda40955ce7a8340475b396 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:04:44 +0100 Subject: [PATCH 09/18] CMake: Use Qt's `qt_add_{library,executable}` I verified that they don't do anything scary, so let's use them, to keep our code in line with the documentation, and to be sure that we're ready to use modern Qt/CMake possibilities. --- buildscripts/cmake/DeclareModuleSetup.cmake | 30 +++++++++++++++---- buildscripts/cmake/SetupQt6.cmake | 4 +-- buildscripts/cmake/SetupSndFile.cmake | 2 +- src/app/CMakeLists.txt | 4 +-- .../thirdparty/liblouis/CMakeLists.txt | 3 +- .../audio/thirdparty/flac/CMakeLists.txt | 3 +- .../thirdparty/fluidsynth/CMakeLists.txt | 3 +- .../audio/thirdparty/lame/CMakeLists.txt | 3 +- .../audio/thirdparty/opusenc/CMakeLists.txt | 3 +- .../draw/thirdparty/freetype/CMakeLists.txt | 3 +- src/framework/vst/sdk/CMakeLists.txt | 3 +- thirdparty/beatroot/CMakeLists.txt | 2 +- thirdparty/rtf2html/CMakeLists.txt | 6 +++- 13 files changed, 42 insertions(+), 27 deletions(-) diff --git a/buildscripts/cmake/DeclareModuleSetup.cmake b/buildscripts/cmake/DeclareModuleSetup.cmake index fbfecfca8d32e..8f76c251c8eae 100644 --- a/buildscripts/cmake/DeclareModuleSetup.cmake +++ b/buildscripts/cmake/DeclareModuleSetup.cmake @@ -56,6 +56,7 @@ macro(declare_module name) unset(MODULE_LINK) unset(MODULE_LINK_PUBLIC) set(MODULE_LINK_GLOBAL ON) + set(MODULE_USE_QT ON) unset(MODULE_QRC) unset(MODULE_BIG_QRC) unset(MODULE_UI) @@ -67,6 +68,13 @@ macro(declare_module name) unset(MODULE_IS_STUB) endmacro() +macro(declare_thirdparty_module name) + declare_module(${name}) + set(MODULE_USE_QT OFF) + set(MODULE_LINK_GLOBAL OFF) + set(MODULE_USE_PCH OFF) +endmacro() + macro(add_qml_import_path input_var) if (NOT ${${input_var}} STREQUAL "") @@ -90,6 +98,22 @@ macro(setup_module) set(MUSE_FRAMEWORK_PATH ${PROJECT_SOURCE_DIR}) endif() + if (MODULE_USE_QT AND QT_SUPPORT) + if (CC_IS_EMSCRIPTEN) + qt_add_library(${MODULE} OBJECT) + else() + # STATIC/SHARED based on BUILD_SHARED_LIBS, which is set in SetupBuildEnvironment.cmake + qt_add_library(${MODULE}) + endif() + else() + if (CC_IS_EMSCRIPTEN) + add_library(${MODULE} OBJECT) + else() + # STATIC/SHARED based on BUILD_SHARED_LIBS, which is set in SetupBuildEnvironment.cmake + add_library(${MODULE}) + endif() + endif() + if (MODULE_QRC AND NOT NO_QT_SUPPORT) qt_add_resources(RCC_SOURCES ${MODULE_QRC}) endif() @@ -106,12 +130,6 @@ macro(setup_module) add_qml_import_path(MODULE_QML_IMPORT) add_qml_import_path(MODULE_QMLAPI_IMPORT) - if (CC_IS_EMSCRIPTEN) - add_library(${MODULE} OBJECT) - else() - add_library(${MODULE}) # STATIC/SHARED set global in the SetupBuildEnvironment.cmake - endif() - if (MODULE_ALIAS) add_library(${MODULE_ALIAS} ALIAS ${MODULE}) endif() diff --git a/buildscripts/cmake/SetupQt6.cmake b/buildscripts/cmake/SetupQt6.cmake index 2331cce2066de..67024049df314 100644 --- a/buildscripts/cmake/SetupQt6.cmake +++ b/buildscripts/cmake/SetupQt6.cmake @@ -75,8 +75,8 @@ if(QT_ADD_WEBSOCKET) list(APPEND QT_LIBRARIES Qt::WebSockets) endif() -find_package(Qt6 6.3 REQUIRED COMPONENTS ${qt_components}) +find_package(Qt6 REQUIRED COMPONENTS ${qt_components}) include(QtInstallPaths) -qt_standard_project_setup() +qt_standard_project_setup(REQUIRES 6.3 SUPPORTS_UP_TO 6.8) diff --git a/buildscripts/cmake/SetupSndFile.cmake b/buildscripts/cmake/SetupSndFile.cmake index 9245e8ae289e4..1b9a2d592b518 100644 --- a/buildscripts/cmake/SetupSndFile.cmake +++ b/buildscripts/cmake/SetupSndFile.cmake @@ -14,7 +14,7 @@ elseif (OS_IS_WASM) set(LIBVORBIS_PATH "" CACHE PATH "Path to libogg sources") set(SNDFILE_INCDIR LIBSND_PATH) - declare_module(sndfile) + declare_thirdparty_module(sndfile) set(MODULE_SRC ${LIBSND_PATH}/sndfile.c diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index a0525d0986164..5390030e206f4 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -248,7 +248,7 @@ endif() # Executable declaration ########################################### -add_executable(MuseScoreStudio +qt_add_executable(MuseScoreStudio WIN32 MACOSX_BUNDLE ${APP_RCC_SOURCES} ${MSCORE_APPEND_SRC} @@ -299,7 +299,7 @@ endif(OS_IS_WASM) ########################################### if (NOT CC_IS_EMSCRIPTEN) - target_link_libraries(MuseScoreStudio ${LINK_LIB} ) + target_link_libraries(MuseScoreStudio PRIVATE ${LINK_LIB}) else() target_link_libraries(MuseScoreStudio PRIVATE ${QT_LIBRARIES}) diff --git a/src/braille/thirdparty/liblouis/CMakeLists.txt b/src/braille/thirdparty/liblouis/CMakeLists.txt index ee743a501acb0..c3cebd567d535 100644 --- a/src/braille/thirdparty/liblouis/CMakeLists.txt +++ b/src/braille/thirdparty/liblouis/CMakeLists.txt @@ -1,4 +1,4 @@ -declare_module(liblouis) +declare_thirdparty_module(liblouis) add_subdirectory(tables) @@ -36,7 +36,6 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/liblouis/utils.c ) -set(MODULE_USE_PCH OFF) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/audio/thirdparty/flac/CMakeLists.txt b/src/framework/audio/thirdparty/flac/CMakeLists.txt index d473d65c315dc..c9843d5bbd74c 100644 --- a/src/framework/audio/thirdparty/flac/CMakeLists.txt +++ b/src/framework/audio/thirdparty/flac/CMakeLists.txt @@ -1,5 +1,5 @@ -declare_module(flac) +declare_thirdparty_module(flac) include(GetPlatformInfo) include(GetCompilerInfo) @@ -68,7 +68,6 @@ set (MODULE_SRC $<$:${FLAC_SRC}/share/win_utf8_io/win_utf8_io.c> ) -set(MODULE_USE_PCH OFF) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/audio/thirdparty/fluidsynth/CMakeLists.txt b/src/framework/audio/thirdparty/fluidsynth/CMakeLists.txt index b84b3668735c0..d4dbb16cc8f83 100644 --- a/src/framework/audio/thirdparty/fluidsynth/CMakeLists.txt +++ b/src/framework/audio/thirdparty/fluidsynth/CMakeLists.txt @@ -1,5 +1,5 @@ -declare_module(fluidsynth) +declare_thirdparty_module(fluidsynth) include(${CMAKE_CURRENT_LIST_DIR}/fluidsynth.cmake) @@ -23,7 +23,6 @@ set(MODULE_LINK ${SNDFILE_LIB} ) -set(MODULE_USE_PCH OFF) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/audio/thirdparty/lame/CMakeLists.txt b/src/framework/audio/thirdparty/lame/CMakeLists.txt index 1e19391c21665..862df2382a6bd 100644 --- a/src/framework/audio/thirdparty/lame/CMakeLists.txt +++ b/src/framework/audio/thirdparty/lame/CMakeLists.txt @@ -1,5 +1,5 @@ -declare_module(lame) +declare_thirdparty_module(lame) include(GetPlatformInfo) include(GetCompilerInfo) @@ -56,7 +56,6 @@ set (MODULE_SRC ${SOURCE_LIB} ) -set(MODULE_USE_PCH OFF) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/audio/thirdparty/opusenc/CMakeLists.txt b/src/framework/audio/thirdparty/opusenc/CMakeLists.txt index 11db0c8df01ed..77979f8ad9507 100644 --- a/src/framework/audio/thirdparty/opusenc/CMakeLists.txt +++ b/src/framework/audio/thirdparty/opusenc/CMakeLists.txt @@ -1,5 +1,5 @@ -declare_module(opusenc) +declare_thirdparty_module(opusenc) include(GetPlatformInfo) include(GetCompilerInfo) @@ -32,7 +32,6 @@ set(MODULE_SRC set(MODULE_LINK ${OPUS_LIBRARIES}) -set(MODULE_USE_PCH OFF) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/draw/thirdparty/freetype/CMakeLists.txt b/src/framework/draw/thirdparty/freetype/CMakeLists.txt index 4bf9bf82847ac..b475592da542d 100644 --- a/src/framework/draw/thirdparty/freetype/CMakeLists.txt +++ b/src/framework/draw/thirdparty/freetype/CMakeLists.txt @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -declare_module(freetype) +declare_thirdparty_module(freetype) set(FREETYPE_DIR ${CMAKE_CURRENT_LIST_DIR}/freetype-2.13.1) set(FREETYPE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/freetype-2.13.1) @@ -160,7 +160,6 @@ set(MODULE_DEF -DFT2_BUILD_LIBRARY ) -set(MODULE_USE_PCH OFF) set(MODULE_USE_UNITY OFF) setup_module() diff --git a/src/framework/vst/sdk/CMakeLists.txt b/src/framework/vst/sdk/CMakeLists.txt index 488b051ed8fb7..31fa1854c1e0e 100644 --- a/src/framework/vst/sdk/CMakeLists.txt +++ b/src/framework/vst/sdk/CMakeLists.txt @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -declare_module(vst_sdk_3) +declare_thirdparty_module(vst_sdk_3) if (NOT MUSE_MODULE_VST_VST3_SDK_PATH) message(FATAL_ERROR "VST3_SDK path is not setted") @@ -37,7 +37,6 @@ else() endif() set(MODULE_USE_UNITY OFF) -set(MODULE_USE_PCH OFF) if (OS_IS_WIN) set(PLATFORM_SRC diff --git a/thirdparty/beatroot/CMakeLists.txt b/thirdparty/beatroot/CMakeLists.txt index 514aaeabf38c1..1268f17b27625 100644 --- a/thirdparty/beatroot/CMakeLists.txt +++ b/thirdparty/beatroot/CMakeLists.txt @@ -1,5 +1,5 @@ -declare_module(beatroot) +declare_thirdparty_module(beatroot) set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/Agent.cpp diff --git a/thirdparty/rtf2html/CMakeLists.txt b/thirdparty/rtf2html/CMakeLists.txt index 9400f80698375..7c785b47f6b91 100644 --- a/thirdparty/rtf2html/CMakeLists.txt +++ b/thirdparty/rtf2html/CMakeLists.txt @@ -18,7 +18,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -declare_module(rtf2html) +declare_thirdparty_module(rtf2html) + +set(MODULE_USE_QT ON) set(MODULE_SRC common.h @@ -34,6 +36,8 @@ set(MODULE_SRC rtf_tools.h ) +set(MODULE_LINK Qt::Core) + setup_module() target_no_warning(${MODULE} -Wno-conversion) From ef62e274c061bc7ffd374feb574d9030fc4858b0 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 28 Oct 2024 02:06:15 +0100 Subject: [PATCH 10/18] Windows: deploy Qt libraries during install step --- src/app/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 5390030e206f4..6dc13d3b2e450 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -317,6 +317,17 @@ install(TARGETS MuseScoreStudio RUNTIME DESTINATION bin ) +if(OS_IS_WIN) + # Doing this only on Windows for now. On other platforms, it is not necessary + # for development builds because rpath exists, and it takes very long. However, + # on those platforms we must not forget to deploy manually during packaging. + qt_generate_deploy_qml_app_script( + TARGET MuseScoreStudio + OUTPUT_SCRIPT deploy_script + ) + install(SCRIPT ${deploy_script}) +endif() + ########################################### # Windows ########################################### @@ -427,7 +438,6 @@ else() message(FATAL_ERROR "Unsupported Platform: ${CMAKE_HOST_SYSTEM_NAME}") endif() - ################################################# # Miscellaneous Microsoft Visual Studio settings ################################################# From 09463683df69aebd586968e46efc53305e5c30d9 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:58:28 +0200 Subject: [PATCH 11/18] Qt::UniqueConnection can only be used with QObject member functions --- src/framework/dockwindow/view/dockwindow.cpp | 39 +++++++++++++++----- src/framework/dockwindow/view/dockwindow.h | 3 ++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/framework/dockwindow/view/dockwindow.cpp b/src/framework/dockwindow/view/dockwindow.cpp index 1be7798c0774c..aab2ea9ecb5f4 100644 --- a/src/framework/dockwindow/view/dockwindow.cpp +++ b/src/framework/dockwindow/view/dockwindow.cpp @@ -86,6 +86,22 @@ static void clearRegistry() } } +class DockWindow::UniqueConnectionHolder : public QObject +{ + Q_OBJECT +public: + UniqueConnectionHolder(DockPageView* page, DockWindow* parent) + : QObject(parent), m_page(page) {} + + void alignTopLevelToolBars() + { + static_cast(parent())->alignTopLevelToolBars(m_page); + } + +private: + DockPageView* m_page = nullptr; +}; + DockWindow::DockWindow(QQuickItem* parent) : QQuickItem(parent), muse::Injectable(muse::iocCtxForQmlObject(this)), m_toolBars(this), @@ -650,18 +666,21 @@ void DockWindow::initDocks(DockPageView* page) alignTopLevelToolBars(page); + if (!m_pageConnections.contains(page)) { + m_pageConnections[page] = new UniqueConnectionHolder(page, this); + } + + UniqueConnectionHolder* holder = m_pageConnections[page]; + for (DockToolBarView* toolbar : topLevelToolBars(page)) { - connect(toolbar, &DockToolBarView::floatingChanged, this, [this, page]() { - alignTopLevelToolBars(page); - }, Qt::UniqueConnection); + connect(toolbar, &DockToolBarView::floatingChanged, + holder, &UniqueConnectionHolder::alignTopLevelToolBars, Qt::UniqueConnection); - connect(toolbar, &DockToolBarView::contentSizeChanged, this, [this, page]() { - alignTopLevelToolBars(page); - }, Qt::UniqueConnection); + connect(toolbar, &DockToolBarView::contentSizeChanged, + holder, &UniqueConnectionHolder::alignTopLevelToolBars, Qt::UniqueConnection); - connect(toolbar, &DockToolBarView::visibleChanged, this, [this, page]() { - alignTopLevelToolBars(page); - }, Qt::UniqueConnection); + connect(toolbar, &DockToolBarView::visibleChanged, + holder, &UniqueConnectionHolder::alignTopLevelToolBars, Qt::UniqueConnection); } } @@ -768,3 +787,5 @@ QList DockWindow::topLevelToolBars(const DockPageView* page) c return toolBars; } + +#include "dockwindow.moc" diff --git a/src/framework/dockwindow/view/dockwindow.h b/src/framework/dockwindow/view/dockwindow.h index 091d211f07aab..7a9090caddf33 100644 --- a/src/framework/dockwindow/view/dockwindow.h +++ b/src/framework/dockwindow/view/dockwindow.h @@ -143,6 +143,9 @@ private slots: uicomponents::QmlListProperty m_pages; async::Channel m_docksOpenStatusChanged; + class UniqueConnectionHolder; + QHash m_pageConnections; + bool m_hasGeometryBeenRestored = false; bool m_reloadCurrentPageAllowed = false; }; From 888dc0f7b6ed9ecc7ca7e5fe5dae434adffd72ba Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Fri, 4 Oct 2024 00:00:33 +0200 Subject: [PATCH 12/18] Fix tooltip size --- src/framework/ui/qml/Muse/Ui/ToolTipProvider.qml | 7 ------- .../qml/Muse/UiComponents/StyledToolTip.qml | 14 ++++++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/framework/ui/qml/Muse/Ui/ToolTipProvider.qml b/src/framework/ui/qml/Muse/Ui/ToolTipProvider.qml index dd87092972d26..5c9357d714637 100644 --- a/src/framework/ui/qml/Muse/Ui/ToolTipProvider.qml +++ b/src/framework/ui/qml/Muse/Ui/ToolTipProvider.qml @@ -44,11 +44,6 @@ Item { } } - onLoaded: { - var toolTip = toolTipLoader.item - toolTip.calculateSize() - } - function loadToolTip() { toolTipLoader.active = true } @@ -85,8 +80,6 @@ Item { toolTip.title = title toolTip.description = description toolTip.shortcut = shortcut - - toolTip.calculateSize() } } diff --git a/src/framework/uicomponents/qml/Muse/UiComponents/StyledToolTip.qml b/src/framework/uicomponents/qml/Muse/UiComponents/StyledToolTip.qml index 8914bfbc5075b..497fed683c414 100644 --- a/src/framework/uicomponents/qml/Muse/UiComponents/StyledToolTip.qml +++ b/src/framework/uicomponents/qml/Muse/UiComponents/StyledToolTip.qml @@ -32,6 +32,12 @@ StyledPopupView { property alias description: descriptionLabel.text property string shortcut: "" + contentWidth: Math.min(content.implicitWidth, 300 - margins * 2) + contentHeight: content.implicitHeight + + x: root.parent.width / 2 - (contentWidth + padding * 2 + margins * 2) / 2 + y: root.parent.height + padding: 8 margins: 8 @@ -40,14 +46,6 @@ StyledPopupView { //! NOTE: No navigation needed for tooltip navigationSection: null - function calculateSize() { - contentWidth = Math.min(content.implicitWidth, 300 - margins * 2) - contentHeight = content.implicitHeight - - x = root.parent.width / 2 - (contentWidth + padding * 2 + margins * 2) / 2 - y = root.parent.height - } - ColumnLayout { id: content From 1bc70f499accadfaf0b6c4ab51f722a1af87cd68 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Fri, 4 Oct 2024 21:32:32 +0200 Subject: [PATCH 13/18] Start using QStringLiterals --- src/framework/global/tests/string_tests.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/framework/global/tests/string_tests.cpp b/src/framework/global/tests/string_tests.cpp index 9198300b98f33..61fb2db09b9fb 100644 --- a/src/framework/global/tests/string_tests.cpp +++ b/src/framework/global/tests/string_tests.cpp @@ -34,6 +34,8 @@ using namespace muse; +using namespace Qt::Literals::StringLiterals; + class Global_Types_StringTests : public ::testing::Test { public: @@ -88,7 +90,7 @@ TEST_F(Global_Types_StringTests, String_Construct) { //! GIVEN Some QString - QString qstr = "123abcПыф"; + QString qstr = u"123abcПыф"_s; //! DO String str = qstr; //! CHECK @@ -106,7 +108,7 @@ TEST_F(Global_Types_StringTests, String_Convert) { { //! GIVEN Some QString - QString qstr_origin = "123abcПыф"; + QString qstr_origin = u"123abcПыф"_s; //! DO String str = String::fromQString(qstr_origin); //! CHECK From 94c390f6604976664e85f173ee1e957615d93247 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sun, 6 Oct 2024 01:06:01 +0200 Subject: [PATCH 14/18] Window: use default font engine --- src/app/configs/qt_win.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/configs/qt_win.conf b/src/app/configs/qt_win.conf index 99c707827928b..e77fbf5f7e095 100644 --- a/src/app/configs/qt_win.conf +++ b/src/app/configs/qt_win.conf @@ -1,5 +1,2 @@ [Paths] Prefix=./ - -[Platforms] -WindowsArguments = fontengine=freetype From 350caa47d136ecc5e34c5013b875163cc201508b Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Tue, 29 Oct 2024 01:37:08 +0100 Subject: [PATCH 15/18] Migrate AppShell module to `qt_add_qml_module` --- src/app/CMakeLists.txt | 10 +- src/app/internal/guiapp.cpp | 4 +- src/appshell/CMakeLists.txt | 2 + src/appshell/appshell.qrc | 101 -------------- src/appshell/qml/Main.qml | 82 ------------ .../{ => MuseScore/AppShell}/AboutDialog.qml | 2 +- .../AppShell}/AboutMusicXMLDialog.qml | 2 +- .../{ => MuseScore/AppShell}/AppWindow.qml | 2 +- .../qml/MuseScore/AppShell/CMakeLists.txt | 126 ++++++++++++++++++ .../CorruptScore/CorruptScoreDevTools.qml | 0 .../CrashHandler/CrashHandlerDevTools.qml | 0 .../AppShell}/DevTools/DevToolsMenu.qml | 0 .../AppShell}/DevTools/DevToolsPage.qml | 0 .../Extensions/ExtensionsListView.qml | 0 .../Gallery/GeneralComponentsGallery.qml | 0 .../DevTools/Interactive/InteractiveTests.qml | 0 .../DevTools/Interactive/SampleDialog.qml | 0 .../DevTools/KeyNav/KeyNavExample.qml | 0 .../DevTools/KeyNav/KeyNavSection.qml | 0 .../DevTools/KeyNav/KeyNavSubSection.qml | 0 .../MPE/ArticulationsProfileEditorView.qml | 0 .../DevTools/Preferences/SettingsPage.qml | 0 .../FirstLaunchSetupDialog.qml | 2 +- .../AppShell}/FirstLaunchSetup/Page.qml | 2 +- .../FirstLaunchSetup/PlaybackPage.qml | 2 +- .../AppShell}/FirstLaunchSetup/ThemesPage.qml | 2 +- .../FirstLaunchSetup/TutorialsPage.qml | 2 +- .../FirstLaunchSetup/resources/MuseSounds.png | Bin .../resources/VideoTutorials.png | Bin .../AppShell}/HomePage/HomeMenu.qml | 0 .../AppShell}/HomePage/HomePage.qml | 0 .../AppShell}/HomePage/PluginsPage.qml | 0 .../{ => MuseScore/AppShell}/MainToolBar.qml | 2 +- .../AppShell}/NotationPage/NotationPage.qml | 2 +- .../NotationPage/NotationStatusBar.qml | 2 +- .../Preferences/AdvancedPreferencesPage.qml | 0 .../Preferences/AppearancePreferencesPage.qml | 0 .../Preferences/AudioMidiPreferencesPage.qml | 0 .../Preferences/BraillePreferencesPage.qml | 0 .../Preferences/CanvasPreferencesPage.qml | 0 .../Preferences/FoldersPreferencesPage.qml | 0 .../Preferences/GeneralPreferencesPage.qml | 0 .../Preferences/ImportPreferencesPage.qml | 0 .../MidiDeviceMappingPreferencesPage.qml | 0 .../Preferences/NoteInputPreferencesPage.qml | 0 .../Preferences/PercussionPreferencesPage.qml | 0 .../Preferences/PreferencesDialog.qml | 0 .../AppShell}/Preferences/PreferencesPage.qml | 0 .../SaveAndPublishPreferencesPage.qml | 0 .../Preferences/ScorePreferencesPage.qml | 0 .../Preferences/ShortcutsPreferencesPage.qml | 0 .../Preferences/UpdatePreferencesPage.qml | 0 .../internal/AccentColorsSection.qml | 0 .../internal/AdvancedTopSection.qml | 0 .../Preferences/internal/AudioApiSection.qml | 0 .../internal/AudioEngineSection.qml | 0 .../Preferences/internal/AutoSaveSection.qml | 0 .../internal/AutomaticUpdateSection.qml | 0 .../Preferences/internal/BaseSection.qml | 0 .../internal/BrailleAdvancedSection.qml | 0 .../Preferences/internal/BrailleSection.qml | 0 .../Preferences/internal/CharsetsSection.qml | 0 .../internal/ColorAndWallpaperSection.qml | 0 .../internal/ComboBoxWithTitle.qml | 0 .../internal/CommonAudioApiConfiguration.qml | 0 .../internal/DefaultFilesSection.qml | 0 .../Preferences/internal/FoldersSection.qml | 0 .../internal/ImportStyleSection.qml | 0 .../IncrementalPropertyControlWithTitle.qml | 0 .../internal/KeyboardLayoutsSection.qml | 0 .../Preferences/internal/LanguagesSection.qml | 0 .../Preferences/internal/MeiSection.qml | 0 .../internal/MidiDevicesSection.qml | 0 .../Preferences/internal/MidiSection.qml | 0 .../internal/MiscellaneousSection.qml | 0 .../Preferences/internal/MixerSection.qml | 0 .../Preferences/internal/MusicXmlSection.qml | 0 .../internal/NoteInputPlaySection.qml | 0 .../Preferences/internal/NoteInputSection.qml | 0 .../internal/PreferencesButtonsPanel.qml | 0 .../Preferences/internal/PreferencesMenu.qml | 0 .../internal/ProgramStartSection.qml | 0 .../internal/PublishMuseScoreComSection.qml | 0 .../internal/RemoteControlSection.qml | 0 .../internal/SaveToCloudSection.qml | 0 .../internal/ScrollPagesSection.qml | 0 .../ThemeAdditionalOptionsSection.qml | 0 .../Preferences/internal/ThemesSection.qml | 0 .../Preferences/internal/UiColorsSection.qml | 0 .../Preferences/internal/UiFontSection.qml | 0 .../Preferences/internal/ZoomSection.qml | 0 .../AppShell}/PublishPage/PublishPage.qml | 2 +- .../AppShell}/PublishPage/PublishToolBar.qml | 2 +- .../AppShell}/WindowContent.qml | 10 +- .../platform/AppButtonBackground.qml | 0 .../AppShell}/platform/AppMenuBar.qml | 2 +- .../AppShell}/platform/PlatformMenuBar.qml | 2 +- .../AppShell}/platform/linux/Main.qml | 0 .../AppShell}/platform/mac/Main.qml | 5 +- .../AppShell/platform/wasm/Main.qml} | 0 .../platform/win/AppSystemButtons.qml | 0 .../AppShell}/platform/win/AppTitleBar.qml | 2 +- .../AppShell}/platform/win/Main.qml | 2 +- .../AppShell}/resources/mu_logo.svg | 0 .../AppShell}/shared/AccentColorsList.qml | 0 .../AppShell}/shared/ThemeSamplesList.qml | 4 +- .../AppShell}/shared/internal/ThemeSample.qml | 0 107 files changed, 163 insertions(+), 215 deletions(-) delete mode 100644 src/appshell/qml/Main.qml rename src/appshell/qml/{ => MuseScore/AppShell}/AboutDialog.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/AboutMusicXMLDialog.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/AppWindow.qml (98%) create mode 100644 src/appshell/qml/MuseScore/AppShell/CMakeLists.txt rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/CorruptScore/CorruptScoreDevTools.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/CrashHandler/CrashHandlerDevTools.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/DevToolsMenu.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/DevToolsPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/Extensions/ExtensionsListView.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/Gallery/GeneralComponentsGallery.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/Interactive/InteractiveTests.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/Interactive/SampleDialog.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/KeyNav/KeyNavExample.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/KeyNav/KeyNavSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/KeyNav/KeyNavSubSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/MPE/ArticulationsProfileEditorView.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/DevTools/Preferences/SettingsPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/FirstLaunchSetupDialog.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/Page.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/PlaybackPage.qml (98%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/ThemesPage.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/TutorialsPage.qml (98%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/resources/MuseSounds.png (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/FirstLaunchSetup/resources/VideoTutorials.png (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/HomePage/HomeMenu.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/HomePage/HomePage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/HomePage/PluginsPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/MainToolBar.qml (98%) rename src/appshell/qml/{ => MuseScore/AppShell}/NotationPage/NotationPage.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/NotationPage/NotationStatusBar.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/AdvancedPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/AppearancePreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/AudioMidiPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/BraillePreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/CanvasPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/FoldersPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/GeneralPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/ImportPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/MidiDeviceMappingPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/NoteInputPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/PercussionPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/PreferencesDialog.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/PreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/SaveAndPublishPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/ScorePreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/ShortcutsPreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/UpdatePreferencesPage.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/AccentColorsSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/AdvancedTopSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/AudioApiSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/AudioEngineSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/AutoSaveSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/AutomaticUpdateSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/BaseSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/BrailleAdvancedSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/BrailleSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/CharsetsSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ColorAndWallpaperSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ComboBoxWithTitle.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/CommonAudioApiConfiguration.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/DefaultFilesSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/FoldersSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ImportStyleSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/IncrementalPropertyControlWithTitle.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/KeyboardLayoutsSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/LanguagesSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/MeiSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/MidiDevicesSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/MidiSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/MiscellaneousSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/MixerSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/MusicXmlSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/NoteInputPlaySection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/NoteInputSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/PreferencesButtonsPanel.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/PreferencesMenu.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ProgramStartSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/PublishMuseScoreComSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/RemoteControlSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/SaveToCloudSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ScrollPagesSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ThemeAdditionalOptionsSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ThemesSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/UiColorsSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/UiFontSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/Preferences/internal/ZoomSection.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/PublishPage/PublishPage.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/PublishPage/PublishToolBar.qml (97%) rename src/appshell/qml/{ => MuseScore/AppShell}/WindowContent.qml (95%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/AppButtonBackground.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/AppMenuBar.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/PlatformMenuBar.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/linux/Main.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/mac/Main.qml (94%) rename src/appshell/qml/{Main.wasm.qml => MuseScore/AppShell/platform/wasm/Main.qml} (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/win/AppSystemButtons.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/win/AppTitleBar.qml (99%) rename src/appshell/qml/{ => MuseScore/AppShell}/platform/win/Main.qml (98%) rename src/appshell/qml/{ => MuseScore/AppShell}/resources/mu_logo.svg (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/shared/AccentColorsList.qml (100%) rename src/appshell/qml/{ => MuseScore/AppShell}/shared/ThemeSamplesList.qml (97%) rename src/appshell/qml/{ => MuseScore/AppShell}/shared/internal/ThemeSample.qml (100%) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 6dc13d3b2e450..9348deb5216bb 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -317,14 +317,16 @@ install(TARGETS MuseScoreStudio RUNTIME DESTINATION bin ) +qt_generate_deploy_qml_app_script( + TARGET MuseScoreStudio + OUTPUT_SCRIPT deploy_script + MACOS_BUNDLE_POST_BUILD +) + if(OS_IS_WIN) # Doing this only on Windows for now. On other platforms, it is not necessary # for development builds because rpath exists, and it takes very long. However, # on those platforms we must not forget to deploy manually during packaging. - qt_generate_deploy_qml_app_script( - TARGET MuseScoreStudio - OUTPUT_SCRIPT deploy_script - ) install(SCRIPT ${deploy_script}) endif() diff --git a/src/app/internal/guiapp.cpp b/src/app/internal/guiapp.cpp index 615c0dfdfdb98..de0782d0e0968 100644 --- a/src/app/internal/guiapp.cpp +++ b/src/app/internal/guiapp.cpp @@ -181,13 +181,13 @@ void GuiApp::perform() #elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) const QString mainQmlFile = "/platform/linux/Main.qml"; #elif defined(Q_OS_WASM) - const QString mainQmlFile = "/Main.wasm.qml"; + const QString mainQmlFile = "/platform/wasm/Main.qml"; #endif #ifdef MUE_ENABLE_LOAD_QML_FROM_SOURCE const QUrl url(QString(appshell_QML_IMPORT) + mainQmlFile); #else - const QUrl url(QStringLiteral("qrc:/qml") + mainQmlFile); + const QUrl url(QStringLiteral("qrc:/qt/qml/MuseScore/AppShell") + mainQmlFile); #endif QObject::connect(engine, &QQmlApplicationEngine::objectCreated, qApp, [](QObject* obj, const QUrl&) { diff --git a/src/appshell/CMakeLists.txt b/src/appshell/CMakeLists.txt index c0a717ba2c06a..c70cc421b0e86 100644 --- a/src/appshell/CMakeLists.txt +++ b/src/appshell/CMakeLists.txt @@ -153,3 +153,5 @@ if (QT_SUPPORT) endif() setup_module() + +add_subdirectory(qml/MuseScore/AppShell) diff --git a/src/appshell/appshell.qrc b/src/appshell/appshell.qrc index cd28a075cc68b..f085f6b990405 100644 --- a/src/appshell/appshell.qrc +++ b/src/appshell/appshell.qrc @@ -1,107 +1,6 @@ - qml/Main.wasm.qml - qml/MainToolBar.qml - qml/HomePage/HomeMenu.qml - qml/DevTools/Interactive/SampleDialog.qml - qml/DevTools/Interactive/InteractiveTests.qml - qml/DevTools/DevToolsMenu.qml - qml/DevTools/Preferences/SettingsPage.qml - qml/NotationPage/NotationStatusBar.qml - qml/HomePage/PluginsPage.qml - qml/DevTools/Gallery/GeneralComponentsGallery.qml - qml/DevTools/CrashHandler/CrashHandlerDevTools.qml - qml/DevTools/CorruptScore/CorruptScoreDevTools.qml - qml/AboutDialog.qml - qml/AboutMusicXMLDialog.qml - qml/resources/mu_logo.svg - qml/shared/AccentColorsList.qml - qml/shared/ThemeSamplesList.qml - qml/shared/internal/ThemeSample.qml - qml/FirstLaunchSetup/FirstLaunchSetupDialog.qml - qml/FirstLaunchSetup/Page.qml - qml/FirstLaunchSetup/ThemesPage.qml - qml/FirstLaunchSetup/PlaybackPage.qml - qml/FirstLaunchSetup/TutorialsPage.qml - qml/FirstLaunchSetup/resources/MuseSounds.png - qml/FirstLaunchSetup/resources/VideoTutorials.png - qml/Preferences/PreferencesPage.qml - qml/Preferences/GeneralPreferencesPage.qml - qml/Preferences/UpdatePreferencesPage.qml - qml/Preferences/NoteInputPreferencesPage.qml - qml/Preferences/AppearancePreferencesPage.qml - qml/Preferences/FoldersPreferencesPage.qml - qml/Preferences/AdvancedPreferencesPage.qml - qml/Preferences/CanvasPreferencesPage.qml - qml/Preferences/ScorePreferencesPage.qml - qml/Preferences/ShortcutsPreferencesPage.qml - qml/Preferences/ImportPreferencesPage.qml - qml/Preferences/MidiDeviceMappingPreferencesPage.qml - qml/Preferences/AudioMidiPreferencesPage.qml - qml/Preferences/SaveAndPublishPreferencesPage.qml - qml/Preferences/PreferencesDialog.qml - qml/Preferences/internal/PreferencesButtonsPanel.qml - qml/Preferences/internal/PreferencesMenu.qml - qml/Preferences/internal/ThemesSection.qml - qml/Preferences/internal/AccentColorsSection.qml - qml/Preferences/internal/UiFontSection.qml - qml/Preferences/internal/UiColorsSection.qml - qml/Preferences/internal/ColorAndWallpaperSection.qml - qml/Preferences/internal/ImportStyleSection.qml - qml/Preferences/internal/CharsetsSection.qml - qml/Preferences/internal/MidiSection.qml - qml/Preferences/internal/MusicXmlSection.qml - qml/Preferences/internal/MidiDevicesSection.qml - qml/Preferences/internal/AudioEngineSection.qml - qml/Preferences/internal/AudioApiSection.qml - qml/Preferences/internal/CommonAudioApiConfiguration.qml - qml/Preferences/internal/ComboBoxWithTitle.qml - qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml - qml/Preferences/internal/KeyboardLayoutsSection.qml - qml/Preferences/internal/SaveToCloudSection.qml - qml/DevTools/KeyNav/KeyNavExample.qml - qml/DevTools/KeyNav/KeyNavSection.qml - qml/DevTools/KeyNav/KeyNavSubSection.qml - qml/HomePage/HomePage.qml - qml/NotationPage/NotationPage.qml - qml/PublishPage/PublishPage.qml - qml/PublishPage/PublishToolBar.qml - qml/DevTools/DevToolsPage.qml - qml/AppWindow.qml - qml/WindowContent.qml - qml/platform/linux/Main.qml - qml/platform/mac/Main.qml - qml/platform/win/Main.qml resources/win_opengl_buglist.json - qml/Preferences/internal/BaseSection.qml - qml/Preferences/internal/LanguagesSection.qml - qml/Preferences/internal/AutoSaveSection.qml - qml/Preferences/internal/RemoteControlSection.qml - qml/Preferences/internal/ProgramStartSection.qml - qml/Preferences/internal/FoldersSection.qml - qml/Preferences/internal/ThemeAdditionalOptionsSection.qml - qml/Preferences/internal/AdvancedTopSection.qml - qml/Preferences/internal/ZoomSection.qml - qml/Preferences/internal/ScrollPagesSection.qml - qml/Preferences/internal/NoteInputSection.qml - qml/Preferences/internal/NoteInputPlaySection.qml - qml/Preferences/internal/DefaultFilesSection.qml - qml/Preferences/internal/AutomaticUpdateSection.qml - qml/platform/win/AppTitleBar.qml - qml/DevTools/MPE/ArticulationsProfileEditorView.qml - qml/Preferences/internal/MiscellaneousSection.qml - qml/platform/win/AppSystemButtons.qml - qml/platform/AppMenuBar.qml - qml/platform/AppButtonBackground.qml resources/LoadingScreen.svg - qml/Preferences/BraillePreferencesPage.qml - qml/Preferences/internal/BrailleSection.qml - qml/Preferences/internal/BrailleAdvancedSection.qml - qml/Preferences/internal/MeiSection.qml - qml/Preferences/internal/PublishMuseScoreComSection.qml - qml/Preferences/internal/MixerSection.qml - qml/DevTools/Extensions/ExtensionsListView.qml - qml/platform/PlatformMenuBar.qml - qml/Preferences/PercussionPreferencesPage.qml diff --git a/src/appshell/qml/Main.qml b/src/appshell/qml/Main.qml deleted file mode 100644 index 7aaa0fec5687a..0000000000000 --- a/src/appshell/qml/Main.qml +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SPDX-License-Identifier: GPL-3.0-only - * MuseScore-Studio-CLA-applies - * - * MuseScore Studio - * Music Composition & Notation - * - * Copyright (C) 2021 MuseScore Limited - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -import QtQuick 2.15 -import QtQuick.Window 2.15 - -import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 - -import "../.." - -AppWindow { - id: root - - function toggleMaximized() { - if (root.visibility === Window.Maximized) { - root.showNormal() - } else { - root.showMaximized() - } - } - - FramelessWindowModel { - id: framelessWindowModel - - titleBarMoveArea: appTitleBar.titleMoveAreaRect - } - - Component.onCompleted: { - framelessWindowModel.init(this) - } - - AppTitleBar { - id: appTitleBar - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - - height: 48 - title: root.title - - onShowWindowMinimizedRequested: { - root.showMinimized() - } - - onToggleWindowMaximizedRequested: { - root.toggleMaximized() - } - - onCloseWindowRequested: { - root.close() - } - } - - WindowContent { - id: window - - anchors.top: appTitleBar.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - } -} diff --git a/src/appshell/qml/AboutDialog.qml b/src/appshell/qml/MuseScore/AppShell/AboutDialog.qml similarity index 99% rename from src/appshell/qml/AboutDialog.qml rename to src/appshell/qml/MuseScore/AppShell/AboutDialog.qml index f8f5a2a4d13af..2ded0c8e2c667 100644 --- a/src/appshell/qml/AboutDialog.qml +++ b/src/appshell/qml/MuseScore/AppShell/AboutDialog.qml @@ -25,7 +25,7 @@ import QtQuick.Layouts 1.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell StyledDialogView { id: root diff --git a/src/appshell/qml/AboutMusicXMLDialog.qml b/src/appshell/qml/MuseScore/AppShell/AboutMusicXMLDialog.qml similarity index 99% rename from src/appshell/qml/AboutMusicXMLDialog.qml rename to src/appshell/qml/MuseScore/AppShell/AboutMusicXMLDialog.qml index 108bced85a904..7f5ca1ae4a466 100644 --- a/src/appshell/qml/AboutMusicXMLDialog.qml +++ b/src/appshell/qml/MuseScore/AppShell/AboutMusicXMLDialog.qml @@ -24,7 +24,7 @@ import QtQuick.Layouts 1.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell StyledDialogView { id: root diff --git a/src/appshell/qml/AppWindow.qml b/src/appshell/qml/MuseScore/AppShell/AppWindow.qml similarity index 98% rename from src/appshell/qml/AppWindow.qml rename to src/appshell/qml/MuseScore/AppShell/AppWindow.qml index 1a9d0ae5133a4..b1e2a98ed9333 100644 --- a/src/appshell/qml/AppWindow.qml +++ b/src/appshell/qml/MuseScore/AppShell/AppWindow.qml @@ -24,7 +24,7 @@ import QtQuick.Controls 2.15 import Muse.Ui 1.0 import Muse.Shortcuts 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell ApplicationWindow { id: root diff --git a/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt b/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt new file mode 100644 index 0000000000000..763b7bfa9801e --- /dev/null +++ b/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: GPL-3.0-only +# MuseScore-Studio-CLA-applies +# +# MuseScore Studio +# Music Composition & Notation +# +# Copyright (C) 2024 MuseScore Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +qt_add_qml_module(appshell + URI MuseScore.AppShell + QML_FILES + AboutDialog.qml + AboutMusicXMLDialog.qml + AppWindow.qml + DevTools/CorruptScore/CorruptScoreDevTools.qml + DevTools/CrashHandler/CrashHandlerDevTools.qml + DevTools/DevToolsMenu.qml + DevTools/DevToolsPage.qml + DevTools/Extensions/ExtensionsListView.qml + DevTools/Gallery/GeneralComponentsGallery.qml + DevTools/Interactive/InteractiveTests.qml + DevTools/Interactive/SampleDialog.qml + DevTools/KeyNav/KeyNavExample.qml + DevTools/KeyNav/KeyNavSection.qml + DevTools/KeyNav/KeyNavSubSection.qml + DevTools/MPE/ArticulationsProfileEditorView.qml + DevTools/Preferences/SettingsPage.qml + FirstLaunchSetup/FirstLaunchSetupDialog.qml + FirstLaunchSetup/Page.qml + FirstLaunchSetup/PlaybackPage.qml + FirstLaunchSetup/ThemesPage.qml + FirstLaunchSetup/TutorialsPage.qml + HomePage/HomeMenu.qml + HomePage/HomePage.qml + HomePage/PluginsPage.qml + MainToolBar.qml + NotationPage/NotationPage.qml + NotationPage/NotationStatusBar.qml + Preferences/AdvancedPreferencesPage.qml + Preferences/AppearancePreferencesPage.qml + Preferences/AudioMidiPreferencesPage.qml + Preferences/BraillePreferencesPage.qml + Preferences/CanvasPreferencesPage.qml + Preferences/FoldersPreferencesPage.qml + Preferences/GeneralPreferencesPage.qml + Preferences/ImportPreferencesPage.qml + Preferences/MidiDeviceMappingPreferencesPage.qml + Preferences/NoteInputPreferencesPage.qml + Preferences/PercussionPreferencesPage.qml + Preferences/PreferencesDialog.qml + Preferences/PreferencesPage.qml + Preferences/SaveAndPublishPreferencesPage.qml + Preferences/ScorePreferencesPage.qml + Preferences/ShortcutsPreferencesPage.qml + Preferences/UpdatePreferencesPage.qml + Preferences/internal/AccentColorsSection.qml + Preferences/internal/AdvancedTopSection.qml + Preferences/internal/AudioApiSection.qml + Preferences/internal/AudioEngineSection.qml + Preferences/internal/AutoSaveSection.qml + Preferences/internal/AutomaticUpdateSection.qml + Preferences/internal/BaseSection.qml + Preferences/internal/BrailleAdvancedSection.qml + Preferences/internal/BrailleSection.qml + Preferences/internal/CharsetsSection.qml + Preferences/internal/ColorAndWallpaperSection.qml + Preferences/internal/ComboBoxWithTitle.qml + Preferences/internal/CommonAudioApiConfiguration.qml + Preferences/internal/DefaultFilesSection.qml + Preferences/internal/FoldersSection.qml + Preferences/internal/ImportStyleSection.qml + Preferences/internal/IncrementalPropertyControlWithTitle.qml + Preferences/internal/KeyboardLayoutsSection.qml + Preferences/internal/LanguagesSection.qml + Preferences/internal/MeiSection.qml + Preferences/internal/MidiDevicesSection.qml + Preferences/internal/MidiSection.qml + Preferences/internal/MiscellaneousSection.qml + Preferences/internal/MixerSection.qml + Preferences/internal/MusicXmlSection.qml + Preferences/internal/NoteInputPlaySection.qml + Preferences/internal/NoteInputSection.qml + Preferences/internal/PreferencesButtonsPanel.qml + Preferences/internal/PreferencesMenu.qml + Preferences/internal/ProgramStartSection.qml + Preferences/internal/PublishMuseScoreComSection.qml + Preferences/internal/RemoteControlSection.qml + Preferences/internal/SaveToCloudSection.qml + Preferences/internal/ScrollPagesSection.qml + Preferences/internal/ThemeAdditionalOptionsSection.qml + Preferences/internal/ThemesSection.qml + Preferences/internal/UiColorsSection.qml + Preferences/internal/UiFontSection.qml + Preferences/internal/ZoomSection.qml + PublishPage/PublishPage.qml + PublishPage/PublishToolBar.qml + WindowContent.qml + platform/AppButtonBackground.qml + platform/AppMenuBar.qml + platform/PlatformMenuBar.qml + platform/linux/Main.qml + platform/mac/Main.qml + platform/wasm/Main.qml + platform/win/AppSystemButtons.qml + platform/win/AppTitleBar.qml + platform/win/Main.qml + shared/AccentColorsList.qml + shared/ThemeSamplesList.qml + shared/internal/ThemeSample.qml + RESOURCES + FirstLaunchSetup/resources/MuseSounds.png + FirstLaunchSetup/resources/VideoTutorials.png + resources/mu_logo.svg +) diff --git a/src/appshell/qml/DevTools/CorruptScore/CorruptScoreDevTools.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/CorruptScore/CorruptScoreDevTools.qml similarity index 100% rename from src/appshell/qml/DevTools/CorruptScore/CorruptScoreDevTools.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/CorruptScore/CorruptScoreDevTools.qml diff --git a/src/appshell/qml/DevTools/CrashHandler/CrashHandlerDevTools.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/CrashHandler/CrashHandlerDevTools.qml similarity index 100% rename from src/appshell/qml/DevTools/CrashHandler/CrashHandlerDevTools.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/CrashHandler/CrashHandlerDevTools.qml diff --git a/src/appshell/qml/DevTools/DevToolsMenu.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/DevToolsMenu.qml similarity index 100% rename from src/appshell/qml/DevTools/DevToolsMenu.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/DevToolsMenu.qml diff --git a/src/appshell/qml/DevTools/DevToolsPage.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/DevToolsPage.qml similarity index 100% rename from src/appshell/qml/DevTools/DevToolsPage.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/DevToolsPage.qml diff --git a/src/appshell/qml/DevTools/Extensions/ExtensionsListView.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/Extensions/ExtensionsListView.qml similarity index 100% rename from src/appshell/qml/DevTools/Extensions/ExtensionsListView.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/Extensions/ExtensionsListView.qml diff --git a/src/appshell/qml/DevTools/Gallery/GeneralComponentsGallery.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/Gallery/GeneralComponentsGallery.qml similarity index 100% rename from src/appshell/qml/DevTools/Gallery/GeneralComponentsGallery.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/Gallery/GeneralComponentsGallery.qml diff --git a/src/appshell/qml/DevTools/Interactive/InteractiveTests.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/Interactive/InteractiveTests.qml similarity index 100% rename from src/appshell/qml/DevTools/Interactive/InteractiveTests.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/Interactive/InteractiveTests.qml diff --git a/src/appshell/qml/DevTools/Interactive/SampleDialog.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/Interactive/SampleDialog.qml similarity index 100% rename from src/appshell/qml/DevTools/Interactive/SampleDialog.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/Interactive/SampleDialog.qml diff --git a/src/appshell/qml/DevTools/KeyNav/KeyNavExample.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/KeyNav/KeyNavExample.qml similarity index 100% rename from src/appshell/qml/DevTools/KeyNav/KeyNavExample.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/KeyNav/KeyNavExample.qml diff --git a/src/appshell/qml/DevTools/KeyNav/KeyNavSection.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/KeyNav/KeyNavSection.qml similarity index 100% rename from src/appshell/qml/DevTools/KeyNav/KeyNavSection.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/KeyNav/KeyNavSection.qml diff --git a/src/appshell/qml/DevTools/KeyNav/KeyNavSubSection.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/KeyNav/KeyNavSubSection.qml similarity index 100% rename from src/appshell/qml/DevTools/KeyNav/KeyNavSubSection.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/KeyNav/KeyNavSubSection.qml diff --git a/src/appshell/qml/DevTools/MPE/ArticulationsProfileEditorView.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/MPE/ArticulationsProfileEditorView.qml similarity index 100% rename from src/appshell/qml/DevTools/MPE/ArticulationsProfileEditorView.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/MPE/ArticulationsProfileEditorView.qml diff --git a/src/appshell/qml/DevTools/Preferences/SettingsPage.qml b/src/appshell/qml/MuseScore/AppShell/DevTools/Preferences/SettingsPage.qml similarity index 100% rename from src/appshell/qml/DevTools/Preferences/SettingsPage.qml rename to src/appshell/qml/MuseScore/AppShell/DevTools/Preferences/SettingsPage.qml diff --git a/src/appshell/qml/FirstLaunchSetup/FirstLaunchSetupDialog.qml b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/FirstLaunchSetupDialog.qml similarity index 99% rename from src/appshell/qml/FirstLaunchSetup/FirstLaunchSetupDialog.qml rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/FirstLaunchSetupDialog.qml index 59787e8977fde..c52ab9f2ba43f 100644 --- a/src/appshell/qml/FirstLaunchSetup/FirstLaunchSetupDialog.qml +++ b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/FirstLaunchSetupDialog.qml @@ -24,7 +24,7 @@ import QtQuick.Layouts 1.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell StyledDialogView { id: root diff --git a/src/appshell/qml/FirstLaunchSetup/Page.qml b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/Page.qml similarity index 99% rename from src/appshell/qml/FirstLaunchSetup/Page.qml rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/Page.qml index fda31d54d683c..67a08cabf9f73 100644 --- a/src/appshell/qml/FirstLaunchSetup/Page.qml +++ b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/Page.qml @@ -23,7 +23,7 @@ import QtQuick 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell Item { id: root diff --git a/src/appshell/qml/FirstLaunchSetup/PlaybackPage.qml b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/PlaybackPage.qml similarity index 98% rename from src/appshell/qml/FirstLaunchSetup/PlaybackPage.qml rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/PlaybackPage.qml index 5010e3cf411ba..fc6d242835d59 100644 --- a/src/appshell/qml/FirstLaunchSetup/PlaybackPage.qml +++ b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/PlaybackPage.qml @@ -25,7 +25,7 @@ import QtQuick.Window 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 import Muse.GraphicalEffects 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell Page { title: qsTrc("appshell/gettingstarted", "Playback") diff --git a/src/appshell/qml/FirstLaunchSetup/ThemesPage.qml b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/ThemesPage.qml similarity index 99% rename from src/appshell/qml/FirstLaunchSetup/ThemesPage.qml rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/ThemesPage.qml index 885d93a248b7a..7a597003c52db 100644 --- a/src/appshell/qml/FirstLaunchSetup/ThemesPage.qml +++ b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/ThemesPage.qml @@ -24,7 +24,7 @@ import QtQuick.Layouts 1.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import "../shared" diff --git a/src/appshell/qml/FirstLaunchSetup/TutorialsPage.qml b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/TutorialsPage.qml similarity index 98% rename from src/appshell/qml/FirstLaunchSetup/TutorialsPage.qml rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/TutorialsPage.qml index a5f1d8d57a983..87734268185cf 100644 --- a/src/appshell/qml/FirstLaunchSetup/TutorialsPage.qml +++ b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/TutorialsPage.qml @@ -26,7 +26,7 @@ import QtQuick.Layouts 1.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 import Muse.GraphicalEffects 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell Page { title: qsTrc("appshell/gettingstarted", "Video tutorials") diff --git a/src/appshell/qml/FirstLaunchSetup/resources/MuseSounds.png b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/resources/MuseSounds.png similarity index 100% rename from src/appshell/qml/FirstLaunchSetup/resources/MuseSounds.png rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/resources/MuseSounds.png diff --git a/src/appshell/qml/FirstLaunchSetup/resources/VideoTutorials.png b/src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/resources/VideoTutorials.png similarity index 100% rename from src/appshell/qml/FirstLaunchSetup/resources/VideoTutorials.png rename to src/appshell/qml/MuseScore/AppShell/FirstLaunchSetup/resources/VideoTutorials.png diff --git a/src/appshell/qml/HomePage/HomeMenu.qml b/src/appshell/qml/MuseScore/AppShell/HomePage/HomeMenu.qml similarity index 100% rename from src/appshell/qml/HomePage/HomeMenu.qml rename to src/appshell/qml/MuseScore/AppShell/HomePage/HomeMenu.qml diff --git a/src/appshell/qml/HomePage/HomePage.qml b/src/appshell/qml/MuseScore/AppShell/HomePage/HomePage.qml similarity index 100% rename from src/appshell/qml/HomePage/HomePage.qml rename to src/appshell/qml/MuseScore/AppShell/HomePage/HomePage.qml diff --git a/src/appshell/qml/HomePage/PluginsPage.qml b/src/appshell/qml/MuseScore/AppShell/HomePage/PluginsPage.qml similarity index 100% rename from src/appshell/qml/HomePage/PluginsPage.qml rename to src/appshell/qml/MuseScore/AppShell/HomePage/PluginsPage.qml diff --git a/src/appshell/qml/MainToolBar.qml b/src/appshell/qml/MuseScore/AppShell/MainToolBar.qml similarity index 98% rename from src/appshell/qml/MainToolBar.qml rename to src/appshell/qml/MuseScore/AppShell/MainToolBar.qml index 9a4eb0a0229d0..a3086201c3b22 100644 --- a/src/appshell/qml/MainToolBar.qml +++ b/src/appshell/qml/MuseScore/AppShell/MainToolBar.qml @@ -24,7 +24,7 @@ import QtQuick.Controls 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell Item { id: root diff --git a/src/appshell/qml/NotationPage/NotationPage.qml b/src/appshell/qml/MuseScore/AppShell/NotationPage/NotationPage.qml similarity index 99% rename from src/appshell/qml/NotationPage/NotationPage.qml rename to src/appshell/qml/MuseScore/AppShell/NotationPage/NotationPage.qml index 488671a32e0d1..654b96cbe2e1b 100644 --- a/src/appshell/qml/NotationPage/NotationPage.qml +++ b/src/appshell/qml/MuseScore/AppShell/NotationPage/NotationPage.qml @@ -26,7 +26,7 @@ import Muse.Ui 1.0 import Muse.UiComponents 1.0 import Muse.Dock 1.0 import Muse.Extensions 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import MuseScore.NotationScene 1.0 import MuseScore.Palette 1.0 diff --git a/src/appshell/qml/NotationPage/NotationStatusBar.qml b/src/appshell/qml/MuseScore/AppShell/NotationPage/NotationStatusBar.qml similarity index 99% rename from src/appshell/qml/NotationPage/NotationStatusBar.qml rename to src/appshell/qml/MuseScore/AppShell/NotationPage/NotationStatusBar.qml index 0065a62ded903..6549da9cda957 100644 --- a/src/appshell/qml/NotationPage/NotationStatusBar.qml +++ b/src/appshell/qml/MuseScore/AppShell/NotationPage/NotationStatusBar.qml @@ -23,7 +23,7 @@ import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Layouts 1.15 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import Muse.UiComponents 1.0 import Muse.Ui 1.0 import MuseScore.NotationScene 1.0 diff --git a/src/appshell/qml/Preferences/AdvancedPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/AdvancedPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/AdvancedPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/AdvancedPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/AppearancePreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/AppearancePreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/AppearancePreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/AppearancePreferencesPage.qml diff --git a/src/appshell/qml/Preferences/AudioMidiPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/AudioMidiPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/AudioMidiPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/AudioMidiPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/BraillePreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/BraillePreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/BraillePreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/BraillePreferencesPage.qml diff --git a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/CanvasPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/CanvasPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/CanvasPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/FoldersPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/FoldersPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/FoldersPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/FoldersPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/GeneralPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/GeneralPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/GeneralPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/GeneralPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/ImportPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/ImportPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/ImportPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/ImportPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/MidiDeviceMappingPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/MidiDeviceMappingPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/MidiDeviceMappingPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/MidiDeviceMappingPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/NoteInputPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/NoteInputPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/NoteInputPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/PercussionPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/PercussionPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/PercussionPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/PercussionPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/PreferencesDialog.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/PreferencesDialog.qml similarity index 100% rename from src/appshell/qml/Preferences/PreferencesDialog.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/PreferencesDialog.qml diff --git a/src/appshell/qml/Preferences/PreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/PreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/PreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/PreferencesPage.qml diff --git a/src/appshell/qml/Preferences/SaveAndPublishPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/SaveAndPublishPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/SaveAndPublishPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/SaveAndPublishPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/ScorePreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/ScorePreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/ScorePreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/ScorePreferencesPage.qml diff --git a/src/appshell/qml/Preferences/ShortcutsPreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/ShortcutsPreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/ShortcutsPreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/ShortcutsPreferencesPage.qml diff --git a/src/appshell/qml/Preferences/UpdatePreferencesPage.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/UpdatePreferencesPage.qml similarity index 100% rename from src/appshell/qml/Preferences/UpdatePreferencesPage.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/UpdatePreferencesPage.qml diff --git a/src/appshell/qml/Preferences/internal/AccentColorsSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/AccentColorsSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/AccentColorsSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/AccentColorsSection.qml diff --git a/src/appshell/qml/Preferences/internal/AdvancedTopSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/AdvancedTopSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/AdvancedTopSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/AdvancedTopSection.qml diff --git a/src/appshell/qml/Preferences/internal/AudioApiSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/AudioApiSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/AudioApiSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/AudioApiSection.qml diff --git a/src/appshell/qml/Preferences/internal/AudioEngineSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/AudioEngineSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/AudioEngineSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/AudioEngineSection.qml diff --git a/src/appshell/qml/Preferences/internal/AutoSaveSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/AutoSaveSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/AutoSaveSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/AutoSaveSection.qml diff --git a/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/AutomaticUpdateSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/AutomaticUpdateSection.qml diff --git a/src/appshell/qml/Preferences/internal/BaseSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/BaseSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/BaseSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/BaseSection.qml diff --git a/src/appshell/qml/Preferences/internal/BrailleAdvancedSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/BrailleAdvancedSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/BrailleAdvancedSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/BrailleAdvancedSection.qml diff --git a/src/appshell/qml/Preferences/internal/BrailleSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/BrailleSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/BrailleSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/BrailleSection.qml diff --git a/src/appshell/qml/Preferences/internal/CharsetsSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/CharsetsSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/CharsetsSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/CharsetsSection.qml diff --git a/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ColorAndWallpaperSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ColorAndWallpaperSection.qml diff --git a/src/appshell/qml/Preferences/internal/ComboBoxWithTitle.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ComboBoxWithTitle.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ComboBoxWithTitle.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ComboBoxWithTitle.qml diff --git a/src/appshell/qml/Preferences/internal/CommonAudioApiConfiguration.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/CommonAudioApiConfiguration.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/CommonAudioApiConfiguration.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/CommonAudioApiConfiguration.qml diff --git a/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/DefaultFilesSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/DefaultFilesSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/DefaultFilesSection.qml diff --git a/src/appshell/qml/Preferences/internal/FoldersSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/FoldersSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/FoldersSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/FoldersSection.qml diff --git a/src/appshell/qml/Preferences/internal/ImportStyleSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ImportStyleSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ImportStyleSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ImportStyleSection.qml diff --git a/src/appshell/qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/IncrementalPropertyControlWithTitle.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/IncrementalPropertyControlWithTitle.qml diff --git a/src/appshell/qml/Preferences/internal/KeyboardLayoutsSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/KeyboardLayoutsSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/KeyboardLayoutsSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/KeyboardLayoutsSection.qml diff --git a/src/appshell/qml/Preferences/internal/LanguagesSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/LanguagesSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/LanguagesSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/LanguagesSection.qml diff --git a/src/appshell/qml/Preferences/internal/MeiSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/MeiSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/MeiSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/MeiSection.qml diff --git a/src/appshell/qml/Preferences/internal/MidiDevicesSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/MidiDevicesSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/MidiDevicesSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/MidiDevicesSection.qml diff --git a/src/appshell/qml/Preferences/internal/MidiSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/MidiSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/MidiSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/MidiSection.qml diff --git a/src/appshell/qml/Preferences/internal/MiscellaneousSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/MiscellaneousSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/MiscellaneousSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/MiscellaneousSection.qml diff --git a/src/appshell/qml/Preferences/internal/MixerSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/MixerSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/MixerSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/MixerSection.qml diff --git a/src/appshell/qml/Preferences/internal/MusicXmlSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/MusicXmlSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/MusicXmlSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/MusicXmlSection.qml diff --git a/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/NoteInputPlaySection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/NoteInputPlaySection.qml diff --git a/src/appshell/qml/Preferences/internal/NoteInputSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/NoteInputSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/NoteInputSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/NoteInputSection.qml diff --git a/src/appshell/qml/Preferences/internal/PreferencesButtonsPanel.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/PreferencesButtonsPanel.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/PreferencesButtonsPanel.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/PreferencesButtonsPanel.qml diff --git a/src/appshell/qml/Preferences/internal/PreferencesMenu.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/PreferencesMenu.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/PreferencesMenu.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/PreferencesMenu.qml diff --git a/src/appshell/qml/Preferences/internal/ProgramStartSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ProgramStartSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ProgramStartSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ProgramStartSection.qml diff --git a/src/appshell/qml/Preferences/internal/PublishMuseScoreComSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/PublishMuseScoreComSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/PublishMuseScoreComSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/PublishMuseScoreComSection.qml diff --git a/src/appshell/qml/Preferences/internal/RemoteControlSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/RemoteControlSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/RemoteControlSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/RemoteControlSection.qml diff --git a/src/appshell/qml/Preferences/internal/SaveToCloudSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/SaveToCloudSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/SaveToCloudSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/SaveToCloudSection.qml diff --git a/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ScrollPagesSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ScrollPagesSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ScrollPagesSection.qml diff --git a/src/appshell/qml/Preferences/internal/ThemeAdditionalOptionsSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ThemeAdditionalOptionsSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ThemeAdditionalOptionsSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ThemeAdditionalOptionsSection.qml diff --git a/src/appshell/qml/Preferences/internal/ThemesSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ThemesSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ThemesSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ThemesSection.qml diff --git a/src/appshell/qml/Preferences/internal/UiColorsSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/UiColorsSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/UiColorsSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/UiColorsSection.qml diff --git a/src/appshell/qml/Preferences/internal/UiFontSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/UiFontSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/UiFontSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/UiFontSection.qml diff --git a/src/appshell/qml/Preferences/internal/ZoomSection.qml b/src/appshell/qml/MuseScore/AppShell/Preferences/internal/ZoomSection.qml similarity index 100% rename from src/appshell/qml/Preferences/internal/ZoomSection.qml rename to src/appshell/qml/MuseScore/AppShell/Preferences/internal/ZoomSection.qml diff --git a/src/appshell/qml/PublishPage/PublishPage.qml b/src/appshell/qml/MuseScore/AppShell/PublishPage/PublishPage.qml similarity index 99% rename from src/appshell/qml/PublishPage/PublishPage.qml rename to src/appshell/qml/MuseScore/AppShell/PublishPage/PublishPage.qml index bf861dcbcecb5..7f4b2fb1f5d58 100644 --- a/src/appshell/qml/PublishPage/PublishPage.qml +++ b/src/appshell/qml/MuseScore/AppShell/PublishPage/PublishPage.qml @@ -23,7 +23,7 @@ import QtQuick 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import Muse.Dock 1.0 import MuseScore.NotationScene 1.0 diff --git a/src/appshell/qml/PublishPage/PublishToolBar.qml b/src/appshell/qml/MuseScore/AppShell/PublishPage/PublishToolBar.qml similarity index 97% rename from src/appshell/qml/PublishPage/PublishToolBar.qml rename to src/appshell/qml/MuseScore/AppShell/PublishPage/PublishToolBar.qml index 34afc1b159ecb..87765a64dd29b 100644 --- a/src/appshell/qml/PublishPage/PublishToolBar.qml +++ b/src/appshell/qml/MuseScore/AppShell/PublishPage/PublishToolBar.qml @@ -24,7 +24,7 @@ import QtQuick 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell StyledToolBarView { navigationPanel.name: "PublishToolBar" diff --git a/src/appshell/qml/WindowContent.qml b/src/appshell/qml/MuseScore/AppShell/WindowContent.qml similarity index 95% rename from src/appshell/qml/WindowContent.qml rename to src/appshell/qml/MuseScore/AppShell/WindowContent.qml index 6b05954025b43..d748254e30a4b 100644 --- a/src/appshell/qml/WindowContent.qml +++ b/src/appshell/qml/MuseScore/AppShell/WindowContent.qml @@ -23,14 +23,14 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import Muse.Dock 1.0 -import MuseScore.AppShell 1.0 +// import MuseScore.AppShell import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import "./HomePage" -import "./NotationPage" -import "./PublishPage" -import "./DevTools" +// import "./HomePage" +// import "./NotationPage" +// import "./PublishPage" +// import "./DevTools" DockWindow { id: root diff --git a/src/appshell/qml/platform/AppButtonBackground.qml b/src/appshell/qml/MuseScore/AppShell/platform/AppButtonBackground.qml similarity index 100% rename from src/appshell/qml/platform/AppButtonBackground.qml rename to src/appshell/qml/MuseScore/AppShell/platform/AppButtonBackground.qml diff --git a/src/appshell/qml/platform/AppMenuBar.qml b/src/appshell/qml/MuseScore/AppShell/platform/AppMenuBar.qml similarity index 99% rename from src/appshell/qml/platform/AppMenuBar.qml rename to src/appshell/qml/MuseScore/AppShell/platform/AppMenuBar.qml index 1fde77e51978a..2169a3be92558 100644 --- a/src/appshell/qml/platform/AppMenuBar.qml +++ b/src/appshell/qml/MuseScore/AppShell/platform/AppMenuBar.qml @@ -23,7 +23,7 @@ import QtQuick 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell ListView { id: root diff --git a/src/appshell/qml/platform/PlatformMenuBar.qml b/src/appshell/qml/MuseScore/AppShell/platform/PlatformMenuBar.qml similarity index 99% rename from src/appshell/qml/platform/PlatformMenuBar.qml rename to src/appshell/qml/MuseScore/AppShell/platform/PlatformMenuBar.qml index d0e82bf9b1a32..86cef51030e74 100644 --- a/src/appshell/qml/platform/PlatformMenuBar.qml +++ b/src/appshell/qml/MuseScore/AppShell/platform/PlatformMenuBar.qml @@ -22,7 +22,7 @@ import QtQuick 2.15 import Qt.labs.platform 1.1 as PLATFORM -import MuseScore.AppShell 1.0 +import MuseScore.AppShell Item { id: root diff --git a/src/appshell/qml/platform/linux/Main.qml b/src/appshell/qml/MuseScore/AppShell/platform/linux/Main.qml similarity index 100% rename from src/appshell/qml/platform/linux/Main.qml rename to src/appshell/qml/MuseScore/AppShell/platform/linux/Main.qml diff --git a/src/appshell/qml/platform/mac/Main.qml b/src/appshell/qml/MuseScore/AppShell/platform/mac/Main.qml similarity index 94% rename from src/appshell/qml/platform/mac/Main.qml rename to src/appshell/qml/MuseScore/AppShell/platform/mac/Main.qml index 38b8743d7ed0b..02f02a577deb9 100644 --- a/src/appshell/qml/platform/mac/Main.qml +++ b/src/appshell/qml/MuseScore/AppShell/platform/mac/Main.qml @@ -19,9 +19,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -import QtQuick 2.15 +import QtQuick +import QtQuick.Controls -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import "../" import "../../" diff --git a/src/appshell/qml/Main.wasm.qml b/src/appshell/qml/MuseScore/AppShell/platform/wasm/Main.qml similarity index 100% rename from src/appshell/qml/Main.wasm.qml rename to src/appshell/qml/MuseScore/AppShell/platform/wasm/Main.qml diff --git a/src/appshell/qml/platform/win/AppSystemButtons.qml b/src/appshell/qml/MuseScore/AppShell/platform/win/AppSystemButtons.qml similarity index 100% rename from src/appshell/qml/platform/win/AppSystemButtons.qml rename to src/appshell/qml/MuseScore/AppShell/platform/win/AppSystemButtons.qml diff --git a/src/appshell/qml/platform/win/AppTitleBar.qml b/src/appshell/qml/MuseScore/AppShell/platform/win/AppTitleBar.qml similarity index 99% rename from src/appshell/qml/platform/win/AppTitleBar.qml rename to src/appshell/qml/MuseScore/AppShell/platform/win/AppTitleBar.qml index 3152d9d015857..6febb39d170fc 100644 --- a/src/appshell/qml/platform/win/AppTitleBar.qml +++ b/src/appshell/qml/MuseScore/AppShell/platform/win/AppTitleBar.qml @@ -25,7 +25,7 @@ import QtQuick.Window 2.15 import Muse.Ui 1.0 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import "../" diff --git a/src/appshell/qml/platform/win/Main.qml b/src/appshell/qml/MuseScore/AppShell/platform/win/Main.qml similarity index 98% rename from src/appshell/qml/platform/win/Main.qml rename to src/appshell/qml/MuseScore/AppShell/platform/win/Main.qml index 690354072abfe..b9cb31eb1ab47 100644 --- a/src/appshell/qml/platform/win/Main.qml +++ b/src/appshell/qml/MuseScore/AppShell/platform/win/Main.qml @@ -23,7 +23,7 @@ import QtQuick 2.15 import QtQuick.Window 2.15 import Muse.UiComponents 1.0 -import MuseScore.AppShell 1.0 +import MuseScore.AppShell import "../../" diff --git a/src/appshell/qml/resources/mu_logo.svg b/src/appshell/qml/MuseScore/AppShell/resources/mu_logo.svg similarity index 100% rename from src/appshell/qml/resources/mu_logo.svg rename to src/appshell/qml/MuseScore/AppShell/resources/mu_logo.svg diff --git a/src/appshell/qml/shared/AccentColorsList.qml b/src/appshell/qml/MuseScore/AppShell/shared/AccentColorsList.qml similarity index 100% rename from src/appshell/qml/shared/AccentColorsList.qml rename to src/appshell/qml/MuseScore/AppShell/shared/AccentColorsList.qml diff --git a/src/appshell/qml/shared/ThemeSamplesList.qml b/src/appshell/qml/MuseScore/AppShell/shared/ThemeSamplesList.qml similarity index 97% rename from src/appshell/qml/shared/ThemeSamplesList.qml rename to src/appshell/qml/MuseScore/AppShell/shared/ThemeSamplesList.qml index b0382b600e514..2b1d21bac185e 100644 --- a/src/appshell/qml/shared/ThemeSamplesList.qml +++ b/src/appshell/qml/MuseScore/AppShell/shared/ThemeSamplesList.qml @@ -65,8 +65,8 @@ ListView { spacing: 64 delegate: Column { - width: sampleWidth - height: sampleHeight + width: root.sampleWidth + height: root.sampleHeight spacing: 16 diff --git a/src/appshell/qml/shared/internal/ThemeSample.qml b/src/appshell/qml/MuseScore/AppShell/shared/internal/ThemeSample.qml similarity index 100% rename from src/appshell/qml/shared/internal/ThemeSample.qml rename to src/appshell/qml/MuseScore/AppShell/shared/internal/ThemeSample.qml From 5d3b1c2702018126315ac8f9dfa6a8d0bde032f0 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Tue, 29 Oct 2024 03:05:26 +0100 Subject: [PATCH 16/18] Fix AppShell qml dialogs --- src/appshell/appshellmodule.cpp | 10 +++++----- .../qml/MuseScore/AppShell/AboutDialog.qml | 2 +- src/framework/ui/iinteractiveuriregister.h | 5 +++++ .../ui/qml/Muse/Ui/InteractiveProvider.qml | 14 +++++++------- src/framework/ui/uitypes.h | 3 +++ src/framework/ui/view/interactiveprovider.cpp | 1 + 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/appshell/appshellmodule.cpp b/src/appshell/appshellmodule.cpp index 0100dd25538f9..572ae9c9ade62 100644 --- a/src/appshell/appshellmodule.cpp +++ b/src/appshell/appshellmodule.cpp @@ -123,11 +123,11 @@ void AppShellModule::resolveImports() ir->registerUri(Uri("musescore://sequencer"), ContainerMeta(ContainerType::PrimaryPage)); ir->registerUri(Uri("musescore://publish"), ContainerMeta(ContainerType::PrimaryPage)); ir->registerUri(Uri("musescore://devtools"), ContainerMeta(ContainerType::PrimaryPage)); - ir->registerUri(Uri("musescore://about/musescore"), ContainerMeta(ContainerType::QmlDialog, "AboutDialog.qml")); - ir->registerUri(Uri("musescore://about/musicxml"), ContainerMeta(ContainerType::QmlDialog, "AboutMusicXMLDialog.qml")); - ir->registerUri(Uri("musescore://firstLaunchSetup"), - ContainerMeta(ContainerType::QmlDialog, "FirstLaunchSetup/FirstLaunchSetupDialog.qml")); - ir->registerUri(Uri("muse://preferences"), ContainerMeta(ContainerType::QmlDialog, "Preferences/PreferencesDialog.qml")); + + ir->registerQmlUri(Uri("musescore://about/musescore"), "MuseScore.AppShell", "AboutDialog"); + ir->registerQmlUri(Uri("musescore://about/musicxml"), "MuseScore.AppShell", "AboutMusicXMLDialog"); + ir->registerQmlUri(Uri("musescore://firstLaunchSetup"), "MuseScore.AppShell", "FirstLaunchSetupDialog"); + ir->registerQmlUri(Uri("muse://preferences"), "MuseScore.AppShell", "PreferencesDialog"); } } diff --git a/src/appshell/qml/MuseScore/AppShell/AboutDialog.qml b/src/appshell/qml/MuseScore/AppShell/AboutDialog.qml index 2ded0c8e2c667..dfad70f745c54 100644 --- a/src/appshell/qml/MuseScore/AppShell/AboutDialog.qml +++ b/src/appshell/qml/MuseScore/AppShell/AboutDialog.qml @@ -58,7 +58,7 @@ StyledDialogView { id: logo Layout.alignment: Qt.AlignHCenter - source: "qrc:/qml/resources/mu_logo.svg" + source: "resources/mu_logo.svg" sourceSize: Qt.size(100, 100) MouseArea { diff --git a/src/framework/ui/iinteractiveuriregister.h b/src/framework/ui/iinteractiveuriregister.h index fc95e8a4530f3..9566ec4afaeff 100644 --- a/src/framework/ui/iinteractiveuriregister.h +++ b/src/framework/ui/iinteractiveuriregister.h @@ -45,6 +45,11 @@ class IInteractiveUriRegister : MODULE_EXPORT_INTERFACE registerUri(uri, ContainerMeta(ContainerType::Type::QmlDialog, qmlPath)); } + void registerQmlUri(const Uri& uri, const QString& qmlModule, const QString& qmlPath) + { + registerUri(uri, ContainerMeta(ContainerType::Type::QmlDialog, qmlModule, qmlPath)); + } + template void registerWidgetUri(const Uri& uri) { diff --git a/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml b/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml index 64bcb7c7c2ad1..f9812316d19fa 100644 --- a/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml +++ b/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml @@ -66,9 +66,9 @@ Item { } if (page.type === ContainerType.QmlDialog) { - var dialogPath = "../../" + page.path + var dialogPath = page.module ? page.path : "../../" + page.path - var dialogObj = root.createDialog(dialogPath, page.params) + var dialogObj = root.createDialog(page.module, dialogPath, page.params) data.setValue("ret", dialogObj.ret) data.setValue("objectId", dialogObj.object.objectId) @@ -86,7 +86,7 @@ Item { function onFireOpenStandardDialog(data) { var dialog = data.data() - var dialogObj = root.createDialog("internal/StandardDialog.qml", dialog.params) + var dialogObj = root.createDialog("", "internal/StandardDialog.qml", dialog.params) data.setValue("ret", dialogObj.ret) data.setValue("objectId", dialogObj.object.objectId) @@ -116,7 +116,7 @@ Item { var dialog = data.data() var dialogObj = null if (dialog.selectFolder) { - dialogObj = root.createDialog("internal/FolderDialog.qml", dialog.params) + dialogObj = root.createDialog("", "internal/FolderDialog.qml", dialog.params) } else { dialogObj = root.createDialog("internal/FileDialog.qml", dialog.params) } @@ -133,7 +133,7 @@ Item { function onFireOpenProgressDialog(data) { var dialog = data.data() - var dialogObj = createDialog("internal/ProgressDialog.qml", dialog.params) + var dialogObj = root.createDialog("", "internal/ProgressDialog.qml", dialog.params) data.setValue("ret", dialogObj.ret) data.setValue("objectId", dialogObj.object.objectId) @@ -145,8 +145,8 @@ Item { } } - function createDialog(path, params) { - var comp = Qt.createComponent(path) + function createDialog(module, path, params) { + var comp = module ? Qt.createComponent(module, path) : Qt.createComponent(path) if (comp.status !== Component.Ready) { console.log("[qml] failed create component: " + path + ", err: " + comp.errorString()) return { "ret": { "errcode": 102 } } // CreateFailed diff --git a/src/framework/ui/uitypes.h b/src/framework/ui/uitypes.h index 0bceb8137e9fd..275e0fb9946b8 100644 --- a/src/framework/ui/uitypes.h +++ b/src/framework/ui/uitypes.h @@ -154,6 +154,7 @@ class ContainerType struct ContainerMeta { ContainerType::Type type = ContainerType::Undefined; + QString qmlModule; QString qmlPath; int widgetMetaTypeId = QMetaType::UnknownType; @@ -163,6 +164,8 @@ struct ContainerMeta : type(type) {} ContainerMeta(const ContainerType::Type& type, const QString& qmlPath) : type(type), qmlPath(qmlPath) {} + ContainerMeta(const ContainerType::Type& type, const QString& qmlModule, const QString& qmlPath) + : type(type), qmlModule(qmlModule), qmlPath(qmlPath) {} ContainerMeta(const ContainerType::Type& type, int widgetMetaTypeId) : type(type), widgetMetaTypeId(widgetMetaTypeId) {} }; diff --git a/src/framework/ui/view/interactiveprovider.cpp b/src/framework/ui/view/interactiveprovider.cpp index 7b3c7b76f7cdf..82a858a7fcae0 100644 --- a/src/framework/ui/view/interactiveprovider.cpp +++ b/src/framework/ui/view/interactiveprovider.cpp @@ -391,6 +391,7 @@ void InteractiveProvider::fillExtData(QmlLaunchData* data, const UriQuery& q) co void InteractiveProvider::fillData(QmlLaunchData* data, const UriQuery& q) const { ContainerMeta meta = uriRegister()->meta(q.uri()); + data->setValue("module", meta.qmlModule); data->setValue("path", meta.qmlPath); data->setValue("type", meta.type); data->setValue("uri", QString::fromStdString(q.uri().toString())); From eb03f7bf9f2c21468b255ebdebecdff03f6743a5 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Tue, 29 Oct 2024 03:06:32 +0100 Subject: [PATCH 17/18] More robust error handling in InteractiveProvider.qml When an error occurs while creating a component, don't cause even more errors by reading from `null` at `dialogObj.object.objectId` --- .../ui/qml/Muse/Ui/InteractiveProvider.qml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml b/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml index f9812316d19fa..b7b0ac98ae2aa 100644 --- a/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml +++ b/src/framework/ui/qml/Muse/Ui/InteractiveProvider.qml @@ -70,12 +70,13 @@ Item { var dialogObj = root.createDialog(page.module, dialogPath, page.params) data.setValue("ret", dialogObj.ret) - data.setValue("objectId", dialogObj.object.objectId) if (dialogObj.ret.errcode > 0) { return } + data.setValue("objectId", dialogObj.object.objectId) + if (Boolean(data.value("sync")) && data.value("sync") === true) { dialogObj.object.exec() } else { @@ -118,16 +119,17 @@ Item { if (dialog.selectFolder) { dialogObj = root.createDialog("", "internal/FolderDialog.qml", dialog.params) } else { - dialogObj = root.createDialog("internal/FileDialog.qml", dialog.params) + dialogObj = root.createDialog("", "internal/FileDialog.qml", dialog.params) } data.setValue("ret", dialogObj.ret) - data.setValue("objectId", dialogObj.object.objectId) if (dialogObj.ret.errcode > 0) { return } + data.setValue("objectId", dialogObj.object.objectId) + dialogObj.object.open() } @@ -135,12 +137,13 @@ Item { var dialog = data.data() var dialogObj = root.createDialog("", "internal/ProgressDialog.qml", dialog.params) data.setValue("ret", dialogObj.ret) - data.setValue("objectId", dialogObj.object.objectId) if (dialogObj.ret.errcode > 0) { return } + data.setValue("objectId", dialogObj.object.objectId) + dialogObj.object.open() } } @@ -148,7 +151,7 @@ Item { function createDialog(module, path, params) { var comp = module ? Qt.createComponent(module, path) : Qt.createComponent(path) if (comp.status !== Component.Ready) { - console.log("[qml] failed create component: " + path + ", err: " + comp.errorString()) + console.error("Could not create component: " + path + ", err: " + comp.errorString()) return { "ret": { "errcode": 102 } } // CreateFailed } From 38f29a614f6e40a428dc68f7b4563c0f7ea9ca51 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:28:41 +0100 Subject: [PATCH 18/18] CMake: Work around Qt bug --- src/appshell/CMakeLists.txt | 1 + src/appshell/qml/MuseScore/AppShell/CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/appshell/CMakeLists.txt b/src/appshell/CMakeLists.txt index c70cc421b0e86..869d51ce3d9b6 100644 --- a/src/appshell/CMakeLists.txt +++ b/src/appshell/CMakeLists.txt @@ -155,3 +155,4 @@ endif() setup_module() add_subdirectory(qml/MuseScore/AppShell) +target_link_libraries(appshell PRIVATE appshellqmlplugin) diff --git a/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt b/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt index 763b7bfa9801e..6100b1c99dffa 100644 --- a/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt +++ b/src/appshell/qml/MuseScore/AppShell/CMakeLists.txt @@ -18,7 +18,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -qt_add_qml_module(appshell +# Workaround for https://bugreports.qt.io/browse/QTBUG-122702 +# preferred way would be no extra `appshellqml` library, and just passing `appshell` to `qt_add_qml_module` +qt_add_library(appshellqml) + +qt_add_qml_module(appshellqml URI MuseScore.AppShell QML_FILES AboutDialog.qml