diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index d09b385b87e..91f70ca05ef 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -76,11 +76,24 @@ jobs: endif() set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}") - file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS) + foreach(retry RANGE 10) + file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS) + file(SIZE ./ninja.zip fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip) set(cmake_url "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-${cmake_suffix}") - file(DOWNLOAD "${cmake_url}" ./cmake.zip SHOW_PROGRESS) + foreach(retry RANGE 10) + file(DOWNLOAD "${cmake_url}" ./cmake.zip SHOW_PROGRESS) + file(SIZE ./cmake.zip fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./cmake.zip) # Add to PATH environment variable @@ -357,7 +370,13 @@ jobs: shell: cmake -P {0} run: | set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz") - file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS) + foreach(retry RANGE 10) + file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS) + file(SIZE ./ccache.tar.xz fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz) - name: Prepare ccache archive name @@ -393,11 +412,19 @@ jobs: string(JSON name GET "${artifact_js}" "name") if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}") string(JSON download_url GET "${artifact_js}" "archive_download_url") - file(DOWNLOAD "${download_url}" - "${{ steps.ccache.outputs.archive_name }}.zip" - NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt" - NETRC REQUIRED - SHOW_PROGRESS) + + foreach(retry RANGE 10) + file(DOWNLOAD "${download_url}" + "${{ steps.ccache.outputs.archive_name }}.zip" + NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt" + NETRC REQUIRED + SHOW_PROGRESS) + file(SIZE "${{ steps.ccache.outputs.archive_name }}.zip" fileSize) + if (fileSize GREATER 0) + break() + endif() + endforeach() + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip") file(MAKE_DIRECTORY .ccache) execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache) @@ -541,6 +568,7 @@ jobs: run: | include(ProcessorCount) ProcessorCount(N) + math(EXPR N "(75 * ${N}) / 100") set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") diff --git a/cmake/Findyaml-cpp.cmake b/cmake/Findyaml-cpp.cmake index e4630ed7201..277d8069e0a 100644 --- a/cmake/Findyaml-cpp.cmake +++ b/cmake/Findyaml-cpp.cmake @@ -9,7 +9,7 @@ find_package(yaml-cpp 0.5 QUIET NO_MODULE) if (yaml-cpp_FOUND) # target doesn't set include directory for some reason - get_filename_component(yaml_cpp_include_dir ${YAML_CPP_INCLUDE_DIR} ABSOLUTE) + get_filename_component(yaml_cpp_include_dir "${YAML_CPP_INCLUDE_DIR}" ABSOLUTE) if (NOT EXISTS yaml_cpp_include_dir) unset(yaml_cpp_include_dir) unset(yaml_cpp_include_dir CACHE) diff --git a/doc/qtcreator/config/qtcreator-project.qdocconf b/doc/qtcreator/config/qtcreator-project.qdocconf index b190e87ea12..468e4e6f988 100644 --- a/doc/qtcreator/config/qtcreator-project.qdocconf +++ b/doc/qtcreator/config/qtcreator-project.qdocconf @@ -15,21 +15,7 @@ ignorewords += \ headerdirs = sourcedirs = ../src -imagedirs = ../images \ - ../../../src/libs/qmleditorwidgets/images \ - ../../../src/libs/utils/images \ - ../../../src/plugins/android/images \ - ../../../src/plugins/autotest/images \ - ../../../src/plugins/classview/images \ - ../../../src/plugins/coreplugin/images \ - ../../../src/plugins/debugger/images \ - ../../../src/plugins/diffeditor/images \ - ../../../src/plugins/help/images \ - ../../../src/plugins/projectexplorer/images \ - ../../../src/plugins/scxmleditor/common/images \ - ../../../src/plugins/texteditor/images \ - ../../../src/plugins/valgrind/images \ - ../../../src/plugins/welcome/images +imagedirs = ../images exampledirs = ../examples examples.fileextensions += *.qml *.svg diff --git a/doc/qtcreator/images/icons/align-center-horizontal.png b/doc/qtcreator/images/icons/align-center-horizontal.png deleted file mode 100644 index d0af695e8df..00000000000 Binary files a/doc/qtcreator/images/icons/align-center-horizontal.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/align-left.png b/doc/qtcreator/images/icons/align-left.png deleted file mode 100644 index 3552235feb9..00000000000 Binary files a/doc/qtcreator/images/icons/align-left.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/align-right.png b/doc/qtcreator/images/icons/align-right.png deleted file mode 100644 index 68d8ac7d3b1..00000000000 Binary files a/doc/qtcreator/images/icons/align-right.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/align-top.png b/doc/qtcreator/images/icons/align-top.png deleted file mode 100644 index 00568f56809..00000000000 Binary files a/doc/qtcreator/images/icons/align-top.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/anchor-bottom.png b/doc/qtcreator/images/icons/anchor-bottom.png deleted file mode 100644 index e6ab30a9ecb..00000000000 Binary files a/doc/qtcreator/images/icons/anchor-bottom.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/anchor-center-vertical.png b/doc/qtcreator/images/icons/anchor-center-vertical.png deleted file mode 100644 index cdea461bd3d..00000000000 Binary files a/doc/qtcreator/images/icons/anchor-center-vertical.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/anchor-fill.png b/doc/qtcreator/images/icons/anchor-fill.png deleted file mode 100644 index 64a27939323..00000000000 Binary files a/doc/qtcreator/images/icons/anchor-fill.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/anchor-left.png b/doc/qtcreator/images/icons/anchor-left.png deleted file mode 100644 index f3ebeab5000..00000000000 Binary files a/doc/qtcreator/images/icons/anchor-left.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/anchor-right.png b/doc/qtcreator/images/icons/anchor-right.png deleted file mode 100644 index 43609aa397c..00000000000 Binary files a/doc/qtcreator/images/icons/anchor-right.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/anchor-top.png b/doc/qtcreator/images/icons/anchor-top.png deleted file mode 100644 index 896930eb640..00000000000 Binary files a/doc/qtcreator/images/icons/anchor-top.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/annotation.png b/doc/qtcreator/images/icons/annotation.png deleted file mode 100644 index 59333eeef03..00000000000 Binary files a/doc/qtcreator/images/icons/annotation.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/arrowdown.png b/doc/qtcreator/images/icons/arrowdown.png new file mode 100644 index 00000000000..fff77a48e65 Binary files /dev/null and b/doc/qtcreator/images/icons/arrowdown.png differ diff --git a/doc/qtcreator/images/icons/arrowup.png b/doc/qtcreator/images/icons/arrowup.png new file mode 100644 index 00000000000..c1058ce1eed Binary files /dev/null and b/doc/qtcreator/images/icons/arrowup.png differ diff --git a/doc/qtcreator/images/icons/bookmark.png b/doc/qtcreator/images/icons/bookmark.png new file mode 100644 index 00000000000..4e2a562ac01 Binary files /dev/null and b/doc/qtcreator/images/icons/bookmark.png differ diff --git a/doc/qtcreator/images/icons/buildstepdisable.png b/doc/qtcreator/images/icons/buildstepdisable.png new file mode 100644 index 00000000000..2c715aa254d Binary files /dev/null and b/doc/qtcreator/images/icons/buildstepdisable.png differ diff --git a/doc/qtcreator/images/icons/clean_pane_small.png b/doc/qtcreator/images/icons/clean_pane_small.png new file mode 100644 index 00000000000..c75262d64a1 Binary files /dev/null and b/doc/qtcreator/images/icons/clean_pane_small.png differ diff --git a/doc/qtcreator/images/icons/debugger_singleinstructionmode.png b/doc/qtcreator/images/icons/debugger_singleinstructionmode.png new file mode 100644 index 00000000000..41529e91fdb Binary files /dev/null and b/doc/qtcreator/images/icons/debugger_singleinstructionmode.png differ diff --git a/doc/qtcreator/images/icons/debugger_stepinto_small.png b/doc/qtcreator/images/icons/debugger_stepinto_small.png new file mode 100644 index 00000000000..8e24fba5a24 Binary files /dev/null and b/doc/qtcreator/images/icons/debugger_stepinto_small.png differ diff --git a/doc/qtcreator/images/icons/debugger_stepout_small.png b/doc/qtcreator/images/icons/debugger_stepout_small.png new file mode 100644 index 00000000000..615c022419d Binary files /dev/null and b/doc/qtcreator/images/icons/debugger_stepout_small.png differ diff --git a/doc/qtcreator/images/icons/debugger_stepover_small.png b/doc/qtcreator/images/icons/debugger_stepover_small.png new file mode 100644 index 00000000000..e7dc6fb20be Binary files /dev/null and b/doc/qtcreator/images/icons/debugger_stepover_small.png differ diff --git a/doc/qtcreator/images/icons/desktopdevicesmall.png b/doc/qtcreator/images/icons/desktopdevicesmall.png new file mode 100644 index 00000000000..adc2b78bcea Binary files /dev/null and b/doc/qtcreator/images/icons/desktopdevicesmall.png differ diff --git a/doc/qtcreator/images/icons/detach-group-icon.png b/doc/qtcreator/images/icons/detach-group-icon.png deleted file mode 100644 index 8155f07a8f2..00000000000 Binary files a/doc/qtcreator/images/icons/detach-group-icon.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-bottom.png b/doc/qtcreator/images/icons/distribute-bottom.png deleted file mode 100644 index dccb5b535ae..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-bottom.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-center-horizontal.png b/doc/qtcreator/images/icons/distribute-center-horizontal.png deleted file mode 100644 index 5ad6d0dff91..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-center-horizontal.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-center-vertical.png b/doc/qtcreator/images/icons/distribute-center-vertical.png deleted file mode 100644 index 1b6cc09588b..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-center-vertical.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-left.png b/doc/qtcreator/images/icons/distribute-left.png deleted file mode 100644 index 92ce603cace..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-left.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-origin-bottom-right.png b/doc/qtcreator/images/icons/distribute-origin-bottom-right.png deleted file mode 100644 index ed679229597..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-origin-bottom-right.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-origin-none.png b/doc/qtcreator/images/icons/distribute-origin-none.png deleted file mode 100644 index c4966559612..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-origin-none.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-origin-top-left.png b/doc/qtcreator/images/icons/distribute-origin-top-left.png deleted file mode 100644 index 3f20b449b59..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-origin-top-left.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-right.png b/doc/qtcreator/images/icons/distribute-right.png deleted file mode 100644 index 54527947409..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-right.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-spacing-horizontal.png b/doc/qtcreator/images/icons/distribute-spacing-horizontal.png deleted file mode 100644 index a416a9f8d21..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-spacing-horizontal.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/distribute-spacing-vertical.png b/doc/qtcreator/images/icons/distribute-spacing-vertical.png deleted file mode 100644 index bd1fb1a21e3..00000000000 Binary files a/doc/qtcreator/images/icons/distribute-spacing-vertical.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/easing-curve-linear-icon.png b/doc/qtcreator/images/icons/easing-curve-linear-icon.png deleted file mode 100644 index 1e97dccc7ed..00000000000 Binary files a/doc/qtcreator/images/icons/easing-curve-linear-icon.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/easing-curve-spline-icon.png b/doc/qtcreator/images/icons/easing-curve-spline-icon.png deleted file mode 100644 index 3a4bc695fc9..00000000000 Binary files a/doc/qtcreator/images/icons/easing-curve-spline-icon.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/easing-curve-step-icon.png b/doc/qtcreator/images/icons/easing-curve-step-icon.png deleted file mode 100644 index ce1ec8917aa..00000000000 Binary files a/doc/qtcreator/images/icons/easing-curve-step-icon.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/filtericon.png b/doc/qtcreator/images/icons/filtericon.png new file mode 100644 index 00000000000..1afcb471b0d Binary files /dev/null and b/doc/qtcreator/images/icons/filtericon.png differ diff --git a/doc/qtcreator/images/icons/fittoview.png b/doc/qtcreator/images/icons/fittoview.png new file mode 100644 index 00000000000..6b9d1329f74 Binary files /dev/null and b/doc/qtcreator/images/icons/fittoview.png differ diff --git a/doc/qtcreator/images/icons/icon-export-canvas.png b/doc/qtcreator/images/icons/icon-export-canvas.png new file mode 100644 index 00000000000..cd6f0cea56a Binary files /dev/null and b/doc/qtcreator/images/icons/icon-export-canvas.png differ diff --git a/doc/qtcreator/images/icons/kcachegrind.png b/doc/qtcreator/images/icons/kcachegrind.png new file mode 100644 index 00000000000..67792f2224e Binary files /dev/null and b/doc/qtcreator/images/icons/kcachegrind.png differ diff --git a/doc/qtcreator/images/icons/leafsort.png b/doc/qtcreator/images/icons/leafsort.png new file mode 100644 index 00000000000..c9f744bde7c Binary files /dev/null and b/doc/qtcreator/images/icons/leafsort.png differ diff --git a/doc/qtcreator/images/icons/leftsidebaricon.png b/doc/qtcreator/images/icons/leftsidebaricon.png new file mode 100644 index 00000000000..413bed7c49f Binary files /dev/null and b/doc/qtcreator/images/icons/leftsidebaricon.png differ diff --git a/doc/qtcreator/images/icons/linkicon.png b/doc/qtcreator/images/icons/linkicon.png new file mode 100644 index 00000000000..b205b3eaf13 Binary files /dev/null and b/doc/qtcreator/images/icons/linkicon.png differ diff --git a/doc/qtcreator/images/icons/lockon.png b/doc/qtcreator/images/icons/lockon.png deleted file mode 100644 index 35f98eb7f31..00000000000 Binary files a/doc/qtcreator/images/icons/lockon.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/magnifier.png b/doc/qtcreator/images/icons/magnifier.png new file mode 100644 index 00000000000..692a32d9a36 Binary files /dev/null and b/doc/qtcreator/images/icons/magnifier.png differ diff --git a/doc/qtcreator/images/icons/minus.png b/doc/qtcreator/images/icons/minus.png new file mode 100644 index 00000000000..0a16b386817 Binary files /dev/null and b/doc/qtcreator/images/icons/minus.png differ diff --git a/doc/qtcreator/images/icons/namespace.png b/doc/qtcreator/images/icons/namespace.png new file mode 100644 index 00000000000..b36b2a4acfe Binary files /dev/null and b/doc/qtcreator/images/icons/namespace.png differ diff --git a/doc/qtcreator/images/icons/navigator.png b/doc/qtcreator/images/icons/navigator.png new file mode 100644 index 00000000000..d4629fd8964 Binary files /dev/null and b/doc/qtcreator/images/icons/navigator.png differ diff --git a/doc/qtcreator/images/icons/next.png b/doc/qtcreator/images/icons/next.png new file mode 100644 index 00000000000..5ab267510e6 Binary files /dev/null and b/doc/qtcreator/images/icons/next.png differ diff --git a/doc/qtcreator/images/icons/online.png b/doc/qtcreator/images/icons/online.png new file mode 100644 index 00000000000..2e053b8792d Binary files /dev/null and b/doc/qtcreator/images/icons/online.png differ diff --git a/doc/qtcreator/images/icons/open.png b/doc/qtcreator/images/icons/open.png new file mode 100644 index 00000000000..938f1a33321 Binary files /dev/null and b/doc/qtcreator/images/icons/open.png differ diff --git a/doc/qtcreator/images/icons/pan.png b/doc/qtcreator/images/icons/pan.png new file mode 100644 index 00000000000..753b3bf02ba Binary files /dev/null and b/doc/qtcreator/images/icons/pan.png differ diff --git a/doc/qtcreator/images/icons/pin.png b/doc/qtcreator/images/icons/pin.png index ac65f66815e..dc96231ca4b 100644 Binary files a/doc/qtcreator/images/icons/pin.png and b/doc/qtcreator/images/icons/pin.png differ diff --git a/doc/qtcreator/images/icons/plus.png b/doc/qtcreator/images/icons/plus.png new file mode 100644 index 00000000000..795229ec6c5 Binary files /dev/null and b/doc/qtcreator/images/icons/plus.png differ diff --git a/doc/qtcreator/images/icons/prev.png b/doc/qtcreator/images/icons/prev.png new file mode 100644 index 00000000000..c9bd18a7de6 Binary files /dev/null and b/doc/qtcreator/images/icons/prev.png differ diff --git a/doc/qtcreator/images/icons/qtcreator-analyze-start-button.png b/doc/qtcreator/images/icons/qtcreator-analyze-start-button.png new file mode 100644 index 00000000000..e957775c955 Binary files /dev/null and b/doc/qtcreator/images/icons/qtcreator-analyze-start-button.png differ diff --git a/doc/qtcreator/images/icons/qtcreator-anchors-reset-icon.png b/doc/qtcreator/images/icons/qtcreator-anchors-reset-icon.png new file mode 100644 index 00000000000..8107e3c4987 Binary files /dev/null and b/doc/qtcreator/images/icons/qtcreator-anchors-reset-icon.png differ diff --git a/doc/qtcreator/images/icons/qtcreator-debug-button-stop.png b/doc/qtcreator/images/icons/qtcreator-debug-button-stop.png new file mode 100644 index 00000000000..66251c53de9 Binary files /dev/null and b/doc/qtcreator/images/icons/qtcreator-debug-button-stop.png differ diff --git a/doc/qtcreator/images/qtcreator-debug-button.png b/doc/qtcreator/images/icons/qtcreator-debug-button.png similarity index 100% rename from doc/qtcreator/images/qtcreator-debug-button.png rename to doc/qtcreator/images/icons/qtcreator-debug-button.png diff --git a/doc/qtcreator/images/icons/qtcreator-debugging-continue.png b/doc/qtcreator/images/icons/qtcreator-debugging-continue.png new file mode 100644 index 00000000000..27b5feb2d8b Binary files /dev/null and b/doc/qtcreator/images/icons/qtcreator-debugging-continue.png differ diff --git a/doc/qtcreator/images/icons/qtcreator-desktopdevice-button.png b/doc/qtcreator/images/icons/qtcreator-desktopdevice-button.png new file mode 100644 index 00000000000..f72969f9729 Binary files /dev/null and b/doc/qtcreator/images/icons/qtcreator-desktopdevice-button.png differ diff --git a/doc/qtcreator/images/qtcreator-expand.png b/doc/qtcreator/images/icons/qtcreator-expand.png similarity index 100% rename from doc/qtcreator/images/qtcreator-expand.png rename to doc/qtcreator/images/icons/qtcreator-expand.png diff --git a/doc/qtcreator/images/icons/qtcreator-new-search-icon.png b/doc/qtcreator/images/icons/qtcreator-new-search-icon.png new file mode 100644 index 00000000000..4c5cc8782bc Binary files /dev/null and b/doc/qtcreator/images/icons/qtcreator-new-search-icon.png differ diff --git a/doc/qtcreator/images/qtcreator-run-failed-tests.png b/doc/qtcreator/images/icons/qtcreator-run-failed-tests.png similarity index 100% rename from doc/qtcreator/images/qtcreator-run-failed-tests.png rename to doc/qtcreator/images/icons/qtcreator-run-failed-tests.png diff --git a/doc/qtcreator/images/qtcreator-run-selected-tests.png b/doc/qtcreator/images/icons/qtcreator-run-selected-tests.png similarity index 100% rename from doc/qtcreator/images/qtcreator-run-selected-tests.png rename to doc/qtcreator/images/icons/qtcreator-run-selected-tests.png diff --git a/doc/qtcreator/images/qtcreator-run-tests-in-current-file.png b/doc/qtcreator/images/icons/qtcreator-run-tests-in-current-file.png similarity index 100% rename from doc/qtcreator/images/qtcreator-run-tests-in-current-file.png rename to doc/qtcreator/images/icons/qtcreator-run-tests-in-current-file.png diff --git a/doc/qtcreator/images/qtcreator-show-subprojects.png b/doc/qtcreator/images/icons/qtcreator-show-subprojects.png similarity index 100% rename from doc/qtcreator/images/qtcreator-show-subprojects.png rename to doc/qtcreator/images/icons/qtcreator-show-subprojects.png diff --git a/doc/qtcreator/images/qtcreator-unclaimed-breakpoint-icon.png b/doc/qtcreator/images/icons/qtcreator-unclaimed-breakpoint-icon.png similarity index 100% rename from doc/qtcreator/images/qtcreator-unclaimed-breakpoint-icon.png rename to doc/qtcreator/images/icons/qtcreator-unclaimed-breakpoint-icon.png diff --git a/doc/qtcreator/images/icons/recordfill.png b/doc/qtcreator/images/icons/recordfill.png new file mode 100644 index 00000000000..57dc3054c83 Binary files /dev/null and b/doc/qtcreator/images/icons/recordfill.png differ diff --git a/doc/qtcreator/images/icons/redo.png b/doc/qtcreator/images/icons/redo.png new file mode 100644 index 00000000000..082e8d1f746 Binary files /dev/null and b/doc/qtcreator/images/icons/redo.png differ diff --git a/doc/qtcreator/images/icons/refactormarker.png b/doc/qtcreator/images/icons/refactormarker.png new file mode 100644 index 00000000000..b51a33ab0aa Binary files /dev/null and b/doc/qtcreator/images/icons/refactormarker.png differ diff --git a/doc/qtcreator/images/icons/reload_gray.png b/doc/qtcreator/images/icons/reload_gray.png new file mode 100644 index 00000000000..3b5644c2af6 Binary files /dev/null and b/doc/qtcreator/images/icons/reload_gray.png differ diff --git a/doc/qtcreator/images/icons/replace.png b/doc/qtcreator/images/icons/replace.png new file mode 100644 index 00000000000..67783537508 Binary files /dev/null and b/doc/qtcreator/images/icons/replace.png differ diff --git a/doc/qtcreator/images/icons/reset.png b/doc/qtcreator/images/icons/reset.png new file mode 100644 index 00000000000..fc20531780e Binary files /dev/null and b/doc/qtcreator/images/icons/reset.png differ diff --git a/doc/qtcreator/images/icons/rightsidebaricon.png b/doc/qtcreator/images/icons/rightsidebaricon.png new file mode 100644 index 00000000000..95df5c3b9be Binary files /dev/null and b/doc/qtcreator/images/icons/rightsidebaricon.png differ diff --git a/doc/qtcreator/images/icons/rotation-cursor.png b/doc/qtcreator/images/icons/rotation-cursor.png deleted file mode 100644 index 33ff9a73f1d..00000000000 Binary files a/doc/qtcreator/images/icons/rotation-cursor.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/run_small.png b/doc/qtcreator/images/icons/run_small.png new file mode 100644 index 00000000000..d1a9c205a5e Binary files /dev/null and b/doc/qtcreator/images/icons/run_small.png differ diff --git a/doc/qtcreator/images/icons/settings.png b/doc/qtcreator/images/icons/settings.png new file mode 100644 index 00000000000..2621923499c Binary files /dev/null and b/doc/qtcreator/images/icons/settings.png differ diff --git a/doc/qtcreator/images/icons/sidebysidediff.png b/doc/qtcreator/images/icons/sidebysidediff.png new file mode 100644 index 00000000000..21dfa6a0a52 Binary files /dev/null and b/doc/qtcreator/images/icons/sidebysidediff.png differ diff --git a/doc/qtcreator/images/icons/snapshot.png b/doc/qtcreator/images/icons/snapshot.png new file mode 100644 index 00000000000..c8a731d41e1 Binary files /dev/null and b/doc/qtcreator/images/icons/snapshot.png differ diff --git a/doc/qtcreator/images/icons/sort_alphabetically.png b/doc/qtcreator/images/icons/sort_alphabetically.png new file mode 100644 index 00000000000..c15eb56d50a Binary files /dev/null and b/doc/qtcreator/images/icons/sort_alphabetically.png differ diff --git a/doc/qtcreator/images/icons/splitbutton_closetop.png b/doc/qtcreator/images/icons/splitbutton_closetop.png new file mode 100644 index 00000000000..4f58e4eae91 Binary files /dev/null and b/doc/qtcreator/images/icons/splitbutton_closetop.png differ diff --git a/doc/qtcreator/images/icons/splitbutton_horizontal.png b/doc/qtcreator/images/icons/splitbutton_horizontal.png new file mode 100644 index 00000000000..2a8f953b8bd Binary files /dev/null and b/doc/qtcreator/images/icons/splitbutton_horizontal.png differ diff --git a/doc/qtcreator/images/statistics.png b/doc/qtcreator/images/icons/statistics.png similarity index 100% rename from doc/qtcreator/images/statistics.png rename to doc/qtcreator/images/icons/statistics.png diff --git a/doc/qtcreator/images/icons/stop_small.png b/doc/qtcreator/images/icons/stop_small.png new file mode 100644 index 00000000000..50571390da8 Binary files /dev/null and b/doc/qtcreator/images/icons/stop_small.png differ diff --git a/doc/qtcreator/images/icons/text.png b/doc/qtcreator/images/icons/text.png new file mode 100644 index 00000000000..7d4c35c70e6 Binary files /dev/null and b/doc/qtcreator/images/icons/text.png differ diff --git a/doc/qtcreator/images/icons/transparent.png b/doc/qtcreator/images/icons/transparent.png deleted file mode 100644 index 3f9bffcac5a..00000000000 Binary files a/doc/qtcreator/images/icons/transparent.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/unifieddiff.png b/doc/qtcreator/images/icons/unifieddiff.png new file mode 100644 index 00000000000..ff989cd5d28 Binary files /dev/null and b/doc/qtcreator/images/icons/unifieddiff.png differ diff --git a/doc/qtcreator/images/icons/visibilityon.png b/doc/qtcreator/images/icons/visibilityon.png deleted file mode 100644 index a7e0aed963e..00000000000 Binary files a/doc/qtcreator/images/icons/visibilityon.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/visual.png b/doc/qtcreator/images/icons/visual.png new file mode 100644 index 00000000000..62fd49061f5 Binary files /dev/null and b/doc/qtcreator/images/icons/visual.png differ diff --git a/doc/qtcreator/images/icons/zoom.png b/doc/qtcreator/images/icons/zoom.png new file mode 100644 index 00000000000..a3e9dd0b6be Binary files /dev/null and b/doc/qtcreator/images/icons/zoom.png differ diff --git a/doc/qtcreator/images/qml-toolbar-pin.png b/doc/qtcreator/images/qml-toolbar-pin.png deleted file mode 100644 index 8fce27b9867..00000000000 Binary files a/doc/qtcreator/images/qml-toolbar-pin.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-analyze-start-button.png b/doc/qtcreator/images/qtcreator-analyze-start-button.png deleted file mode 100644 index 6bf2dba9052..00000000000 Binary files a/doc/qtcreator/images/qtcreator-analyze-start-button.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-anchors-reset-icon.png b/doc/qtcreator/images/qtcreator-anchors-reset-icon.png deleted file mode 100644 index 41ca745f9c6..00000000000 Binary files a/doc/qtcreator/images/qtcreator-anchors-reset-icon.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-debug-button-stop.png b/doc/qtcreator/images/qtcreator-debug-button-stop.png deleted file mode 100644 index 48899e8a551..00000000000 Binary files a/doc/qtcreator/images/qtcreator-debug-button-stop.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-debugging-continue.png b/doc/qtcreator/images/qtcreator-debugging-continue.png deleted file mode 100644 index a8e93de8204..00000000000 Binary files a/doc/qtcreator/images/qtcreator-debugging-continue.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-desktopdevice-button.png b/doc/qtcreator/images/qtcreator-desktopdevice-button.png deleted file mode 100644 index a7ad611f7c3..00000000000 Binary files a/doc/qtcreator/images/qtcreator-desktopdevice-button.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-new-search-icon.png b/doc/qtcreator/images/qtcreator-new-search-icon.png deleted file mode 100644 index f56c935446b..00000000000 Binary files a/doc/qtcreator/images/qtcreator-new-search-icon.png and /dev/null differ diff --git a/doc/qtcreator/images/refactormarker.png b/doc/qtcreator/images/refactormarker.png deleted file mode 100644 index 4a6a61219a0..00000000000 Binary files a/doc/qtcreator/images/refactormarker.png and /dev/null differ diff --git a/doc/qtcreator/images/replace.png b/doc/qtcreator/images/replace.png deleted file mode 100644 index d963646da92..00000000000 Binary files a/doc/qtcreator/images/replace.png and /dev/null differ diff --git a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc index eb9e8ce4495..c9d9fe89b4f 100644 --- a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc @@ -70,7 +70,7 @@ profile the current application. \li Select the - \inlineimage qtcreator-analyze-start-button.png + \inlineimage icons/qtcreator-analyze-start-button.png (\uicontrol Start) button to start the application from the \uicontrol {Performance Analyzer}. @@ -79,7 +79,7 @@ \endlist \note If data collection does not start automatically, select the - \inlineimage recordfill.png + \inlineimage icons/recordfill.png (\uicontrol {Collect profile data}) button. When you start analyzing an application, the application is launched, and diff --git a/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc b/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc index 706d7cf7da7..c4d61e1c012 100644 --- a/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc @@ -60,7 +60,7 @@ need to set them up separately. In addition to running the tools to collect diagnostics, you can select - \inlineimage open.png + \inlineimage icons/open.png to load diagnostics from \l{https://yaml.org/}{YAML} files that you exported using the \c {-export fixes} option. @@ -69,7 +69,7 @@ To run the Clang tools to analyze the currently open file: \list - \li Select the \inlineimage debugger_singleinstructionmode.png + \li Select the \inlineimage icons/debugger_singleinstructionmode.png (\uicontrol {Analyze File}) button on the editor toolbar. \li Select \uicontrol Tools > \uicontrol {C++} > \uicontrol {Analyze Current File}. @@ -96,7 +96,7 @@ \note If you select \uicontrol Debug in the mode selector to open the \uicontrol Debug mode and then select \uicontrol {Clang-Tidy and Clazy}, - you must select the \inlineimage qtcreator-analyze-start-button.png + you must select the \inlineimage icons/qtcreator-analyze-start-button.png (\uicontrol Start) button to open the \uicontrol {Files to Analyze} dialog. @@ -109,14 +109,14 @@ hovering the mouse pointer over the icon next to the check box. To see more information about an issue that is marked with the - \inlineimage refactormarker.png + \inlineimage icons/refactormarker.png icon, hover the mouse pointer over the line. You can disable particular type of checks either globally or for a particular project by selecting \uicontrol {Disable This Check} or \uicontrol {Disable These Checks} in the context menu. - Select the \inlineimage settings.png + Select the \inlineimage icons/settings.png button to customize Clang diagnostics for the current project. \image qtcreator-clang-tools-options-customized.png "Clang Tools customized settings" diff --git a/doc/qtcreator/src/analyze/creator-ctf-visualizer.qdoc b/doc/qtcreator/src/analyze/creator-ctf-visualizer.qdoc index 87f63f95e44..68e1296e425 100644 --- a/doc/qtcreator/src/analyze/creator-ctf-visualizer.qdoc +++ b/doc/qtcreator/src/analyze/creator-ctf-visualizer.qdoc @@ -96,7 +96,7 @@ To reset the default zoom level, right-click the timeline to open the context menu, and select \uicontrol {Reset Zoom}. - Select the \inlineimage filtericon.png + Select the \inlineimage icons/filtericon.png (\uicontrol {Restrict to Threads}) button (10) to select the threads to show. diff --git a/doc/qtcreator/src/analyze/creator-valgrind.qdoc b/doc/qtcreator/src/analyze/creator-valgrind.qdoc index 249879fa5d1..6baf3d5d799 100644 --- a/doc/qtcreator/src/analyze/creator-valgrind.qdoc +++ b/doc/qtcreator/src/analyze/creator-valgrind.qdoc @@ -59,12 +59,12 @@ select \uicontrol Memcheck on the toolbar. \li Select the - \inlineimage qtcreator-analyze-start-button.png "Start button" + \inlineimage icons/qtcreator-analyze-start-button.png "Start button" button to start the application. \li Use the application to analyze it. - \li Select the \inlineimage stop_small.png "Stop button" + \li Select the \inlineimage icons/stop_small.png "Stop button" button to view the results of the analysis in the \uicontrol {Analysis} view. @@ -76,7 +76,7 @@ Click a line to view where a memory leak occurred and a stack trace that shows what caused it. - As an alternative to collecting data, you can select \inlineimage open.png + As an alternative to collecting data, you can select \inlineimage icons/open.png to load an external log file in XML format into the \uicontrol Memcheck view. @@ -84,11 +84,11 @@ Move the mouse on a row to view more information about the function. - To move between rows, select \inlineimage prev.png - or \inlineimage next.png + To move between rows, select \inlineimage icons/prev.png + or \inlineimage icons/next.png . - To filter the results, select \inlineimage filtericon.png + To filter the results, select \inlineimage icons/filtericon.png , and then select the types of issues to display in the view. You can view and hide definite and possible memory leaks, uninitialized values, invalid calls to \c free(), and external errors. @@ -218,12 +218,12 @@ \image qtcreator-valgrind-callgrind-toolbar.png "Callgrind view toolbar" \li Select the - \inlineimage qtcreator-analyze-start-button.png "Start button" + \inlineimage icons/qtcreator-analyze-start-button.png "Start button" button to start the application. \li Use the application to analyze it. - \li Select the \inlineimage stop_small.png "Stop button" + \li Select the \inlineimage icons/stop_small.png "Stop button" button to view the results of the analysis in the \uicontrol Functions view. @@ -233,13 +233,13 @@ to speed up program execution during profiling by pausing event logging. No events are counted while logging is paused. - Select \inlineimage reload_gray.png + Select \inlineimage icons/reload_gray.png to reset all event counters. - Select \inlineimage clean_pane_small.png + Select \inlineimage icons/clean_pane_small.png to discard all collected data. - Select \inlineimage kcachegrind.png + Select \inlineimage icons/kcachegrind.png to view the data in KCachegrind. \QC launches KCachegrind and loads the data into it for visualization. @@ -251,10 +251,11 @@ Select \uicontrol Views to show and hide views and view titles. The \uicontrol Visualization view is hidden by - default. Select \inlineimage redo.png + default. Select \inlineimage icons/redo.png to refresh the data displayed in it when it is shown. - As an alternative to collecting data, you can select \inlineimage open.png + As an alternative to collecting data, you can select + \inlineimage icons/open.png to load an external log file into the \uicontrol Callgrind views. \image qtcreator-valgrind-callgrind.png "Callgrind views" @@ -268,13 +269,13 @@ the \uicontrol Callers view and about the called functions in the \uicontrol Callees view. - Select \inlineimage prev.png - or \inlineimage next.png + Select \inlineimage icons/prev.png + or \inlineimage icons/next.png To move between functions in the \uicontrol Callee view. To set the cost format, select \uicontrol $. You can view absolute or relative costs, as well as relative costs to parent. Select - \inlineimage filtericon.png + \inlineimage icons/filtericon.png to view only profiling info that originated from the project. To properly handle recursive or circular function calls, enable cycle diff --git a/doc/qtcreator/src/android/androiddev.qdoc b/doc/qtcreator/src/android/androiddev.qdoc index d66a1468b5b..cda10b5a287 100644 --- a/doc/qtcreator/src/android/androiddev.qdoc +++ b/doc/qtcreator/src/android/androiddev.qdoc @@ -91,7 +91,7 @@ By default, \QC tries to find a supported \l{AdoptOpenJDK} or \l{OpenJDK} installation. If none is found, you must set the path manually. If you don't have a supported JDK installed, select - \inlineimage online.png + \inlineimage icons/online.png to open the JDK download web page in the default browser. \note We recommended using a 64-bit JDK, because the 32-bit one @@ -182,7 +182,7 @@ be modified from the SDK Manager tab. For more information, see \l{Managing Android SDK Packages}. - To manually download NDKs, select \inlineimage online.png + To manually download NDKs, select \inlineimage icons/online.png . To add custom NDK paths manually to the global list of NDKs, select diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 16dd3cee47f..31e4780e608 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -126,11 +126,12 @@ \image qtcreator-build-cmake-output.png "CMake output in Projects mode" - To clear the search results, select the \inlineimage clean_pane_small.png + To clear the search results, select the \inlineimage icons/clean_pane_small.png (\uicontrol Clear) button. You can enter a string in the \uicontrol Filter field to filter output. - To specify filtering options, select the \inlineimage magnifier.png "Filtering options menu" + To specify filtering options, select the + \inlineimage icons/magnifier.png "Filtering options menu" button. You can filter output by using regular expressions or case-sensitivity. Select \uicontrol {Show Non-matching Lines} to hide the lines that match the filter. @@ -138,8 +139,8 @@ Press \key {Ctrl+F} to \l{Finding and Replacing}{search} for a string from the output. - To increase or decrease the output text size, select \inlineimage plus.png - (\uicontrol {Zoom In}) or \inlineimage minus.png + To increase or decrease the output text size, select \inlineimage icons/plus.png + (\uicontrol {Zoom In}) or \inlineimage icons/minus.png (\uicontrol {Zoom Out}), or press \key Ctrl++ or \key Ctrl+-. \section1 CMake Build Steps diff --git a/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc b/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc index 4abf8997e7d..7da912a6f31 100644 --- a/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc +++ b/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc @@ -67,7 +67,7 @@ Unclaimed breakpoints are stored as a part of a session and exist independently of whether a program is being debugged or not. They are listed in the \uicontrol {Breakpoint Preset} view and in the - editor using the \inlineimage qtcreator-unclaimed-breakpoint-icon.png + editor using the \inlineimage icons/qtcreator-unclaimed-breakpoint-icon.png (\uicontrol {Unclaimed Breakpoint}) icon, when they refer to a position in code. diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-example.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-example.qdoc index 7efb6bd0e6f..1ef64237a43 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-example.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-example.qdoc @@ -107,10 +107,10 @@ If you compile and run the above code, however, the application does not work correctly due to a logic error. To locate this logic error, step through the code using the following buttons: - \inlineimage qtcreator-debug-button-stop.png - (\uicontrol {Stop Debugger}), \inlineimage debugger_stepover_small.png - (\uicontrol {Step Over}), \inlineimage debugger_stepinto_small.png - (\uicontrol {Step Into}), and \inlineimage debugger_stepout_small.png + \inlineimage icons/qtcreator-debug-button-stop.png + (\uicontrol {Stop Debugger}), \inlineimage icons/debugger_stepover_small.png + (\uicontrol {Step Over}), \inlineimage icons/debugger_stepinto_small.png + (\uicontrol {Step Into}), and \inlineimage icons/debugger_stepout_small.png (\uicontrol {Step Out}). */ diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 29f0e534af0..28265fb9319 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -53,7 +53,7 @@ \li \l{Launching the Debugger} To start an application from an open project under the control - of a debugger, select the \inlineimage qtcreator-debug-button.png + of a debugger, select the \inlineimage icons/qtcreator-debug-button.png (\uicontrol {Start Debugging of Startup Project}) button or press \key F5. Other, less common start options are available in the \uicontrol Debug > \uicontrol {Start Debugging} menu. @@ -104,7 +104,7 @@ \title Launching the Debugger To start an application from an open project under the control of a - debugger, select the \inlineimage qtcreator-debug-button.png + debugger, select the \inlineimage icons/qtcreator-debug-button.png (\uicontrol {Start Debugging of Startup Project}) button or press \key F5. \QC checks whether the compiled program is up-to-date, and rebuilds and @@ -786,7 +786,8 @@ To access the \uicontrol Disassembler view, check \uicontrol Debug > \uicontrol {Operate by Instruction} while the debugger is - running. Alternatively, click the \inlineimage debugger_singleinstructionmode.png + running. Alternatively, click the + \inlineimage icons/debugger_singleinstructionmode.png (\uicontrol {Operate by Instruction}) tool button on the debugger tool bar. By default, GDB shows AT&T style disassembly. To switch to the Intel style, diff --git a/doc/qtcreator/src/debugger/qtquick-debugger-example.qdoc b/doc/qtcreator/src/debugger/qtquick-debugger-example.qdoc index 24ab6934eb9..dd63e607b10 100644 --- a/doc/qtcreator/src/debugger/qtquick-debugger-example.qdoc +++ b/doc/qtcreator/src/debugger/qtquick-debugger-example.qdoc @@ -79,7 +79,7 @@ \image qtquick-example-setting-breakpoint2.png - \li Click the \inlineimage debugger_stepinto_small.png + \li Click the \inlineimage icons/debugger_stepinto_small.png (\uicontrol {Step Into}) button on the toolbar or press \key F11 to step into the code in the stack. The samegame.js file opens in the code editor at the function that starts a new game. @@ -91,7 +91,7 @@ the view. \li Add a breakpoint at the end of the \c {startNewGame()} function, and - click \inlineimage qtcreator-debugging-continue.png + click \inlineimage icons/qtcreator-debugging-continue.png (\uicontrol Continue) to hit the breakpoint. \image qtquick-example-setting-breakpoint3.png diff --git a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc index 00114ade7bc..371aaeee16c 100644 --- a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc +++ b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc @@ -103,22 +103,22 @@ \list \li To go directly to an instance, double-click the instance in the \uicontrol {Search Results} pane. - \li To move between instances, click the \inlineimage next.png - (\uicontrol {Next Item}) button and \inlineimage prev.png + \li To move between instances, click the \inlineimage icons/next.png + (\uicontrol {Next Item}) button and \inlineimage icons/prev.png (\uicontrol {Previous Item}) button in the \uicontrol {Search Results} pane. \li To expand and collapse the list of all instances, click the - \inlineimage qtcreator-expand.png + \inlineimage icons/qtcreator-expand.png (\uicontrol {Expand All}) button. \li To filter the search results for the usage of symbols according to access type, such as read, write, or declaration, click the - \inlineimage filtericon.png + \inlineimage icons/filtericon.png (\uicontrol {Filter Tree}) button and select the access type. \li To clear the search results, click the - \inlineimage clean_pane_small.png + \inlineimage icons/clean_pane_small.png (\uicontrol Clear) button. \li To start a new search, click the - \inlineimage qtcreator-new-search-icon.png + \inlineimage icons/qtcreator-new-search-icon.png (\uicontrol {New Search}) button. \endlist diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index 7ba22031edc..65e41022e37 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -57,7 +57,7 @@ When using the Clang code model, errors and warnings are additionally marked with icons and annotated. If a \l{http://clang.llvm.org/diagnostics.html} {Clang fix-it} is available, you can execute it by clicking the - \inlineimage refactormarker.png + \inlineimage icons/refactormarker.png icon and pressing \key Enter. In the following screenshot, a Qt class name contains a typo: diff --git a/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc index c2c6c1f2eaf..1d1ef00d613 100644 --- a/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc @@ -62,8 +62,8 @@ to navigate between open files and symbols in use. To browse backward or forward through your - location history, click \inlineimage prev.png - (\uicontrol {Go Back}) and \inlineimage next.png + location history, click \inlineimage icons/prev.png + (\uicontrol {Go Back}) and \inlineimage icons/next.png (\uicontrol {Go Forward}). To return to the last location where you made a change, select @@ -151,7 +151,7 @@ \li To split the editor view into a top and bottom view, select \uicontrol Window > \uicontrol Split, press \key {Ctrl+E, 2}, or - select the \inlineimage splitbutton_horizontal.png + select the \inlineimage icons/splitbutton_horizontal.png (\uicontrol Split) button and then select \uicontrol Split. Split command creates views below the currently active editor view. @@ -179,7 +179,7 @@ To remove a split view, place the cursor within the view you want to remove and select \uicontrol Window > \uicontrol {Remove Current Split}, - press \key {Ctrl+E, 0}, or select the \inlineimage splitbutton_closetop.png + press \key {Ctrl+E, 0}, or select the \inlineimage icons/splitbutton_closetop.png (\uicontrol {Remove Split}) button. To remove all but the currently selected split view, select \uicontrol Window > \uicontrol {Remove All Splits} or press \key {Ctrl+E, 1}. diff --git a/doc/qtcreator/src/editors/creator-diff-editor.qdoc b/doc/qtcreator/src/editors/creator-diff-editor.qdoc index 6614729293e..a0a65b50ebc 100644 --- a/doc/qtcreator/src/editors/creator-diff-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-diff-editor.qdoc @@ -94,11 +94,11 @@ removed text and then select \uicontrol {Apply Chunk}. To view the differences in a unified view where changed rows are placed - below each other, select \inlineimage unifieddiff.png + below each other, select \inlineimage icons/unifieddiff.png (\uicontrol {Switch to Unified Diff Editor}). To switch back to the side-by-side view, select - \inlineimage sidebysidediff.png + \inlineimage icons/sidebysidediff.png (\uicontrol {Switch to Side by Side Diff Editor}). To only show text changes, select \uicontrol {Ignore Whitespace}. @@ -108,10 +108,10 @@ By default, the horizontal scroll bars in the left and right pane are synchronized. To use them independently of each other, select the - \inlineimage linkicon.png + \inlineimage icons/linkicon.png (\uicontrol {Synchronize Horizontal Scroll Bars}) button. - If the files change outside \QC, select \inlineimage reload_gray.png + If the files change outside \QC, select \inlineimage icons/reload_gray.png (\uicontrol {Reload Editor}) to compare them again and to show the results. \if defined(qtcreator) diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index cae350b2d58..d649442309e 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -244,7 +244,7 @@ \list 1 - \li In the locator, click \inlineimage magnifier.png + \li In the locator, click \inlineimage icons/magnifier.png (\uicontrol Options) and select \uicontrol Configure to open the \uicontrol Locator options. diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 3debec6131b..011ada3307c 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -121,8 +121,10 @@ \li Select \uicontrol {Use file *.astylerc defined in project files} or \uicontrol {Use file uncrustify.cfg defined in project files}, - to use the configuration file defined in the qmake DISTFILES - variable as the configuration file for the selected tool. + to use the configuration file + \l{Displaying Additional File Types in Projects View} + {defined in the project file} as the configuration file + for the selected tool. \li Select \uicontrol {Use specific config file} or \uicontrol {Use file specific uncrustify.cfg} to diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 1d668a3e07a..02e0a78f316 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -106,7 +106,7 @@ \uicontrol {New Generic StdIO Language Server} to add a generic language server. \li In the \uicontrol Name field, enter a name for the language server. - Select the \inlineimage replace.png + Select the \inlineimage icons/replace.png (\uicontrol {Variables}) button to use a variable for the server name. For more information, see \l{Using Qt Creator Variables}. \li In the \uicontrol {Language} field, select @@ -137,7 +137,7 @@ \uicontrol {New Java Language Server} to add a Java language server. \image qtcreator-language-client-options-java.png "Java language server options" \li In the \uicontrol Name field, enter a name for the language server. - Select the \inlineimage replace.png + Select the \inlineimage icons/replace.png (\uicontrol {Variables}) button to use a variable for the server name. For more information, see \l{Using Qt Creator Variables}. \li In the \uicontrol Java field, enter the path to the Java executable. diff --git a/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc b/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc index 876c296d454..da3d362481c 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc @@ -125,7 +125,7 @@ By default, when you select an element in a diagram, it is highlighted also in the \uicontrol Structure view. To change this behavior so that selecting an element in the \uicontrol Structure makes it highlighted also in the - diagram, click and hold the \inlineimage linkicon.png + diagram, click and hold the \inlineimage icons/linkicon.png button, and then select \uicontrol {Synchronize Diagram with Structure}. To keep the selections in the diagram and the \uicontrol Structure view synchronized, select \uicontrol {Keep Synchronized}. diff --git a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc index 9aadd3702e9..19edbf37843 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc @@ -69,34 +69,34 @@ \uicontrol {Zoom In} or \uicontrol {Zoom Out} or press \key Ctrl and use the mouse wheel. To make the whole state chart visible in the state editor at a time, select - \inlineimage fittoview.png + \inlineimage icons/fittoview.png (\uicontrol {Fit to View}). To view a particular part of a large state chart in the state editor, select - \inlineimage navigator.png + \inlineimage icons/navigator.png (\uicontrol {Navigator}) and move the navigator frame on the part you want to view. To use the magnifier to zoom into a part of the state chart, select - \inlineimage zoom.png + \inlineimage icons/zoom.png (\uicontrol {Magnifier Tool}). To move the magnifier tool faster, press down the \key Alt key. - To pan the state chart, select \inlineimage pan.png + To pan the state chart, select \inlineimage icons/pan.png (\uicontrol Panning). To increase the pace of panning, press down the \key Shift key. To view statistics about the numbers of states and transitions in the state - chart, select \inlineimage statistics.png + chart, select \inlineimage icons/statistics.png (\uicontrol {View Statistics}). To search from the state chart, use the \uicontrol Search pane. The search checks the whole SCXML tree for attributes that match the search criteria. To save the currently visible part of the state chart as an image, select - \inlineimage snapshot.png + \inlineimage icons/snapshot.png (\uicontrol {Save Screenshot}). To save the whole state chart as an image, - select \inlineimage icon-export-canvas.png + select \inlineimage icons/icon-export-canvas.png (\uicontrol {Export Canvas to Image}). \section1 Creating State Charts @@ -208,7 +208,7 @@ select \uicontrol {Zoom to State}. To ensure that the state ids are unique within a compound state machine, - select \inlineimage namespace.png + select \inlineimage icons/namespace.png (\uicontrol {Toggle Full Namespace}). The name of the parent state is added to the names of the child states, separated by two colons (::). For example: diff --git a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc index 0a063ee3ba7..e3fd168cb06 100644 --- a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc +++ b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc @@ -592,7 +592,7 @@ edit a function signature and by applying the changes to the matching code. \li Function signature. When this action is available, a light bulb - icon appears: \inlineimage refactormarker.png + icon appears: \inlineimage icons/refactormarker.png \row \li Add #include for undeclared or forward declared identifier \li Adds an \c {#include} directive to the current file to make the diff --git a/doc/qtcreator/src/editors/creator-search.qdoc b/doc/qtcreator/src/editors/creator-search.qdoc index 887ae4cf3b1..4f9cf514656 100644 --- a/doc/qtcreator/src/editors/creator-search.qdoc +++ b/doc/qtcreator/src/editors/creator-search.qdoc @@ -41,9 +41,9 @@ If the text is found, all occurrences are highlighted as you type. - \li To go to the next occurrence, click \inlineimage next.png + \li To go to the next occurrence, click \inlineimage icons/next.png (\uicontrol {Find Next}), or press \key F3. To go to the previous - occurrence click \inlineimage prev.png + occurrence click \inlineimage icons/prev.png (\uicontrol {Find Previous}), or press \key {Shift+F3}. \endlist @@ -207,13 +207,13 @@ The search results are stored in the search history from which you can select earlier searches. - To clear the search results, select the \inlineimage clean_pane_small.png + To clear the search results, select the \inlineimage icons/clean_pane_small.png (\uicontrol Clear) button. To expand and collapse the search results, select the \uicontrol {Expand All} button. - To start a new search, select the \inlineimage qtcreator-new-search-icon.png + To start a new search, select the \inlineimage icons/qtcreator-new-search-icon.png (\uicontrol {New Search}) button. \note You can use \uicontrol {Advanced Find} also to search for symbols. For diff --git a/doc/qtcreator/src/external-resources/external-resources.qdoc b/doc/qtcreator/src/external-resources/external-resources.qdoc index f3d2f69d92e..76cabbde5c3 100644 --- a/doc/qtcreator/src/external-resources/external-resources.qdoc +++ b/doc/qtcreator/src/external-resources/external-resources.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -113,3 +113,23 @@ \externalpage https://doc.qt.io/QtApplicationManager/ \title Qt Application Manager */ +/*! + \externalpage https://cmake.org/cmake/help/latest/command/install.html + \title CMake: install command +*/ +/*! + \externalpage https://cmake.org/cmake/help/latest/command/set_property.html + \title CMake: set_property command +*/ +/*! + \externalpage https://cmake.org/cmake/help/latest/command/target_sources.html + \title CMake: target_sources command +*/ +/*! + \externalpage https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html + \title CMake: CMAKE_OSX_DEPLOYMENT_TARGET +*/ +/*! + \externalpage https://cmake.org/cmake/help/latest/prop_sf/HEADER_FILE_ONLY.html + \title CMake: HEADER_FILE_ONLY +*/ diff --git a/doc/qtcreator/src/howto/creator-external-tools.qdoc b/doc/qtcreator/src/howto/creator-external-tools.qdoc index ff90be8a8de..35aae547c7e 100644 --- a/doc/qtcreator/src/howto/creator-external-tools.qdoc +++ b/doc/qtcreator/src/howto/creator-external-tools.qdoc @@ -51,14 +51,19 @@ \section1 Using Qt Linguist + When you \l{Creating Projects}{create a new project}, you can automatically + generate a translation source file (TS) for one language. You can add other + languages later by editing the project file. + You can use the Qt Linguist release manager tools, lupdate and lrelease, directly from \QC. The lupdate tool is used to synchronize source code and translations. The lrelease tool is used to create run-time translation files for use by the released application. - When you \l{Creating Projects}{create a new project}, you can automatically - generate a translation source file (TS) for one language. You can add other - languages later by editing the project file. + \note Running the tools from \QC is supported only when using qmake as the + build system. For more information about using the tools with CMake, see + \l{https://doc.qt.io/qt-6/cmake-command-reference.html#qt6-linguisttools} + {Qt6::LinguistTools}. To synchronize TS files from a translator with the application code, select \uicontrol Tools > \uicontrol External > @@ -103,7 +108,7 @@ \image qtcreator-external-tools.png - Select the \inlineimage replace.png + Select the \inlineimage icons/replace.png (\uicontrol {Variables}) button in a field to select from a list of \l{Using Qt Creator Variables}{variables} that are available in a particular context. diff --git a/doc/qtcreator/src/howto/creator-help.qdoc b/doc/qtcreator/src/howto/creator-help.qdoc index de866a32071..712f9abed3c 100644 --- a/doc/qtcreator/src/howto/creator-help.qdoc +++ b/doc/qtcreator/src/howto/creator-help.qdoc @@ -140,7 +140,7 @@ \list 1 - \li Click the \inlineimage bookmark.png + \li Click the \inlineimage icons/bookmark.png (\uicontrol {Add Bookmark}) button on the toolbar. \li In the \uicontrol {Add Bookmark} dialog, click \uicontrol OK to save the @@ -188,7 +188,7 @@ If you cannot find words that you know are there, indexing might not have been completed for some reason. To regenerate the index, click - \inlineimage reload_gray.png + \inlineimage icons/reload_gray.png (\uicontrol {Regenerate Index}). Punctuation is not included in indexed terms. To find terms that contain @@ -225,7 +225,7 @@ in the \uicontrol {On context help} field. To detach the help window, select \uicontrol {Always Show in External Window}. - To change this setting in a help view, select the \inlineimage linkicon.png + To change this setting in a help view, select the \inlineimage icons/linkicon.png toolbar button. \section1 Selecting the Start Page @@ -266,7 +266,7 @@ \image qtcreator-help-filter-attributes.png "Filters tab in Help options" - \li Select \inlineimage plus.png + \li Select \inlineimage icons/plus.png to add a new filter in the \uicontrol {Add Filter} dialog. \li In the \uicontrol {Filter name} field, enter a name for the filter, @@ -291,6 +291,6 @@ To rename the selected filter, select \uicontrol Rename. - To remove the selected filter select \inlineimage minus.png + To remove the selected filter select \inlineimage icons/minus.png . */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc index 8fde8a2ea95..66f38bc0bf9 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc @@ -325,16 +325,16 @@ \li In the \uicontrol {Test Results} output pane, select: \list - \li \inlineimage run_small.png + \li \inlineimage icons/run_small.png (\uicontrol {Run All Tests}) to run all tests. - \li \inlineimage qtcreator-run-selected-tests.png + \li \inlineimage icons/qtcreator-run-selected-tests.png (\uicontrol {Run Selected Tests}) to run the selected tests. - \li \inlineimage qtcreator-run-failed-tests.png + \li \inlineimage icons/qtcreator-run-failed-tests.png (\uicontrol {Run Failed Tests}) to re-run the tests which failed in the last run. Depending on the framework this may select additional tests if it is impossible to distinguish or to fully address the test. - \li \inlineimage qtcreator-run-tests-in-current-file.png + \li \inlineimage icons/qtcreator-run-tests-in-current-file.png (\uicontrol {Run Tests for Current File}) to run the tests in the file currently open in the code editor. \endlist @@ -376,14 +376,14 @@ To refresh the view, select \uicontrol {Rescan Tests} in the context menu. To show or hide init and cleanup or data functions in the \uicontrol Tests - view, select \inlineimage filtericon.png + view, select \inlineimage icons/filtericon.png (\uicontrol {Filter Test Tree}), and then select \uicontrol {Show Init and Cleanup Functions} or \uicontrol {Show Data Functions}. Double-click a function in the list to open its source code in the code editor. The test cases are listed in alphabetic, case insensitive order. To list them in the order in which they are defined in the source code, - select \inlineimage leafsort.png + select \inlineimage icons/leafsort.png (\uicontrol {Sort Naturally}). \section2 Running and Debugging Tests from Code Editor @@ -592,7 +592,7 @@ To view the results of Qt tests as plain text, select \uicontrol Tools > \uicontrol Options > \uicontrol {Testing} > \uicontrol {Qt Test}, and then deselect the \uicontrol {Use XML output} check box. Then select the - \inlineimage text.png + \inlineimage icons/text.png (\uicontrol {Switch Between Visual and Text Display}) button in the \uicontrol {Test Results} output pane to switch to the text display. @@ -668,7 +668,7 @@ \endtable To view only messages of a particular type, select - \inlineimage filtericon.png + \inlineimage icons/filtericon.png (\uicontrol {Filter Test Results}), and then select the types of messages to show. To show all messages, select \uicontrol {Check All Filters}. To deselect all message types, select \uicontrol {Uncheck All Filters}. diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index a7be1b3c0a8..cbee052d365 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -160,11 +160,11 @@ You can toggle the left and right sidebar in some \QC modes. - To toggle the left sidebar, click \inlineimage leftsidebaricon.png + To toggle the left sidebar, click \inlineimage icons/leftsidebaricon.png (\uicontrol {Hide Left Sidebar/Show Left Sidebar}) or press \key Alt+0 (\key Cmd+0 on \macos). - To toggle the right sidebar, click \inlineimage rightsidebaricon.png + To toggle the right sidebar, click \inlineimage icons/rightsidebaricon.png (\uicontrol {Hide Right Sidebar/Show Right Sidebar}) or press \key Alt+Shift+0 (\key Cmd+Shift+0 on \macos). diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index a79e2238bdb..bcb5b6ee9e7 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -83,14 +83,15 @@ By default, \QC looks in the QML import path of Qt for QML modules. Sometimes, it does not get it right and you need to tell it where the - modules are by specifying the \c{QML_IMPORT_PATH} in the \c{.pro} file of - your application. + modules are. When using qmake as the build system, specify the + \c{QML_IMPORT_PATH} in the \c{.pro} file of your application. When + using CMake, add the \c set command to the CMakeLists.txt file. This also enables code completion of QML code and removes error messages. - The following example illustrates how to specify the import path so that - it works when switching between build and run kits for different target - platforms: + The following example illustrates how to specify the import path for qmake + projects so that it works when switching between build and run kits for + different target platforms: \code TEMPNAME = $${QMAKE_QMAKE} @@ -99,8 +100,8 @@ message("my QML Import Path: "$$QML_IMPORT_PATH) \endcode - For more information about how to set the import path when using CMake, see - \l {Importing QML Modules}. + For more information about how to set the import path for CMake projects, + see \l {Importing QML Modules}. \b {What should I do when \QC complains about missing OpenGL support?} @@ -265,8 +266,16 @@ \b {On Windows:} Output is displayed differently for \e{console applications} and \e{GUI applications}. - The setting \c {CONFIG += console} in the .pro file specifies that the - application is built as a console application using some other runtime. + For qmake projects, the \c {CONFIG += console} setting in the .pro file + specifies that the application is built as a console application using + some other runtime. + + This is the standard behavior for CMake projects. To create a GUI + application on Windows or an application bundle on \macos, you must + specify the \c WIN32 or \c MACOSX_BUNDLE property for the + \l{https://doc.qt.io/qt-6/qt-add-executable.html}{qt_add_executable} + command in the CMakeLists.txt file. + When you run a console application, you can view the output in the console window of the calling application. If the calling application is a GUI application (for example, a release-built diff --git a/doc/qtcreator/src/howto/creator-sessions.qdoc b/doc/qtcreator/src/howto/creator-sessions.qdoc index f37bb45b8f9..f852a17dea7 100644 --- a/doc/qtcreator/src/howto/creator-sessions.qdoc +++ b/doc/qtcreator/src/howto/creator-sessions.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -53,7 +53,8 @@ \li Projects \if defined(qtcreator) - with their dependencies (including SUBDIRS projects) + with their dependencies (including SUBDIRS projects when using + qmake) \endif \li Editors diff --git a/doc/qtcreator/src/ios/creator-ios-dev.qdoc b/doc/qtcreator/src/ios/creator-ios-dev.qdoc index c2eb07f9aef..3ebd8c93a01 100644 --- a/doc/qtcreator/src/ios/creator-ios-dev.qdoc +++ b/doc/qtcreator/src/ios/creator-ios-dev.qdoc @@ -133,15 +133,17 @@ \section1 Specifying Supported iOS Versions - Qt 5 applications can be built for the latest iOS version and deployed to + You can build applications for the latest iOS version and deploy them to previous versions. For the most part, this works automatically. However, you must take care when you manually set your own target version. If you set it to a value higher than what Qt requires and supply your own \c Info.plist file, you must add an \c LSMinimumSystemVersion entry to the \c Info.plist - that matches the value of \c QMAKE_IOS_DEPLOYMENT_TARGET (when using qmake) - or \c cpp.minimumIosVersion (when using Qbs), because iOS (and the - App Store) will use the \c LSMinimumSystemVersion value as the authoritative - one. + that matches the value of \l{CMake: CMAKE_OSX_DEPLOYMENT_TARGET} + {CMAKE_OSX_DEPLOYMENT_TARGET} (when using CMake), + \l QMAKE_IOS_DEPLOYMENT_TARGET (when using qmake), or + \l{https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#minimumIosVersion-prop} + {cpp.minimumIosVersion} (when using Qbs) because iOS (and the App Store) + will use the \c LSMinimumSystemVersion value as the authoritative one. If you specify a deployment target value lower than what Qt requires, your application will almost certainly crash somewhere in the Qt libraries when diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc index 4b58e67f9db..7d44a428848 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc @@ -82,7 +82,7 @@ automatically detected the installed kit. If no kits are available, see \l{Adding Kits}. - \li Click \inlineimage run_small.png + \li Click \inlineimage icons/run_small.png (\uicontrol Run) to build and run the application. \li To see the compilation progress, press \key{Alt+4} to open the diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 30e54823273..a7c9f9a6d61 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -440,23 +440,50 @@ \section2 Displaying Additional File Types in Projects View - \QC determines whether to display files from the project folder - in the \uicontrol Projects view depending on the file type (.pro, .pri, .cpp, - .h, .qrc, and so on). To display other types of files, edit the - project file. Add filenames as values of the \c {DISTFILES} variable. - You can also use wildcards. + \QC displays all files that are declared to be part of the project by the + project files in the \l Projects view. The files are sorted into categories + by file type (.cpp, .h, .qrc, and so on). To display additional files, edit + the project file. - For example, the following code specifies that text files are displayed - in the \uicontrol Projects view: + Alternatively, you can see all the files in a project in the + \l {File System} view. - \code + \section3 CMake Projects + + When using CMake, you can specify additional files to display in the + \uicontrol Projects view by either adding them as sources or installing + them. + + In the CMakeLists.txt file, define the files as values of the + \l{CMake: target_sources command}{target_sources} command using + the \c PRIVATE property, for example. + + You can prevent CMake from handling some files, such as a .cpp + file that should not be compiled. Use the \l{CMake: set_property command} + {set_property} command and the \l{CMake: HEADER_FILE_ONLY} + {HEADER_FILE_ONLY} property to specify such files. For example: + + \badcode + set_property(SOURCE "${files}" PROPERTY HEADER_FILE_ONLY ON) + \endcode + + Alternatively, to install the files, use the \l {CMake: install command} + {install} command with the \c FILES or \c DIRECTORY property. + + \section3 qmake Projects + + When using qmake, add filenames as values of the \c {DISTFILES} variable + in the .pro file. You can also use wildcards. + + For example, the following value specifies that text files are part of the + project: + + \badcode DISTFILES += *.txt \endcode - This also makes the files available in the \uicontrol Locator. - \section1 Adding Subprojects to Projects In addition to Qt libraries, you can link your application to other @@ -467,9 +494,20 @@ The procedure of adding a library to a project depends on the build system that you use. - When you create a new project, you can add it to another project as a - subproject in the \uicontrol{Project Management} dialog. However, the root project - must specify that qmake uses the \c subdirs template to build the project. + \section2 CMake Projects + + You can add CMakeLists.txt files to any project by using the + \l{https://cmake.org/cmake/help/latest/command/add_subdirectory.html} + {add_subdirectory} command. The files can define complete projects that + are included into the top-level project or any other CMake commands. + + \section2 qmake Projects + + When you create a new project and select qmake as the build system, + you can add it to another project as a subproject in the + \uicontrol{Project Management} dialog. However, the root project + must specify that qmake uses the \c subdirs \l{TEMPLATE}{template} to + build the project. To create a root project, select \uicontrol File > \uicontrol {New Project} > \uicontrol {Other Project} > diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc index 3ef9ff43b9c..62ef588555b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -29,21 +29,21 @@ To integrate the wizard into \QC and to deliver it as part of the \QC build, place the wizard files in the \QC sources. Then select \uicontrol Build > - \uicontrol {Run qmake}, so that the new files you added for your wizard are + \uicontrol {Run CMake} or \uicontrol {Run qmake}, depending on the build + system you use. This ensures that the new files you added for your wizard are actually copied from the \QC source directory into the \QC build directory as part of the next \QC build. - If you do not run qmake, your new wizard will not show up, because it does - not exist in the build directory you run your newly built \QC from. It never - got copied there, because make did not know that the files exist in the - source tree, because qmake did not inform make that the files were added - recently. + If you do not run CMake or qmake, your new wizard will not show up, because + it does not exist in the build directory you run your newly built \QC from. + It never got copied there because CMake or qmake did not inform the + build tool, such as make or ninja, about the new files in the source tree. - Basically, qmake generates a fixed list of files to copy from the source - directory to the sudirectory of the build directory that is checked for - wizards at runtime. Therefore, you need to run qmake or execute the - \uicontrol {Factory.Reset} function each time the names or locations of the - files change. + Basically, CMake and qmake generate a fixed list of files to copy from the + source directory to the subdirectory of the build directory that is checked + for wizards at runtime. Therefore, you need to run CMake or qmake or execute + the \uicontrol {Factory.Reset} function each time the names or locations of + the files change. \section1 Using Variables in Wizards @@ -717,6 +717,7 @@ "data": { "items": [ + { "trKey": "CMake", "value": "cmake", "icon": "cmake_icon.png", "trToolTip": "Building with CMake." }, { "trKey": "Qbs", "value": "qbs", "icon": "qbs_icon.png", "trToolTip": "Building with Qbs." }, { "trKey": "QMake", "value": "qmake", "icon": "qmake_icon.png", "trToolTip": "Building with QMake." } ] diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc index eb4faea02c1..81f3ebce5bf 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc @@ -145,7 +145,7 @@ \uicontrol {Add Build Step} > \uicontrol {Custom Process Step}. By default, custom steps are enabled. To disable a custom step, select - the \inlineimage buildstepdisable.png + the \inlineimage icons/buildstepdisable.png (\uicontrol Disable) button. \image qtcreator-build-steps-custom.png "Custom Process Step" @@ -184,8 +184,8 @@ \li To remove a clean step, click \uicontrol{Remove Item}. - \li To change the order of steps, click \inlineimage arrowup.png - (\uicontrol {Move Up}) and \inlineimage arrowdown.png + \li To change the order of steps, click \inlineimage icons/arrowup.png + (\uicontrol {Move Up}) and \inlineimage icons/arrowdown.png (\uicontrol {Move Down}). \endlist */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc index 4235705623b..3ad33409075 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc @@ -66,32 +66,49 @@ parsed .pro files. For more information on how the commands are constructed, see \l{Starting External Processes}. - \QC automatically adds run configurations for all targets specified in the - CMake project file, \c {CMakeLists.txt}. - - \QC automatically adds run configurations for all targets declared with - \c {executable()} function in Meson build descriptions. - \section1 Selecting Default Run Target - \QC has multiple executables, but when you run a project you typically want - to run \c qtcreator and not the first executable in the list. To filter the - run target list, set \c qtc_runnable as the value of the \c FOLDER property + If a project has multiple executables, you need to tell \QC which one it + should run. + + \section2 CMake Run Targets + + When using CMake, you can filter the run target list by setting + \c qtc_runnable as the value of the \c FOLDER property in the \c {CMakeLists.txt} file for the project. For example: \badcode set_target_properties(main_executable PROPERTIES FOLDER "qtc_runnable") \endcode - \section1 Creating Run Configurations for Subprojects + If you do not specify \c qtc_runnable for any project, \QC automatically + adds run configurations for all targets specified in \c {CMakeLists.txt}. - To prevent \QC from automatically creating run configurations for SUBDIRS - projects, specify the following variable in the .pro file of the SUBDIRS - project: \c {CONFIG += qtc_runnable}. + \section2 qmake Run Targets + When using qmake, you can prevent \QC from automatically creating run + configurations for subprojects by specifying the \c qtc_runnable + variable in the .pro files of the application projects (\c TEMPLATE=app) + that you want to run. For example + + \badcode + CONFIG += qtc_runnable + \endcode + + If none of your application projects specifies \c qtc_runnable, \QC creates + run configurations for all application projects. + + If any of your application projects specifies \c qtc_runnable, \QC creates run configurations only for subprojects that also have \c {CONFIG += qtc_runnable} set in their .pro files. + For more information about qmake project templates, see \l {TEMPLATE}. + + \section2 Meson Run Targets + + \QC automatically adds run configurations for all targets declared with + \c {executable()} function in Meson build descriptions. + \include creator-projects-settings-run-desktop.qdocinc run settings desktop \include creator-projects-settings-run-analyze.qdocinc settings valgrind \include creator-projects-settings-run-debug.qdocinc run settings debugger diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc index e05b586aca5..60914e258d4 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc @@ -93,7 +93,7 @@ \li In the \uicontrol Name column, enter a name for the kit. - \li Select the \inlineimage qtcreator-desktopdevice-button.png + \li Select the \inlineimage icons/qtcreator-desktopdevice-button.png button to select an image to use as an icon for the kit. \li In the \uicontrol {File system name} field, enter a name for the kit diff --git a/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc b/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc index 65c0fe10bfd..cf1bbe726a0 100644 --- a/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc +++ b/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc @@ -31,7 +31,7 @@ directories. The variables take care of quoting their expansions, so you do not need to put them in quotes. - Select the \inlineimage replace.png + Select the \inlineimage icons/replace.png (\uicontrol {Variables}) button in a field to select from a list of variables that are available in a particular context. For more information about each variable, move the cursor over it in the diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc index abf3dec533e..6317fc3cdeb 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc @@ -103,7 +103,7 @@ When you start typing the QML type name, \QC suggests available types and properties to \l{Completing Code}{complete the code}. - Select the light bulb icon \inlineimage refactormarker.png + Select the light bulb icon \inlineimage icons/refactormarker.png next to the type name to open the \l{Editing Rectangles} {Qt Quick Toolbar for rectangles}. You can use it to specify rectangle properties, such as color, transparency, and gradients. diff --git a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc index 5031c569387..cf00106444c 100644 --- a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc @@ -40,7 +40,7 @@ \list \li Select \uicontrol Build > \uicontrol {QML Preview}. - \li Select the \inlineimage live_preview.png + \li Select the \inlineimage icons/live_preview.png (\uicontrol {Show Live Preview}) button. \li Press \key {Alt+P}. \endlist diff --git a/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc b/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc index 693a0c2a4cc..86c3197cc03 100644 --- a/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc @@ -102,12 +102,12 @@ current application. \li Select the - \inlineimage qtcreator-analyze-start-button.png + \inlineimage icons/qtcreator-analyze-start-button.png (\uicontrol Start) button to start the application from the QML Profiler. \note If data collection does not start automatically, select the - \inlineimage recordfill.png + \inlineimage icons/recordfill.png (\uicontrol {Enable Profiling}) button. \endlist diff --git a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc index 33c88a9ae36..cbc1af136a3 100644 --- a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc @@ -41,7 +41,7 @@ \title Using Qt Quick Toolbars When you select a QML type in the code and a toolbar is available, - a light bulb icon appears: \inlineimage refactormarker.png + a light bulb icon appears: \inlineimage icons/refactormarker.png . Select the icon to open the toolbar. To open toolbars immediately when you select a QML type, select @@ -49,7 +49,7 @@ \uicontrol {QML/JS Editing} > \uicontrol {Always show Qt Quick Toolbar}. Drag the toolbar to pin it to another location. Select - \inlineimage qml-toolbar-pin.png + \inlineimage icons/pin.png to unpin the toolbar and move it to its default location. To pin toolbars by default, select \uicontrol {Pin Quick Toolbar}. diff --git a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc index 87a62b46171..60db096f2c8 100644 --- a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc @@ -60,7 +60,7 @@ \endlist To stop the synchronization between the editor and the - \uicontrol {File System} view, delesect the \inlineimage linkicon.png + \uicontrol {File System} view, delesect the \inlineimage icons/linkicon.png (\uicontrol {Synchronize Root Directory with Editor}) button. The path to the active file is displayed as bread crumbs. You can move to @@ -106,7 +106,7 @@ \endif - To manage view contents, select \inlineimage filtericon.png + To manage view contents, select \inlineimage icons/filtericon.png (\uicontrol Options): \list @@ -119,6 +119,6 @@ \endlist To stop the synchronization with the file currently opened in the - editor, deselect \inlineimage linkicon.png + editor, deselect \inlineimage icons/linkicon.png (\uicontrol {Synchronize with Editor}). */ diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 558296a0bb8..87021c3aa8c 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -124,7 +124,7 @@ \endif - To filter view contents, select \inlineimage filtericon.png + To filter view contents, select \inlineimage icons/filtericon.png (\uicontrol {Filter Tree}): \list @@ -142,7 +142,7 @@ \endlist To stop synchronizing the position in the project tree with the file - currently opened in the editor, deselect \inlineimage linkicon.png + currently opened in the editor, deselect \inlineimage icons/linkicon.png (\uicontrol {Synchronize with Editor}). \if defined(qtcreator) diff --git a/doc/qtcreator/src/user-interface/creator-sidebars.qdoc b/doc/qtcreator/src/user-interface/creator-sidebars.qdoc index 8c8162035e4..0a83cdedd7b 100644 --- a/doc/qtcreator/src/user-interface/creator-sidebars.qdoc +++ b/doc/qtcreator/src/user-interface/creator-sidebars.qdoc @@ -47,15 +47,15 @@ You can change the view of the sidebars in the following ways: \list - \li To toggle the left sidebar, click \inlineimage leftsidebaricon.png + \li To toggle the left sidebar, click \inlineimage icons/leftsidebaricon.png (\uicontrol {Hide Left Sidebar/Show Left Sidebar}) or press \key Alt+0 (\key Cmd+0 on \macos). To toggle the right - sidebar, click \inlineimage rightsidebaricon.png + sidebar, click \inlineimage icons/rightsidebaricon.png (\uicontrol {Hide Right Sidebar/Show Right Sidebar}) or press \key Alt+Shift+0 (\key Cmd+Shift+0 on \macos). - \li To split a sidebar, click \inlineimage splitbutton_horizontal.png + \li To split a sidebar, click \inlineimage icons/splitbutton_horizontal.png (\uicontrol {Split}). Select new content to view in the split view. - \li To close a sidebar view, click \inlineimage splitbutton_closetop.png + \li To close a sidebar view, click \inlineimage icons/splitbutton_closetop.png (\uicontrol {Close}). \endlist */ diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 2d154021cf6..8c013c13d38 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -400,12 +400,12 @@ The menu items also display the keyboard shortcuts that you can use. \endlist - To maximize an open output pane, select the \inlineimage arrowup.png + To maximize an open output pane, select the \inlineimage icons/arrowup.png (\uicontrol {Maximize Output Pane}) button or press \key {Alt+Shift+9}. - To increase or decrease the output text size, select \inlineimage plus.png - (\uicontrol {Zoom In}) or \inlineimage minus.png + To increase or decrease the output text size, select \inlineimage icons/plus.png + (\uicontrol {Zoom In}) or \inlineimage icons/minus.png (\uicontrol {Zoom Out}), or press \key Ctrl++ or \key Ctrl+-. Zooming is not supported in all output panes. @@ -440,7 +440,7 @@ Besides searching from the output, you can enter a string in the \uicontrol Filter field to filter it. To specify filtering options, - select the \inlineimage magnifier.png "Filtering options menu" + select the \inlineimage icons/magnifier.png "Filtering options menu" button. You can filter output by using regular expressions or case-sensitivity. Select \uicontrol {Show Non-matching Lines} to hide the lines that match the filter. @@ -503,7 +503,7 @@ The pane filters out irrelevant output from the build tools and presents the issues in an organized way. To further filter the output by type, select - \inlineimage filtericon.png + \inlineimage icons/filtericon.png (\uicontrol {Filter Tree}) and then select a filter. \image qtcreator-issues.png "Issues output pane" @@ -566,7 +566,7 @@ To specify settings for displaying application output, select \uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} > - \uicontrol {Application Output}, or click the \inlineimage settings.png + \uicontrol {Application Output}, or click the \inlineimage icons/settings.png (\uicontrol {Open Settings Page}) button. You can select whether to open the \uicontrol{Application Output} pane on output when running or debugging applications, to clear old output on a new run, @@ -592,7 +592,7 @@ In the \uicontrol {Limit output to} field, you can specify the maximum amount of build output lines to display in the pane. - You can also reach the options page by clicking \inlineimage settings.png + You can also reach the options page by clicking \inlineimage icons/settings.png (\uicontrol {Open Settings Page}). To copy the output from the pane to the clipboard, select diff --git a/doc/qtcreator/src/user-interface/creator-views.qdoc b/doc/qtcreator/src/user-interface/creator-views.qdoc index ec9466d7c4b..955b77f8452 100644 --- a/doc/qtcreator/src/user-interface/creator-views.qdoc +++ b/doc/qtcreator/src/user-interface/creator-views.qdoc @@ -97,13 +97,13 @@ \list \li To see a complete list of all bindings, select - \inlineimage filtericon.png + \inlineimage icons/filtericon.png (\uicontrol {Filter Tree}) > \uicontrol {Show All Bindings}. \li To sort types or symbols alphabetically, select - \inlineimage sort_alphabetically.png + \inlineimage icons/sort_alphabetically.png (\uicontrol {Sort Alphabetically}). \li To stop the synchronization with the type or symbol selected in the - editor, deselect \inlineimage linkicon.png + editor, deselect \inlineimage icons/linkicon.png (\uicontrol {Synchronize with Editor}). \endlist @@ -115,7 +115,7 @@ \image qtcreator-class-view.png "Class View" To organize the view by subprojects, click - \inlineimage qtcreator-show-subprojects.png + \inlineimage icons/qtcreator-show-subprojects.png (\uicontrol {Show Subprojects}). To visit all parts of a namespace, double-click on the namespace item @@ -146,6 +146,6 @@ \image qtcreator-include-hierarchy-view.png "Include Hierarchy view" To keep the view synchronized with the file currently opened in the editor, - select \inlineimage linkicon.png + select \inlineimage icons/linkicon.png (\uicontrol {Synchronize with Editor}). */ diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index 18b9bcc6891..c27ca66fa2b 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -118,7 +118,7 @@ To show log also for previous names of the file, select \uicontrol Follow. - Select \inlineimage reload_gray.png + Select \inlineimage icons/reload_gray.png (\uicontrol Reload) to rescan the files. To display a description of the change including the diff in the @@ -141,7 +141,7 @@ The other actions in the context-menu enable you to apply actions to the commit, such as cherry-pick, checkout, or revert it. - To rescan the files, click \inlineimage reload_gray.png + To rescan the files, click \inlineimage icons/reload_gray.png (\uicontrol Reload). \section2 Staging Changes @@ -288,7 +288,7 @@ \image qtcreator-vcs-gitbranch.png "Git Branches sidebar view" Old entries and tags are filtered out of the list of branches - by default. To include them, select \inlineimage filtericon.png + by default. To include them, select \inlineimage icons/filtericon.png (\uicontrol {Filter Tree}), and then select \uicontrol {Include Old Entries} and \uicontrol {Include Tags}. @@ -302,7 +302,7 @@ For local and remote branches, the changes log can be shown by double clicking on the branch name. - To refresh the list of branches, click \inlineimage reload_gray.png + To refresh the list of branches, click \inlineimage icons/reload_gray.png (\uicontrol Refresh). The following operations are supported in the context-menu for a branch: diff --git a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc index d2359700227..546cbd20277 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc @@ -339,7 +339,7 @@ \section1 Compiling and Running Your Program Now that you have all the necessary files, select the - \inlineimage run_small.png + \inlineimage icons/run_small.png button to compile and run your program. */ diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf index 3e333d3b640..2b3cf9879c8 100644 --- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf +++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf @@ -23,11 +23,6 @@ imagedirs = ../images \ ../../../share/qtcreator/qml/qmlpuppet/mockfiles/images \ ../../../share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/images \ ../../../src/libs/qmleditorwidgets/images \ - ../../../src/libs/utils/images \ - ../../../src/plugins/debugger/images \ - ../../../src/plugins/diffeditor/images \ - ../../../src/plugins/help/images \ - ../../../src/plugins/projectexplorer/images \ ../../../src/plugins/qmldesigner/components/componentcore/images \ ../../../src/plugins/qmldesigner/components/edit3d/images \ ../../../src/plugins/qmldesigner/components/formeditor \ @@ -36,7 +31,6 @@ imagedirs = ../images \ ../../../src/plugins/qmldesigner/componentsplugin/images \ ../../../src/plugins/qmldesigner/qmlpreviewplugin/images \ ../../../src/plugins/qmldesigner/qtquickplugin/images \ - ../../../src/plugins/texteditor/images include(../../qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf) diff --git a/doc/qtcreator/images/icons/action-icon-binding.png b/doc/qtdesignstudio/images/icons/action-icon-binding.png similarity index 100% rename from doc/qtcreator/images/icons/action-icon-binding.png rename to doc/qtdesignstudio/images/icons/action-icon-binding.png diff --git a/doc/qtcreator/images/icons/action-icon.png b/doc/qtdesignstudio/images/icons/action-icon.png similarity index 100% rename from doc/qtcreator/images/icons/action-icon.png rename to doc/qtdesignstudio/images/icons/action-icon.png diff --git a/doc/qtcreator/images/icons/alias.png b/doc/qtdesignstudio/images/icons/alias.png similarity index 100% rename from doc/qtcreator/images/icons/alias.png rename to doc/qtdesignstudio/images/icons/alias.png diff --git a/doc/qtcreator/images/icons/align-bottom.png b/doc/qtdesignstudio/images/icons/align-bottom.png similarity index 70% rename from doc/qtcreator/images/icons/align-bottom.png rename to doc/qtdesignstudio/images/icons/align-bottom.png index 07277d74a9e..0e06ebee112 100644 Binary files a/doc/qtcreator/images/icons/align-bottom.png and b/doc/qtdesignstudio/images/icons/align-bottom.png differ diff --git a/doc/qtdesignstudio/images/icons/align-center-horizontal.png b/doc/qtdesignstudio/images/icons/align-center-horizontal.png new file mode 100644 index 00000000000..e60f8555735 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/align-center-horizontal.png differ diff --git a/doc/qtcreator/images/icons/align-center-vertical.png b/doc/qtdesignstudio/images/icons/align-center-vertical.png similarity index 57% rename from doc/qtcreator/images/icons/align-center-vertical.png rename to doc/qtdesignstudio/images/icons/align-center-vertical.png index 8d423733511..92ffefe22fc 100644 Binary files a/doc/qtcreator/images/icons/align-center-vertical.png and b/doc/qtdesignstudio/images/icons/align-center-vertical.png differ diff --git a/doc/qtdesignstudio/images/icons/align-left.png b/doc/qtdesignstudio/images/icons/align-left.png new file mode 100644 index 00000000000..e1f4b11b3ea Binary files /dev/null and b/doc/qtdesignstudio/images/icons/align-left.png differ diff --git a/doc/qtdesignstudio/images/icons/align-right.png b/doc/qtdesignstudio/images/icons/align-right.png new file mode 100644 index 00000000000..64602bc95e0 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/align-right.png differ diff --git a/doc/qtdesignstudio/images/icons/align-top.png b/doc/qtdesignstudio/images/icons/align-top.png new file mode 100644 index 00000000000..0933cea0fea Binary files /dev/null and b/doc/qtdesignstudio/images/icons/align-top.png differ diff --git a/doc/qtdesignstudio/images/icons/anchor-bottom.png b/doc/qtdesignstudio/images/icons/anchor-bottom.png new file mode 100644 index 00000000000..df078b0a036 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/anchor-bottom.png differ diff --git a/doc/qtcreator/images/icons/anchor-center-horizontal.png b/doc/qtdesignstudio/images/icons/anchor-center-horizontal.png similarity index 60% rename from doc/qtcreator/images/icons/anchor-center-horizontal.png rename to doc/qtdesignstudio/images/icons/anchor-center-horizontal.png index b3be3037238..39133b90127 100644 Binary files a/doc/qtcreator/images/icons/anchor-center-horizontal.png and b/doc/qtdesignstudio/images/icons/anchor-center-horizontal.png differ diff --git a/doc/qtdesignstudio/images/icons/anchor-center-vertical.png b/doc/qtdesignstudio/images/icons/anchor-center-vertical.png new file mode 100644 index 00000000000..bce2ee77a6b Binary files /dev/null and b/doc/qtdesignstudio/images/icons/anchor-center-vertical.png differ diff --git a/doc/qtdesignstudio/images/icons/anchor-fill.png b/doc/qtdesignstudio/images/icons/anchor-fill.png new file mode 100644 index 00000000000..a0b673f37e1 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/anchor-fill.png differ diff --git a/doc/qtdesignstudio/images/icons/anchor-left.png b/doc/qtdesignstudio/images/icons/anchor-left.png new file mode 100644 index 00000000000..34930b46788 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/anchor-left.png differ diff --git a/doc/qtdesignstudio/images/icons/anchor-right.png b/doc/qtdesignstudio/images/icons/anchor-right.png new file mode 100644 index 00000000000..e0b7fe4deaa Binary files /dev/null and b/doc/qtdesignstudio/images/icons/anchor-right.png differ diff --git a/doc/qtdesignstudio/images/icons/anchor-top.png b/doc/qtdesignstudio/images/icons/anchor-top.png new file mode 100644 index 00000000000..460f181bb55 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/anchor-top.png differ diff --git a/doc/qtdesignstudio/images/icons/annotation.png b/doc/qtdesignstudio/images/icons/annotation.png new file mode 100644 index 00000000000..5f67208749f Binary files /dev/null and b/doc/qtdesignstudio/images/icons/annotation.png differ diff --git a/doc/qtcreator/images/icons/busyindicator-icon16.png b/doc/qtdesignstudio/images/icons/busyindicator-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/busyindicator-icon16.png rename to doc/qtdesignstudio/images/icons/busyindicator-icon16.png diff --git a/doc/qtcreator/images/icons/button-icon16.png b/doc/qtdesignstudio/images/icons/button-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/button-icon16.png rename to doc/qtdesignstudio/images/icons/button-icon16.png diff --git a/doc/qtcreator/images/icons/canvas-color.png b/doc/qtdesignstudio/images/icons/canvas-color.png similarity index 100% rename from doc/qtcreator/images/icons/canvas-color.png rename to doc/qtdesignstudio/images/icons/canvas-color.png diff --git a/doc/qtcreator/images/icons/checkbox-icon16.png b/doc/qtdesignstudio/images/icons/checkbox-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/checkbox-icon16.png rename to doc/qtdesignstudio/images/icons/checkbox-icon16.png diff --git a/doc/qtcreator/images/icons/combobox-icon16.png b/doc/qtdesignstudio/images/icons/combobox-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/combobox-icon16.png rename to doc/qtdesignstudio/images/icons/combobox-icon16.png diff --git a/doc/qtcreator/images/icons/copy-formatting.png b/doc/qtdesignstudio/images/icons/copy-formatting.png similarity index 100% rename from doc/qtcreator/images/icons/copy-formatting.png rename to doc/qtdesignstudio/images/icons/copy-formatting.png diff --git a/doc/qtcreator/images/icons/delaybutton-icon16.png b/doc/qtdesignstudio/images/icons/delaybutton-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/delaybutton-icon16.png rename to doc/qtdesignstudio/images/icons/delaybutton-icon16.png diff --git a/doc/qtdesignstudio/images/icons/detach-group-icon.png b/doc/qtdesignstudio/images/icons/detach-group-icon.png new file mode 100644 index 00000000000..ebd50eeda4b Binary files /dev/null and b/doc/qtdesignstudio/images/icons/detach-group-icon.png differ diff --git a/doc/qtcreator/images/icons/dial-icon16.png b/doc/qtdesignstudio/images/icons/dial-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/dial-icon16.png rename to doc/qtdesignstudio/images/icons/dial-icon16.png diff --git a/doc/qtdesignstudio/images/icons/distribute-bottom.png b/doc/qtdesignstudio/images/icons/distribute-bottom.png new file mode 100644 index 00000000000..a8af35b0a4f Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-bottom.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-center-horizontal.png b/doc/qtdesignstudio/images/icons/distribute-center-horizontal.png new file mode 100644 index 00000000000..5ec97a23578 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-center-horizontal.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-center-vertical.png b/doc/qtdesignstudio/images/icons/distribute-center-vertical.png new file mode 100644 index 00000000000..136dfaed494 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-center-vertical.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-left.png b/doc/qtdesignstudio/images/icons/distribute-left.png new file mode 100644 index 00000000000..9f78b060c5b Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-left.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-origin-bottom-right.png b/doc/qtdesignstudio/images/icons/distribute-origin-bottom-right.png new file mode 100644 index 00000000000..647181e671c Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-origin-bottom-right.png differ diff --git a/doc/qtcreator/images/icons/distribute-origin-center.png b/doc/qtdesignstudio/images/icons/distribute-origin-center.png similarity index 51% rename from doc/qtcreator/images/icons/distribute-origin-center.png rename to doc/qtdesignstudio/images/icons/distribute-origin-center.png index 391d3d640f8..727a7dfd2eb 100644 Binary files a/doc/qtcreator/images/icons/distribute-origin-center.png and b/doc/qtdesignstudio/images/icons/distribute-origin-center.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-origin-none.png b/doc/qtdesignstudio/images/icons/distribute-origin-none.png new file mode 100644 index 00000000000..6475089e332 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-origin-none.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-origin-top-left.png b/doc/qtdesignstudio/images/icons/distribute-origin-top-left.png new file mode 100644 index 00000000000..993c4c7d39c Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-origin-top-left.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-right.png b/doc/qtdesignstudio/images/icons/distribute-right.png new file mode 100644 index 00000000000..0c28c97ca89 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-right.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-spacing-horizontal.png b/doc/qtdesignstudio/images/icons/distribute-spacing-horizontal.png new file mode 100644 index 00000000000..448b2fd7462 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-spacing-horizontal.png differ diff --git a/doc/qtdesignstudio/images/icons/distribute-spacing-vertical.png b/doc/qtdesignstudio/images/icons/distribute-spacing-vertical.png new file mode 100644 index 00000000000..5489cb4024f Binary files /dev/null and b/doc/qtdesignstudio/images/icons/distribute-spacing-vertical.png differ diff --git a/doc/qtcreator/images/icons/distribute-top.png b/doc/qtdesignstudio/images/icons/distribute-top.png similarity index 59% rename from doc/qtcreator/images/icons/distribute-top.png rename to doc/qtdesignstudio/images/icons/distribute-top.png index 7f2e5749073..857c3fff8e9 100644 Binary files a/doc/qtcreator/images/icons/distribute-top.png and b/doc/qtdesignstudio/images/icons/distribute-top.png differ diff --git a/doc/qtdesignstudio/images/icons/easing-curve-linear-icon.png b/doc/qtdesignstudio/images/icons/easing-curve-linear-icon.png new file mode 100644 index 00000000000..d6f56990d7b Binary files /dev/null and b/doc/qtdesignstudio/images/icons/easing-curve-linear-icon.png differ diff --git a/doc/qtdesignstudio/images/icons/easing-curve-spline-icon.png b/doc/qtdesignstudio/images/icons/easing-curve-spline-icon.png new file mode 100644 index 00000000000..f6420d9174b Binary files /dev/null and b/doc/qtdesignstudio/images/icons/easing-curve-spline-icon.png differ diff --git a/doc/qtdesignstudio/images/icons/easing-curve-step-icon.png b/doc/qtdesignstudio/images/icons/easing-curve-step-icon.png new file mode 100644 index 00000000000..5d6523f1c70 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/easing-curve-step-icon.png differ diff --git a/doc/qtcreator/images/icons/frame-icon16.png b/doc/qtdesignstudio/images/icons/frame-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/frame-icon16.png rename to doc/qtdesignstudio/images/icons/frame-icon16.png diff --git a/doc/qtcreator/images/icons/groupbox-icon16.png b/doc/qtdesignstudio/images/icons/groupbox-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/groupbox-icon16.png rename to doc/qtdesignstudio/images/icons/groupbox-icon16.png diff --git a/doc/qtcreator/images/icons/itemdelegate-icon16.png b/doc/qtdesignstudio/images/icons/itemdelegate-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/itemdelegate-icon16.png rename to doc/qtdesignstudio/images/icons/itemdelegate-icon16.png diff --git a/doc/qtcreator/images/icons/label-icon16.png b/doc/qtdesignstudio/images/icons/label-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/label-icon16.png rename to doc/qtdesignstudio/images/icons/label-icon16.png diff --git a/doc/qtcreator/images/icons/lockoff.png b/doc/qtdesignstudio/images/icons/lockoff.png similarity index 100% rename from doc/qtcreator/images/icons/lockoff.png rename to doc/qtdesignstudio/images/icons/lockoff.png diff --git a/doc/qtdesignstudio/images/icons/lockon.png b/doc/qtdesignstudio/images/icons/lockon.png new file mode 100644 index 00000000000..d44a275cda2 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/lockon.png differ diff --git a/doc/qtcreator/images/icons/navigator-arrowdown.png b/doc/qtdesignstudio/images/icons/navigator-arrowdown.png similarity index 100% rename from doc/qtcreator/images/icons/navigator-arrowdown.png rename to doc/qtdesignstudio/images/icons/navigator-arrowdown.png diff --git a/doc/qtcreator/images/icons/navigator-arrowup.png b/doc/qtdesignstudio/images/icons/navigator-arrowup.png similarity index 100% rename from doc/qtcreator/images/icons/navigator-arrowup.png rename to doc/qtdesignstudio/images/icons/navigator-arrowup.png diff --git a/doc/qtcreator/images/icons/page-icon16.png b/doc/qtdesignstudio/images/icons/page-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/page-icon16.png rename to doc/qtdesignstudio/images/icons/page-icon16.png diff --git a/doc/qtcreator/images/icons/pageindicator-icon16.png b/doc/qtdesignstudio/images/icons/pageindicator-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/pageindicator-icon16.png rename to doc/qtdesignstudio/images/icons/pageindicator-icon16.png diff --git a/doc/qtcreator/images/icons/pane-icon16.png b/doc/qtdesignstudio/images/icons/pane-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/pane-icon16.png rename to doc/qtdesignstudio/images/icons/pane-icon16.png diff --git a/doc/qtcreator/images/icons/paste-formatting.png b/doc/qtdesignstudio/images/icons/paste-formatting.png similarity index 100% rename from doc/qtcreator/images/icons/paste-formatting.png rename to doc/qtdesignstudio/images/icons/paste-formatting.png diff --git a/doc/qtcreator/images/icons/progressbar-icon16.png b/doc/qtdesignstudio/images/icons/progressbar-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/progressbar-icon16.png rename to doc/qtdesignstudio/images/icons/progressbar-icon16.png diff --git a/doc/qtcreator/images/icons/radiobutton-icon16.png b/doc/qtdesignstudio/images/icons/radiobutton-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/radiobutton-icon16.png rename to doc/qtdesignstudio/images/icons/radiobutton-icon16.png diff --git a/doc/qtcreator/images/icons/rangeslider-icon16.png b/doc/qtdesignstudio/images/icons/rangeslider-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/rangeslider-icon16.png rename to doc/qtdesignstudio/images/icons/rangeslider-icon16.png diff --git a/doc/qtdesignstudio/images/icons/rotation-cursor.png b/doc/qtdesignstudio/images/icons/rotation-cursor.png new file mode 100644 index 00000000000..da977e5619c Binary files /dev/null and b/doc/qtdesignstudio/images/icons/rotation-cursor.png differ diff --git a/doc/qtcreator/images/icons/roundbutton-icon16.png b/doc/qtdesignstudio/images/icons/roundbutton-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/roundbutton-icon16.png rename to doc/qtdesignstudio/images/icons/roundbutton-icon16.png diff --git a/doc/qtcreator/images/icons/scrollview-icon16.png b/doc/qtdesignstudio/images/icons/scrollview-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/scrollview-icon16.png rename to doc/qtdesignstudio/images/icons/scrollview-icon16.png diff --git a/doc/qtcreator/images/icons/slider-icon16.png b/doc/qtdesignstudio/images/icons/slider-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/slider-icon16.png rename to doc/qtdesignstudio/images/icons/slider-icon16.png diff --git a/doc/qtcreator/images/icons/spinbox-icon16.png b/doc/qtdesignstudio/images/icons/spinbox-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/spinbox-icon16.png rename to doc/qtdesignstudio/images/icons/spinbox-icon16.png diff --git a/doc/qtcreator/images/icons/stackview-icon16.png b/doc/qtdesignstudio/images/icons/stackview-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/stackview-icon16.png rename to doc/qtdesignstudio/images/icons/stackview-icon16.png diff --git a/doc/qtcreator/images/icons/swipeview-icon16.png b/doc/qtdesignstudio/images/icons/swipeview-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/swipeview-icon16.png rename to doc/qtdesignstudio/images/icons/swipeview-icon16.png diff --git a/doc/qtcreator/images/icons/switch-icon16.png b/doc/qtdesignstudio/images/icons/switch-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/switch-icon16.png rename to doc/qtdesignstudio/images/icons/switch-icon16.png diff --git a/doc/qtcreator/images/icons/textarea-icon16.png b/doc/qtdesignstudio/images/icons/textarea-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/textarea-icon16.png rename to doc/qtdesignstudio/images/icons/textarea-icon16.png diff --git a/doc/qtcreator/images/icons/textfield-icon16.png b/doc/qtdesignstudio/images/icons/textfield-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/textfield-icon16.png rename to doc/qtdesignstudio/images/icons/textfield-icon16.png diff --git a/doc/qtcreator/images/icons/toolbar-icon16.png b/doc/qtdesignstudio/images/icons/toolbar-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/toolbar-icon16.png rename to doc/qtdesignstudio/images/icons/toolbar-icon16.png diff --git a/doc/qtcreator/images/icons/toolbutton-icon16.png b/doc/qtdesignstudio/images/icons/toolbutton-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/toolbutton-icon16.png rename to doc/qtdesignstudio/images/icons/toolbutton-icon16.png diff --git a/doc/qtcreator/images/icons/toolseparator-icon16.png b/doc/qtdesignstudio/images/icons/toolseparator-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/toolseparator-icon16.png rename to doc/qtdesignstudio/images/icons/toolseparator-icon16.png diff --git a/doc/qtcreator/images/icons/transparent-icon.png b/doc/qtdesignstudio/images/icons/transparent-icon.png similarity index 100% rename from doc/qtcreator/images/icons/transparent-icon.png rename to doc/qtdesignstudio/images/icons/transparent-icon.png diff --git a/doc/qtdesignstudio/images/icons/transparent.png b/doc/qtdesignstudio/images/icons/transparent.png new file mode 100644 index 00000000000..54111d03bdb Binary files /dev/null and b/doc/qtdesignstudio/images/icons/transparent.png differ diff --git a/doc/qtcreator/images/icons/tumbler-icon16.png b/doc/qtdesignstudio/images/icons/tumbler-icon16.png similarity index 100% rename from doc/qtcreator/images/icons/tumbler-icon16.png rename to doc/qtdesignstudio/images/icons/tumbler-icon16.png diff --git a/doc/qtdesignstudio/images/icons/visibilityon.png b/doc/qtdesignstudio/images/icons/visibilityon.png new file mode 100644 index 00000000000..2efa125c328 Binary files /dev/null and b/doc/qtdesignstudio/images/icons/visibilityon.png differ diff --git a/doc/qtcreator/images/icons/zoomAll.png b/doc/qtdesignstudio/images/icons/zoomAll.png similarity index 100% rename from doc/qtcreator/images/icons/zoomAll.png rename to doc/qtdesignstudio/images/icons/zoomAll.png diff --git a/doc/qtcreator/images/icons/zoomIn.png b/doc/qtdesignstudio/images/icons/zoomIn.png similarity index 100% rename from doc/qtcreator/images/icons/zoomIn.png rename to doc/qtdesignstudio/images/icons/zoomIn.png diff --git a/doc/qtcreator/images/icons/zoomOut.png b/doc/qtdesignstudio/images/icons/zoomOut.png similarity index 100% rename from doc/qtcreator/images/icons/zoomOut.png rename to doc/qtdesignstudio/images/icons/zoomOut.png diff --git a/doc/qtcreator/images/icons/zoomSelection.png b/doc/qtdesignstudio/images/icons/zoomSelection.png similarity index 100% rename from doc/qtcreator/images/icons/zoomSelection.png rename to doc/qtdesignstudio/images/icons/zoomSelection.png diff --git a/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc b/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc index 45314db2106..e636251eac1 100644 --- a/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc +++ b/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc @@ -61,4 +61,61 @@ \l Projects and \l {File System} views in \QDS and Qt Creator: \image studio-project-structure.png "\QDS project in \QDS and Qt Creator views" + + \section1 Converting Project Structure for CMake + + \QDS can generate \e CMakeLists.txt and other related files to use with \QC and to compile into + an executable application but only if the project has a certain folder structure. If you have a + \QDS QML project that doesn't have the CMake configuration, follow these steps to convert it's + file structure to correct format. + + \list 1 + \li Create a folder named \e content in the project's folder. This folder contains the + application's main module. + \li Move all QML files of the project's main module to the \e content folder. If your project + has multiple modules, place the other modules in the \e imports or + \e asset_imports folder. + \li If your project's main module has resource folders such as \e fonts or \e {images}, move + them to the \e content folder. + \li Create a folder named \e src in the project's folder. This folder contains C++ code for + compiling the project. + \li If your project doesn't have an \e imports folder for other QML modules, create it + now even if you do not have other modules. The CMake file generator expects it. + \li In the project's \e .qmlproject file: + \list + \li Add \e "." in importPaths. For example: + \code + importPaths: [ "imports", "asset_imports", "." ] + \endcode + \li Change mainFile to \e "content/App.qml": + \code + mainFile: "content/App.qml" + \endcode + \endlist + \li In the \e content folder, create a file named \e App.qml and add the following content: + + \qml + import QtQuick + import QtQuick.Window + import YourImportModuleHere + Window { + width: Constants.width + height: Constants.height + visible: true + title: "YourWindowTitleHere" + { + } + } + \endqml + + \li In \e{App.qml}, modify imported modules, window dimensions, window title, and main QML + class appropriately. + + \note This template assumes that your project has a module named \e YourImportModuleHere in + the \a imports folder containing a singleton class named \a Constants. + This isn't mandatory. + + \li Generate CMake files and C++ source files that are used to compile the application into + an executable file by selecting \uicontrol Build > \uicontrol{Generate CMakeLists.txt files}. + \endlist */ diff --git a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc index 2a524d26891..ba43f329238 100644 --- a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc +++ b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc @@ -82,13 +82,16 @@ \endcode \endlist + \note On \macos \QBPS fails to load when Adobe Photoshop runs natively on an ARM + processor (Apple silicon). For more information, see \l {Running \QBPS on Apple Silicon}. + \section1 Enabling Remote Connections To set up \QBPS: \list 1 \li Once the installation is completed, restart Adobe Photoshop to make - \QBPS appear in \uicontrol Window > \uicontrol Extensions. + \QBPS appear in \uicontrol Window > \uicontrol {Extensions (Legacy)}. \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol General > \uicontrol Plug-ins to enable a remote connection. @@ -106,4 +109,16 @@ \endlist Once the connection is successfully created, \QBPS is ready to use. + + \note + + \section1 Running \QBPS on Apple Silicon + + If you are using \macos on an ARM processor (Apple silicon), \QBPS may not be listed + in Adobe Photoshop under \uicontrol Window > \uicontrol {Extensions (Legacy)}. + Run the Adobe Photoshop app in the Rosetta emulation mode. + Right click the Adobe Photoshop.app and select \uicontrol{Get info} > + \uicontrol {Open using Rosetta}. + Once the app is running in the Rosetta emulation mode, make sure + \uicontrol Preferences > \uicontrol Plug-ins > \uicontrol {Legacy Extensions} is selected. */ diff --git a/scripts/build.py b/scripts/build.py index 91ccd5bae14..84ea1c32327 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -149,6 +149,10 @@ def common_cmake_arguments(args): pch_option = 'ON' if args.with_pch else 'OFF' cmake_args += ['-DBUILD_WITH_PCH=' + pch_option] + # work around QTBUG-89754 + # Qt otherwise adds dependencies on libGLX and libOpenGL + cmake_args += ['-DOpenGL_GL_PREFERENCE=LEGACY'] + return cmake_args def build_qtcreator(args, paths): diff --git a/share/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein b/share/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein index b721029a0a5..32d10990aaa 100644 --- a/share/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein +++ b/share/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein @@ -32,7 +32,7 @@ https://doc.qt.io/qtcreator/images/qtcreator-breakdown.png - https://doc.qt.io/qtcreator/images/qtcreator-qt-quick-editors.png + https://doc.qt.io/qtcreator/images/qtcreator-gs-build-example-open.png diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp index 67d134f6b32..4d6c87a901f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp @@ -215,7 +215,11 @@ QVector4D GeneralHelper::focusNodesToCamera(QQuick3DCamera *camera, float defaul bounds = geometry->bounds(); } else { auto bufferManager = context->bufferManager(); +#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) bounds = renderModel->getModelBounds(bufferManager); +#else + bounds = bufferManager->getModelBounds(renderModel); +#endif } center = renderModel->globalTransform.map(bounds.center()); @@ -333,7 +337,7 @@ void GeneralHelper::unregisterGizmoTarget(QQuick3DNode *node) } } -bool GeneralHelper::isLocked(QQuick3DNode *node) +bool GeneralHelper::isLocked(QQuick3DNode *node) const { if (node) { QVariant lockValue = node->property("_edit3dLocked"); @@ -342,7 +346,7 @@ bool GeneralHelper::isLocked(QQuick3DNode *node) return false; } -bool GeneralHelper::isHidden(QQuick3DNode *node) +bool GeneralHelper::isHidden(QQuick3DNode *node) const { if (node) { QVariant hideValue = node->property("_edit3dHidden"); @@ -351,8 +355,18 @@ bool GeneralHelper::isHidden(QQuick3DNode *node) return false; } -bool GeneralHelper::isPickable(QQuick3DNode *node) { - return (node && !isLocked(node) && !isHidden(node) && node->visible()); +bool GeneralHelper::isPickable(QQuick3DNode *node) const +{ + if (!node) + return false; + + QQuick3DNode *n = node; + while (n) { + if (!n->visible() || isLocked(n) || isHidden(n)) + return false; + n = n->parentNode(); + } + return true; } void GeneralHelper::storeToolState(const QString &sceneId, const QString &tool, const QVariant &state, diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h index 381082415bc..4751bb3d316 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h @@ -80,9 +80,9 @@ public: Q_INVOKABLE void registerGizmoTarget(QQuick3DNode *node); Q_INVOKABLE void unregisterGizmoTarget(QQuick3DNode *node); - Q_INVOKABLE bool isLocked(QQuick3DNode *node); - Q_INVOKABLE bool isHidden(QQuick3DNode *node); - Q_INVOKABLE bool isPickable(QQuick3DNode *node); + Q_INVOKABLE bool isLocked(QQuick3DNode *node) const; + Q_INVOKABLE bool isHidden(QQuick3DNode *node) const; + Q_INVOKABLE bool isPickable(QQuick3DNode *node) const; Q_INVOKABLE void storeToolState(const QString &sceneId, const QString &tool, const QVariant &state, int delayEmit = 0); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp index ef0dd33fba2..a4e950b238b 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp @@ -898,8 +898,22 @@ bool MouseArea3D::eventFilter(QObject *, QEvent *event) // a problem onCircle = false; if (m_pickNode) { +#if QT_VERSION < QT_VERSION_CHECK(6, 2, 1) QQuick3DPickResult pr = m_view3D->pick(float(mousePos.x()), float(mousePos.y())); pickSuccess = pr.objectHit() == m_pickNode; +#else + // With the introduction of global picking API, + // we need to pick all as various other geometries can often be the first + // pick result, such as camera frustum or light geometry + const QList results = m_view3D->pickAll(float(mousePos.x()), + float(mousePos.y())); + for (const auto &pr : results) { + if (pr.objectHit() == m_pickNode) { + pickSuccess = true; + break; + } + } +#endif } } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp index 9e2bd181dbd..4a67141f246 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/selectionboxgeometry.cpp @@ -306,7 +306,11 @@ void SelectionBoxGeometry::getBounds( #endif if (!context.isNull()) { auto bufferManager = context->bufferManager(); +#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) QSSGBounds3 bounds = renderModel->getModelBounds(bufferManager); +#else + QSSGBounds3 bounds = bufferManager->getModelBounds(renderModel); +#endif QVector3D center = bounds.center(); QVector3D extents = bounds.extents(); QVector3D localMin = center - extents; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 16dc3dbe5fd..70dc4b8cc9c 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -99,6 +99,7 @@ #include #include #include +#include #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include "../editor3d/qt5compat/qquick3darealight_p.h" #endif @@ -1226,6 +1227,7 @@ Qt5InformationNodeInstanceServer::Qt5InformationNodeInstanceServer(NodeInstanceC m_inputEventTimer.setSingleShot(true); m_renderModelNodeImageViewTimer.setSingleShot(true); m_modelNode3DImageViewAsyncData.timer.setSingleShot(true); + m_repeaterAddObjectTimer.setSingleShot(true); #ifdef FPS_COUNTER if (!_fpsTimer) { @@ -1251,6 +1253,7 @@ Qt5InformationNodeInstanceServer::~Qt5InformationNodeInstanceServer() m_inputEventTimer.stop(); m_renderModelNodeImageViewTimer.stop(); m_modelNode3DImageViewAsyncData.timer.stop(); + m_repeaterAddObjectTimer.stop(); if (m_editView3DData.rootItem) m_editView3DData.rootItem->disconnect(this); @@ -1394,6 +1397,22 @@ void Qt5InformationNodeInstanceServer::handleSelectionChangeTimeout() changeSelection(m_lastSelectionChangeCommand); } +void Qt5InformationNodeInstanceServer::handleRepeaterAddObjectTimeout() +{ +#ifdef QUICK3D_MODULE + for (auto obj : std::as_const(m_addObjectRepeaters)) { + if (auto repObj = qobject_cast(obj)) { + if (hasInstanceForObject(repObj)) { + ServerNodeInstance instance = instanceForObject(repObj); + handleInstanceHidden(instance, instance.internalInstance()->isHiddenInEditor(), + false); + } + } + } +#endif + m_addObjectRepeaters.clear(); +} + void Qt5InformationNodeInstanceServer::createCameraAndLightGizmos( const QList &instanceList) const { @@ -1645,6 +1664,8 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList(m_3dHelper); @@ -1803,6 +1824,7 @@ void Qt5InformationNodeInstanceServer::clearScene(const ClearSceneCommand &comma m_parentChangedSet.clear(); m_completedComponentList.clear(); + m_addObjectRepeaters.clear(); } void Qt5InformationNodeInstanceServer::createScene(const CreateSceneCommand &command) @@ -2293,6 +2315,12 @@ bool Qt5InformationNodeInstanceServer::isInformationServer() const return true; } +void Qt5InformationNodeInstanceServer::handleRepeaterAddObject() +{ + m_addObjectRepeaters.insert(sender()); + m_repeaterAddObjectTimer.start(); +} + // update 3D view size when it changes in creator side void Qt5InformationNodeInstanceServer::update3DViewState(const Update3dViewStateCommand &command) { diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h index 3d96b3bb70d..439b7b17a3a 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h @@ -82,6 +82,7 @@ public: void handleInstanceHidden(const ServerNodeInstance &instance, bool enable, bool checkAncestors) override; bool isInformationServer() const override; + void handleRepeaterAddObject(); private slots: void handleSelectionChanged(const QVariant &objs); @@ -108,6 +109,7 @@ protected: private: void handleObjectPropertyChangeTimeout(); void handleSelectionChangeTimeout(); + void handleRepeaterAddObjectTimeout(); void createEditView3D(); void create3DPreviewView(); void setup3DEditView(const QList &instanceList, @@ -174,6 +176,7 @@ private: QTimer m_render3DEditViewTimer; QTimer m_renderModelNodeImageViewTimer; QTimer m_inputEventTimer; + QTimer m_repeaterAddObjectTimer; #ifdef QUICK3D_PARTICLES_MODULE bool m_particleAnimationPlaying = true; AnimationDriver *m_particleAnimationDriver = nullptr; @@ -186,6 +189,7 @@ private: QList m_pendingInputEventCommands; QObject *m_3dHelper = nullptr; int m_need3DEditViewRender = 0; + QSet m_addObjectRepeaters; struct ModelNode3DImageViewAsyncData { QTimer timer; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp index c8bbc46ddb8..783bfba87f4 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp @@ -25,6 +25,7 @@ #include "quick3dnodeinstance.h" #include "qt5nodeinstanceserver.h" +#include "qt5informationnodeinstanceserver.h" #include @@ -39,6 +40,7 @@ #include #include #include +#include #endif namespace QmlDesigner { @@ -56,6 +58,14 @@ Quick3DNodeInstance::~Quick3DNodeInstance() void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance, InstanceContainer::NodeFlags flags) { +#ifdef QUICK3D_MODULE + if (auto repObj = qobject_cast(object())) { + if (auto infoServer = qobject_cast(nodeInstanceServer())) { + QObject::connect(repObj, &QQuick3DRepeater::objectAdded, + infoServer, &Qt5InformationNodeInstanceServer::handleRepeaterAddObject); + } + } +#endif ObjectNodeInstance::initialize(objectNodeInstance, flags); } diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml index 1a2775e8f1b..c2bf8fb4b8d 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml @@ -42,6 +42,12 @@ Item { anchors.fill: parent color: mouseRegion.containsMouse ? StudioTheme.Values.themeControlBackgroundHover : StudioTheme.Values.themePanelBackground + Behavior on color { + ColorAnimation { + duration: StudioTheme.Values.hoverDuration + easing.type: StudioTheme.Values.hoverEasing + } + } Image { id: itemIcon // to be set by model diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml index 034d460d8fd..f37a0e05d01 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml @@ -266,8 +266,7 @@ Item { Grid { id: itemGrid - property real actualWidth: parent.width - itemGrid.leftPadding -itemGrid.rightPadding - property int flexibleWidth: (itemGrid.actualWidth / columns) - styleConstants.cellWidth + property real actualWidth: parent.width - itemGrid.leftPadding - itemGrid.rightPadding leftPadding: 6 rightPadding: 6 @@ -280,7 +279,7 @@ Item { visible: itemVisible textColor: importUnimported ? StudioTheme.Values.themeUnimportedModuleColor : StudioTheme.Values.themeTextColor - width: styleConstants.cellWidth + itemGrid.flexibleWidth + width: styleConstants.cellWidth height: styleConstants.cellHeight onShowContextMenu: { if (!itemUsable) { @@ -304,7 +303,7 @@ Item { id: horizontalView Row { - padding: 5 + leftPadding: 5 ScrollView { id: horizontalScrollView @@ -421,7 +420,6 @@ Item { Grid { id: hItemGrid property real actualWidth: itemsView.width - 294 - property int flexibleWidth: (hItemGrid.actualWidth / hItemGrid.columns) - styleConstants.cellWidth leftPadding: 9 rightPadding: 9 @@ -435,7 +433,7 @@ Item { visible: itemVisible textColor: itemLibraryModel.importUnimportedSelected ? StudioTheme.Values.themeUnimportedModuleColor : StudioTheme.Values.themeTextColor - width: styleConstants.cellWidth + hItemGrid.flexibleWidth + width: styleConstants.cellWidth height: styleConstants.cellHeight onShowContextMenu: { if (!itemUsable) { diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml index 36c823ec631..c68891f3318 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml @@ -96,6 +96,14 @@ Item { color: mouseArea.containsMouse && enabled ? StudioTheme.Values.themeControlBackgroundHover : StudioTheme.Values.themeControlBackground + + Behavior on color { + ColorAnimation { + duration: StudioTheme.Values.hoverDuration + easing.type: StudioTheme.Values.hoverEasing + } + } + enabled: index !== 0 || !rootView.subCompEditMode Label { // + sign @@ -150,13 +158,20 @@ Item { color: StudioTheme.Values.themeControlBackground border.color: StudioTheme.Values.themeControlOutline border.width: StudioTheme.Values.border + + Behavior on color { + ColorAnimation { + duration: StudioTheme.Values.hoverDuration + easing.type: StudioTheme.Values.hoverEasing + } + } } height: StudioTheme.Values.defaultControlHeight leftPadding: 32 rightPadding: 30 - + topPadding: 6 anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 5 diff --git a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml index eb0cb21adf1..3e91ab70f11 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml @@ -133,7 +133,7 @@ Item { Rectangle { // TabBar readonly property int animDur: 500 - id: samTabRect + id: tabBar x: 10 // left padding width: parent.width - 64 // right padding height: DialogValues.projectViewHeaderHeight @@ -153,15 +153,15 @@ Item { verticalAlignment: Text.AlignVCenter color: tabBarRow.currIndex === index ? DialogValues.textColorInteraction : DialogValues.textColor - Behavior on color { ColorAnimation { duration: samTabRect.animDur } } + Behavior on color { ColorAnimation { duration: tabBar.animDur } } MouseArea { anchors.fill: parent onClicked: { tabBarRow.currIndex = index projectModel.setPage(index) - projectViewId.currentIndex = 0 - projectViewId.currentIndexChanged() + projectView.currentIndex = 0 + projectView.currentIndexChanged() strip.x = parent.x strip.width = parent.width @@ -180,13 +180,26 @@ Item { color: DialogValues.textColorInteraction anchors.bottom: parent.bottom - Behavior on x { SmoothedAnimation { duration: samTabRect.animDur } } - Behavior on width { SmoothedAnimation { duration: strip.width === 0 ? 0 : samTabRect.animDur } } // do not animate initial width + Behavior on x { SmoothedAnimation { duration: tabBar.animDur } } + Behavior on width { SmoothedAnimation { duration: strip.width === 0 ? 0 : tabBar.animDur } } // do not animate initial width + } + + Connections { + target: rootDialog + function onWidthChanged() { + if (rootDialog.width < 1200) { // 1200 = the width threshold + tabBar.width = tabBar.parent.width - 20 + projectView.width = projectView.parent.width - 20 + } else { + tabBar.width = tabBar.parent.width - 64 + projectView.width = projectView.parent.width - 64 + } + } } } // Rectangle NewProjectView { - id: projectViewId + id: projectView x: 10 // left padding width: parent.width - 64 // right padding height: DialogValues.projectViewHeight @@ -196,9 +209,9 @@ Item { target: rootDialog function onHeightChanged() { if (rootDialog.height < 700) { // 700 = minimum height big dialog - projectViewId.height = DialogValues.projectViewHeight / 2 + projectView.height = DialogValues.projectViewHeight / 2 } else { - projectViewId.height = DialogValues.projectViewHeight + projectView.height = DialogValues.projectViewHeight } } } @@ -213,7 +226,7 @@ Item { lineHeight: DialogValues.defaultLineHeight lineHeightMode: Text.FixedHeight leftPadding: 14 - width: projectViewId.width + width: projectView.width color: DialogValues.textColor wrapMode: Text.WordWrap maximumLineCount: 4 diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml index 0dafb43e44b..b99b99dc952 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml @@ -35,7 +35,7 @@ QtObject { readonly property int projectViewMinimumHeight: projectViewHeight readonly property int dialogContentHeight: projectViewHeight + 300 // i.e. dialog without header and footer readonly property int loadedPanesWidth: detailsPaneWidth + stylesPaneWidth - readonly property int detailsPaneWidth: 330 + detailsPanePadding * 2// + 10 // 50 + readonly property int detailsPaneWidth: 330 + detailsPanePadding * 2 readonly property int dialogTitleTextHeight: 47 /* detailsScrollableContentHeight - the full height that may need to be scrolled to be fully visible, if the dialog box is too small. */ diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioSection.qml deleted file mode 100644 index db226e755a9..00000000000 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/AudioSection.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2021 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import HelperWidgets 2.0 -import StudioControls 1.0 as StudioControls -import StudioTheme 1.0 as StudioTheme - -Section { - caption: qsTr("Audio") - - anchors.left: parent.left - anchors.right: parent.right - - SectionLayout { - PropertyLabel { text: qsTr("Volume") } - - SecondColumnLayout { - SpinBox { - implicitWidth: StudioTheme.Values.twoControlColumnWidth - + StudioTheme.Values.actionIndicatorWidth - backendValue: backendValues.volume - decimals: 1 - minimumValue: 0.0 - maximumValue: 1.0 - } - - ExpandingSpacer {} - } - - PropertyLabel { text: qsTr("Muted") } - - SecondColumnLayout { - CheckBox { - implicitWidth: StudioTheme.Values.twoControlColumnWidth - + StudioTheme.Values.actionIndicatorWidth - backendValue: backendValues.muted - text: backendValues.muted.valueToString - } - - ExpandingSpacer {} - } - } -} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml index b76a1bd0fb5..979a276e6e2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/MediaPlayerSection.qml @@ -52,5 +52,41 @@ Section { ExpandingSpacer {} } + + PropertyLabel { + text: qsTr("Audio Output") + tooltip: qsTr("Holds the target audio output.") + } + + SecondColumnLayout { + ItemFilterComboBox { + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + typeFilter: "QtQuick.AudioOutput" + validator: RegExpValidator { regExp: /(^$|^[a-z_]\w*)/ } + backendValue: backendValues.audioOutput + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Video Output") + tooltip: qsTr("Holds the target video output.") + } + + SecondColumnLayout { + ItemFilterComboBox { + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + typeFilter: "QtQuick.VideoOutput" + validator: RegExpValidator { regExp: /(^$|^[a-z_]\w*)/ } + backendValue: backendValues.videoOutput + } + + ExpandingSpacer {} + } } } diff --git a/src/plugins/qmldesigner/qtquickplugin/source/audio.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoOutputSpecifics.qml similarity index 82% rename from src/plugins/qmldesigner/qtquickplugin/source/audio.qml rename to share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoOutputSpecifics.qml index b3d1347e85e..66f29f1cada 100644 --- a/src/plugins/qmldesigner/qtquickplugin/source/audio.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtMultimedia/VideoOutputSpecifics.qml @@ -23,13 +23,15 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtMultimedia 6.0 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme -MediaPlayer { - audioOutput: output +Column { + anchors.left: parent.left + anchors.right: parent.right - AudioOutput { - id: output - } + VideoSection {} } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml index 8294068ccfd..61ffd0ce407 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml @@ -60,6 +60,8 @@ StudioControls.ComboBox { familyNames.push(fontLoader.name) } + // Remove duplicate family names + familyNames = [...new Set(familyNames)] familyNames.sort() comboBox.model = familyNames } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index 031921c8ba0..031e8d8946f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -91,6 +91,10 @@ QtObject { property real toolTipHeight: 25 property int toolTipDelay: 1000 + // Controls hover animation params + property int hoverDuration: 500 + property int hoverEasing: Easing.OutExpo + // Layout sizes property real sectionColumnSpacing: 20 // distance between label and sliderControlSize property real sectionRowSpacing: 5 diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml index 2deb46b2123..1e592865cff 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml @@ -239,6 +239,14 @@ Rectangle { Component.onCompleted: { text = myRoot.delegateStateName } + + //QDS-5649: + Keys.priority: Keys.BeforeItem + Keys.onEscapePressed: function (event) { + event.accepted = true + stateNameField.text = myRoot.delegateStateName + stateNameField.focus = false + } } Text { diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml index 9defca106fe..5bb834011f3 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml @@ -38,11 +38,7 @@ FocusScope { property int delegateColumnSpacing: 2 property int delegateStateMargin: 16 property int delegatePreviewMargin: 16 - - height: (root.expanded ? (root.delegateTopAreaHeight + root.delegateBottomAreaHeight + root.delegateColumnSpacing) - : root.delegateTopAreaHeight) - + StudioTheme.Values.scrollBarThickness - + 2 * (root.delegateStateMargin + StudioTheme.Values.border + root.padding) + property int effectiveHeight: root.expanded ? 287 : 85 // height of the states area signal createNewState signal deleteState(int internalNodeId) @@ -52,7 +48,7 @@ FocusScope { property int padding: 2 property int delegateWidth: root.stateImageSize + 2 * (root.delegateStateMargin + root.delegatePreviewMargin) - property int delegateHeight: root.height + property int delegateHeight: effectiveHeight - StudioTheme.Values.scrollBarThickness - 2 * (root.padding + StudioTheme.Values.border) property int innerSpacing: 2 @@ -65,10 +61,6 @@ FocusScope { function onChangedToState(n) { root.currentStateInternalId = n } } - SystemPalette { - id: palette - } - Rectangle { id: background anchors.fill: parent @@ -93,70 +85,51 @@ FocusScope { StudioControls.MenuItem { text: root.expanded ? qsTr("Collapse") : qsTr("Expand") - onTriggered: { - root.expanded = !root.expanded - } + onTriggered: root.expanded = !root.expanded } } } - function closeContextMenu() { - if (contextMenu.open) - contextMenu.dismiss() - } - - Item { - id: addStateItem - - property int buttonLeftSpacing: 8 * (root.expanded ? 1 : 2) + AbstractButton { + id: addStateButton + buttonIcon: root.expanded ? qsTr("Create New State") : StudioTheme.Constants.plus + iconFont: root.expanded ? StudioTheme.Constants.font : StudioTheme.Constants.iconFont + iconSize: root.expanded ? StudioTheme.Values.myFontSize : StudioTheme.Values.myIconFontSize + iconItalic: root.expanded + tooltip: qsTr("Add a new state.") + visible: canAddNewStates anchors.right: parent.right - width: root.delegateHeight / 2 + buttonLeftSpacing - height: root.delegateHeight + anchors.rightMargin: 8 + y: (Math.min(effectiveHeight, root.height) - height) / 2 + width: Math.max(root.delegateHeight / 2 - 8, 18) + height: root.expanded ? 60 : width - AbstractButton { - id: addStateButton - - buttonIcon: root.expanded ? qsTr("Create New State") : StudioTheme.Constants.plus - iconFont: root.expanded ? StudioTheme.Constants.font : StudioTheme.Constants.iconFont - iconSize: root.expanded ? StudioTheme.Values.myFontSize : StudioTheme.Values.myIconFontSize - iconItalic: root.expanded ? true : false - tooltip: qsTr("Add a new state.") - visible: canAddNewStates - anchors.right: parent.right - anchors.rightMargin: 8 - anchors.verticalCenter: parent.verticalCenter - width: Math.max(parent.height / 2 - 8, 18) - height: root.expanded ? 80 : width - - onClicked: { - root.closeContextMenu() - root.createNewState() - } + onClicked: { + contextMenu.dismiss() + root.createNewState() } } - Rectangle { + Rectangle { // separator lines between state items color: StudioTheme.Values.themeStateSeparator x: root.padding y: root.padding - width: Math.min((root.delegateWidth * flickable.count) + (2 * (flickable.count - 1)), - flickable.width) + width: statesListView.width height: root.delegateHeight } ListView { - id: flickable + id: statesListView boundsBehavior: Flickable.StopAtBounds clip: true - anchors.left: parent.left - anchors.right: addStateItem.left - height: root.delegateHeight + StudioTheme.Values.scrollBarThickness + x: root.padding y: root.padding - anchors.leftMargin: root.padding - anchors.rightMargin: root.padding + width: Math.min(root.delegateWidth * statesListView.count + root.innerSpacing * (statesListView.count - 1), + root.width - addStateButton.width - root.padding - 16) // 16 = 2 * 8 (addStateButton margin) + height: root.delegateHeight + StudioTheme.Values.scrollBarThickness model: statesEditorModel orientation: ListView.Horizontal @@ -174,7 +147,7 @@ FocusScope { delegateStateImageSize: stateImageSize delegateHasWhenCondition: hasWhenCondition delegateWhenConditionString: whenConditionString - onDelegateInteraction: root.closeContextMenu() + onDelegateInteraction: contextMenu.dismiss() columnSpacing: root.delegateColumnSpacing topAreaHeight: root.delegateTopAreaHeight @@ -183,16 +156,6 @@ FocusScope { previewMargin: root.delegatePreviewMargin } - property bool bothVisible: horizontal.scrollBarVisible && vertical.scrollBarVisible - - ScrollBar.horizontal: HorizontalScrollBar { - id: horizontal - parent: flickable - } - - ScrollBar.vertical: VerticalScrollBar { - id: vertical - parent: flickable - } + ScrollBar.horizontal: HorizontalScrollBar {} } } diff --git a/src/app/app-Info.plist b/src/app/app-Info.plist index 95863741ac6..eba0ea7a61d 100644 --- a/src/app/app-Info.plist +++ b/src/app/app-Info.plist @@ -256,8 +256,22 @@ ${MACOSX_DEPLOYMENT_TARGET} NSAppleEventsUsageDescription This application wants to run AppleScript. + NSDesktopFolderUsageDescription + This application wants to access the Desktop folder. + NSDocumentsFolderUsageDescription + This application wants to access the Documents folder. + NSDownloadsFolderUsageDescription + This application wants to access the Downloads folder. + NSNetworkVolumesUsageDescription + This application wants to access network volumes. + NSRemovableVolumesUsageDescription + This application wants to access removable volumes. + NSFileProviderDomainUsageDescription + This application wants to access files from a provider. NSBluetoothPeripheralUsageDescription A user application wants to access bluetooth. + NSBluetoothAlwaysUsageDescription + A user application wants to access bluetooth. NSCalendarsUsageDescription A user application wants to access calendars. NSCameraUsageDescription diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt index 1fd49e178e1..df1826f7342 100644 --- a/src/libs/CMakeLists.txt +++ b/src/libs/CMakeLists.txt @@ -31,7 +31,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qlitehtml/src/CMakeLists.txt) set(QLITEHTML_DEVEL_EXCLUDE_FROM_ALL ON) set(QLITEHTML_HEADER_PATH "${IDE_HEADER_INSTALL_PATH}/src/lib/qlitehtml") set(QT_VERSION_MAJOR ${Qt5_VERSION_MAJOR}) - set(BUILD_TESTING OFF) # otherwise litehtml downloads googletest + option(BUILD_TESTING "Build litehtml tests" OFF) # otherwise litehtml downloads googletest add_subdirectory(qlitehtml/src) endif() if(TARGET qlitehtml) diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index f280b53c01a..21c501791c6 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -1236,7 +1236,11 @@ bool Check::visit(FunctionExpression *ast) } } - addMessage(ErrFunctionsNotSupportedInQmlUi, locationFromRange(locfunc, loclparen)); + const bool isDirectInConnectionsScope = + (!m_typeStack.isEmpty() && m_typeStack.last() == "Connections"); + + if (!isDirectInConnectionsScope) + addMessage(ErrFunctionsNotSupportedInQmlUi, locationFromRange(locfunc, loclparen)); DeclarationsCheck bodyCheck; addMessages(bodyCheck(ast)); diff --git a/src/libs/sqlite/CMakeLists.txt b/src/libs/sqlite/CMakeLists.txt index 09b294325f8..c2009339259 100644 --- a/src/libs/sqlite/CMakeLists.txt +++ b/src/libs/sqlite/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_library(Sqlite + PROPERTIES AUTOMOC OFF AUTOUIC OFF PUBLIC_DEFINES BUILD_SQLITE_LIBRARY SQLITE_CORE diff --git a/src/libs/sqlite/sqlitealgorithms.h b/src/libs/sqlite/sqlitealgorithms.h index a2fb76ad87f..df1ea44d483 100644 --- a/src/libs/sqlite/sqlitealgorithms.h +++ b/src/libs/sqlite/sqlitealgorithms.h @@ -27,6 +27,8 @@ #include +#include + namespace Sqlite { constexpr int compare(Utils::SmallStringView first, Utils::SmallStringView second) noexcept @@ -41,6 +43,8 @@ constexpr int compare(Utils::SmallStringView first, Utils::SmallStringView secon return difference; } +enum class UpdateChange { No, Update }; + template> lastValue; while (true) { bool hasMoreValues = currentValueIterator != endValueIterator; @@ -67,21 +72,42 @@ void insertUpdateDelete(SqliteRange &&sqliteRange, auto &&value = *currentValueIterator; auto compare = compareKey(sqliteValue, value); if (compare == 0) { - updateCallback(sqliteValue, value); - ++currentValueIterator; + UpdateChange updateChange = updateCallback(sqliteValue, value); + switch (updateChange) { + case UpdateChange::Update: + lastValue = value; + break; + case UpdateChange::No: + lastValue.reset(); + break; + } ++currentSqliteIterator; + ++currentValueIterator; } else if (compare > 0) { insertCallback(value); ++currentValueIterator; } else if (compare < 0) { - deleteCallback(sqliteValue); + if (lastValue) { + if (compareKey(sqliteValue, *lastValue) != 0) + deleteCallback(sqliteValue); + lastValue.reset(); + } else { + deleteCallback(sqliteValue); + } ++currentSqliteIterator; } } else if (hasMoreValues) { insertCallback(*currentValueIterator); ++currentValueIterator; } else if (hasMoreSqliteValues) { - deleteCallback(*currentSqliteIterator); + auto &&sqliteValue = *currentSqliteIterator; + if (lastValue) { + if (compareKey(sqliteValue, *lastValue) != 0) + deleteCallback(sqliteValue); + lastValue.reset(); + } else { + deleteCallback(sqliteValue); + } ++currentSqliteIterator; } else { break; diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index f4c09ab1327..8118d11ea79 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -639,11 +639,12 @@ public: std::function m_displayFilter; std::unique_ptr m_checker; + Qt::TextElideMode m_elideMode = Qt::ElideNone; QString m_placeHolderText; QString m_historyCompleterKey; PathChooser::Kind m_expectedKind = PathChooser::File; EnvironmentChange m_environmentChange; - QPointer m_labelDisplay; + QPointer m_labelDisplay; QPointer m_lineEditDisplay; QPointer m_pathChooserDisplay; QPointer m_textEditDisplay; @@ -935,6 +936,16 @@ void StringAspect::setPlaceHolderText(const QString &placeHolderText) d->m_textEditDisplay->setPlaceholderText(placeHolderText); } +/*! + Sets \a elideMode as label elide mode. +*/ +void StringAspect::setElideMode(Qt::TextElideMode elideMode) +{ + d->m_elideMode = elideMode; + if (d->m_labelDisplay) + d->m_labelDisplay->setElideMode(elideMode); +} + /*! Sets \a historyCompleterKey as key for the history completer settings for line edits and path chooser displays. @@ -1144,7 +1155,8 @@ void StringAspect::addToLayout(LayoutBuilder &builder) } break; case LabelDisplay: - d->m_labelDisplay = createSubWidget(); + d->m_labelDisplay = createSubWidget(); + d->m_labelDisplay->setElideMode(d->m_elideMode); d->m_labelDisplay->setTextInteractionFlags(Qt::TextSelectableByMouse); d->m_labelDisplay->setText(displayedString); d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayedString : toolTip()); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 9124bb2ddf6..0771dc65bf1 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -308,6 +308,7 @@ public: void setValidationFunction(const Utils::FancyLineEdit::ValidationFunction &validator); void setOpenTerminalHandler(const std::function &openTerminal); void setAutoApplyOnEditingFinished(bool applyOnEditingFinished); + void setElideMode(Qt::TextElideMode elideMode); void validateInput(); diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index 6c76808177e..d82617ea463 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -111,7 +111,7 @@ static QLayout *createLayoutFromType(LayoutBuilder::LayoutType layoutType) switch (layoutType) { case LayoutBuilder::FormLayout: { auto formLayout = new QFormLayout; - formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); + formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); return formLayout; } case LayoutBuilder::GridLayout: { diff --git a/src/libs/utils/process_stub_unix.c b/src/libs/utils/process_stub_unix.c index 856efa26af9..1cb3e8aa264 100644 --- a/src/libs/utils/process_stub_unix.c +++ b/src/libs/utils/process_stub_unix.c @@ -325,6 +325,13 @@ int main(int argc, char *argv[]) kill(chldPid, SIGKILL); } break; + case 'i': + if (chldPid > 0) { + int res = kill(chldPid, SIGINT); + if (res) + perror("Stub could not interrupt inferior"); + } + break; case 'c': { int res = write(blockingPipe[1], &c, 1); if (res < 0) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index eace8d36eab..d55ef90a443 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -589,7 +589,7 @@ FilePath AndroidConfig::openJDKBinPath() const FilePath AndroidConfig::keytoolPath() const { - return openJDKBinPath().pathAppended(keytoolName); + return openJDKBinPath().pathAppended(keytoolName).withExecutableSuffix(); } QVector AndroidConfig::connectedDevices(QString *error) const diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index ba7f0700aba..5fe710b6b7b 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -84,7 +84,8 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(BuildStepList *bs setWidgetExpandedByDefault(false); setImmutable(true); setSummaryUpdater([this] { - return tr("Make install: Copy App Files to %1").arg(nativeAndroidBuildPath()); + return tr("Make install: Copy App Files to %1") + .arg(QDir::toNativeSeparators(nativeAndroidBuildPath())); }); setUseEnglishOutput(); } diff --git a/src/plugins/autotest/gtest/gtestconfiguration.cpp b/src/plugins/autotest/gtest/gtestconfiguration.cpp index cbdd0c8e8a2..ff60f32171c 100644 --- a/src/plugins/autotest/gtest/gtestconfiguration.cpp +++ b/src/plugins/autotest/gtest/gtestconfiguration.cpp @@ -59,18 +59,18 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted) "--gtest_print_time=" }; - QSet allowed = Utils::filtered(Utils::toSet(provided), [] (const QString &arg) { + QStringList allowed = Utils::filtered(provided, [] (const QString &arg) { return Utils::allOf(knownInterferingOptions, [&arg] (const QString &interfering) { return !arg.startsWith(interfering); }); }); - if (omitted) { + if (omitted && allowed.size() < provided.size()) { QSet providedSet = Utils::toSet(provided); - providedSet.subtract(allowed); + providedSet.subtract(Utils::toSet(allowed)); omitted->append(Utils::toList(providedSet)); } - return Utils::toList(allowed); + return allowed; } QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) const diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index 9d20b4364da..be1064aa88e 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -395,10 +395,14 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath, bool ClangdTextMark::addToolTipContent(QLayout *target) const { const auto canApplyFixIt = [c = m_client, diag = m_lspDiagnostic, fp = fileName()] { - return c && c->reachable() && c->hasDiagnostic(DocumentUri::fromFilePath(fp), diag); + return QTC_GUARD(c) && c->reachable() + && c->hasDiagnostic(DocumentUri::fromFilePath(fp), diag); }; + const QString clientName = QTC_GUARD(m_client) ? m_client->name() : "clangd [unknown]"; target->addWidget(ClangDiagnosticWidget::createWidget({m_diagnostic}, - ClangDiagnosticWidget::ToolTip, canApplyFixIt, m_client ? m_client->name() : "clangd")); + ClangDiagnosticWidget::ToolTip, + canApplyFixIt, + clientName)); return true; } diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index a089248d039..3e82ba85209 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -581,7 +581,15 @@ QStringList createClangOptions(const ProjectPart &projectPart, const QString &fi LibClangOptionsBuilder optionsBuilder(projectPart, fileOptions.useBuildSystemWarnings()); const QStringList projectPartOptions = optionsBuilder.build(CppEditor::ProjectFile::Unsupported, UsePrecompiledHeaders::No); - return projectPartOptions + fileOptions.options(); + + // FIXME: Sanitize FileOptionsBuilder instead. + QStringList fileArgs = fileOptions.options(); + if (projectPartOptions.contains("-TP")) + fileArgs.removeAll("/TP"); + if (projectPartOptions.contains("-TC")) + fileArgs.removeAll("/TC"); + + return projectPartOptions + fileArgs; } ClangDiagnosticConfig warningsConfigForProject(Project *project) diff --git a/src/plugins/cppeditor/compileroptionsbuilder.cpp b/src/plugins/cppeditor/compileroptionsbuilder.cpp index e80de33f2b4..73994fd9c98 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder.cpp @@ -35,6 +35,8 @@ #include #include +#include + #include #include #include @@ -152,6 +154,7 @@ QStringList CompilerOptionsBuilder::build(ProjectFile::Kind fileKind, undefineClangVersionMacrosForMsvc(); undefineCppLanguageFeatureMacrosForMsvc2015(); addDefineFunctionMacrosMsvc(); + addDefineFunctionMacrosQnx(); addHeaderPathOptions(); @@ -404,8 +407,8 @@ void CompilerOptionsBuilder::addProjectMacros() static const int useMacros = qEnvironmentVariableIntValue("QTC_CLANG_USE_TOOLCHAIN_MACROS"); if (m_projectPart.toolchainType == ProjectExplorer::Constants::CUSTOM_TOOLCHAIN_TYPEID - || m_projectPart.toolchainType.name().contains("BareMetal") - || useMacros) { + || m_projectPart.toolchainType == Qnx::Constants::QNX_TOOLCHAIN_ID + || m_projectPart.toolchainType.name().contains("BareMetal") || useMacros) { addMacros(m_projectPart.toolChainMacros); } @@ -771,6 +774,17 @@ void CompilerOptionsBuilder::undefineClangVersionMacrosForMsvc() } } +void CompilerOptionsBuilder::addDefineFunctionMacrosQnx() +{ + // QNX 7.0+ uses GCC with LIBCPP from Clang, and in that context GCC is giving + // the builtin operator new and delete. + // + // In our case we have only Clang and need to instruct LIBCPP that it doesn't + // have these operators. This makes the code model happy and doesn't produce errors. + if (m_projectPart.toolchainType == Qnx::Constants::QNX_TOOLCHAIN_ID) + addMacros({{"_LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE"}}); +} + void CompilerOptionsBuilder::reset() { m_options.clear(); diff --git a/src/plugins/cppeditor/compileroptionsbuilder.h b/src/plugins/cppeditor/compileroptionsbuilder.h index cc75e984bed..6ae97323354 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder.h +++ b/src/plugins/cppeditor/compileroptionsbuilder.h @@ -84,6 +84,8 @@ public: void addProjectConfigFileInclude(); void undefineClangVersionMacrosForMsvc(); + void addDefineFunctionMacrosQnx(); + // Add custom options void add(const QString &arg, bool gccOnlyOption = false); void prepend(const QString &arg); diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp index 99e0f8befc5..b26165ca023 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp +++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp @@ -74,8 +74,7 @@ CppUseSelectionsUpdater::RunnerInfo CppUseSelectionsUpdater::update(CallType cal auto *cppEditorDocument = qobject_cast(cppEditorWidget->textDocument()); QTC_ASSERT(cppEditorDocument, return RunnerInfo::FailedToStart); - if (!CppModelManager::instance()->supportsLocalUses(cppEditorDocument)) - return RunnerInfo::AlreadyUpToDate; + m_updateSelections = CppModelManager::instance()->supportsLocalUses(cppEditorDocument); CursorInfoParams params; params.semanticInfo = cppEditorWidget->semanticInfo(); @@ -130,16 +129,16 @@ bool CppUseSelectionsUpdater::isSameIdentifierAsBefore(const QTextCursor &cursor void CppUseSelectionsUpdater::processResults(const CursorInfo &result) { - ExtraSelections localVariableSelections; - if (!result.useRanges.isEmpty() || !currentUseSelections().isEmpty()) { - ExtraSelections selections = updateUseSelections(result.useRanges); - if (result.areUseRangesForLocalVariable) - localVariableSelections = selections; + if (m_updateSelections) { + ExtraSelections localVariableSelections; + if (!result.useRanges.isEmpty() || !currentUseSelections().isEmpty()) { + ExtraSelections selections = updateUseSelections(result.useRanges); + if (result.areUseRangesForLocalVariable) + localVariableSelections = selections; + } + updateUnusedSelections(result.unusedVariablesRanges); + emit selectionsForVariableUnderCursorUpdated(localVariableSelections); } - - updateUnusedSelections(result.unusedVariablesRanges); - - emit selectionsForVariableUnderCursorUpdated(localVariableSelections); emit finished(result.localUses, true); } diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.h b/src/plugins/cppeditor/cppuseselectionsupdater.h index 925b3fba2e5..83552fc259c 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.h +++ b/src/plugins/cppeditor/cppuseselectionsupdater.h @@ -79,6 +79,7 @@ private: QScopedPointer> m_runnerWatcher; int m_runnerRevision = -1; int m_runnerWordStartPosition = -1; + bool m_updateSelections = true; }; } // namespace Internal diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 624de7002b2..69863f91202 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -254,6 +254,7 @@ QList DiffOpenFilesController::reloadInputList() const const QList openedDocuments = DocumentModel::openedDocuments(); for (IDocument *doc : openedDocuments) { + QTC_ASSERT(doc, continue); auto textDocument = qobject_cast(doc); if (textDocument && textDocument->isModified()) { @@ -518,6 +519,7 @@ void DiffEditorPluginPrivate::updateDiffCurrentFileAction() void DiffEditorPluginPrivate::updateDiffOpenFilesAction() { const bool enabled = Utils::anyOf(DocumentModel::openedDocuments(), [](IDocument *doc) { + QTC_ASSERT(doc, return false); return doc->isModified() && qobject_cast(doc); }); m_diffOpenFilesAction->setEnabled(enabled); diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 962c3ad5d65..12325f1c825 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -692,7 +692,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document, const QString method(DidChangeTextDocumentNotification::methodName); TextDocumentSyncKind syncKind = m_serverCapabilities.textDocumentSyncKindHelper(); if (Utils::optional registered = m_dynamicCapabilities.isRegistered(method)) { - syncKind = registered.value() ? TextDocumentSyncKind::None : TextDocumentSyncKind::Full; + syncKind = registered.value() ? TextDocumentSyncKind::Full : TextDocumentSyncKind::None; if (syncKind != TextDocumentSyncKind::None) { const TextDocumentChangeRegistrationOptions option( m_dynamicCapabilities.option(method).toObject()); diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index 3eec6cbbd9d..bce818f96a9 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -392,8 +392,10 @@ bool LanguageClientCompletionAssistProcessor::running() void LanguageClientCompletionAssistProcessor::cancel() { if (m_currentRequest.has_value()) { - m_client->cancelRequest(m_currentRequest.value()); - m_client->removeAssistProcessor(this); + if (m_client) { + m_client->cancelRequest(m_currentRequest.value()); + m_client->removeAssistProcessor(this); + } m_currentRequest.reset(); } else if (m_postponedUpdateConnection) { QObject::disconnect(m_postponedUpdateConnection); diff --git a/src/plugins/languageclient/semantichighlightsupport.cpp b/src/plugins/languageclient/semantichighlightsupport.cpp index 4c5a30531f5..6aac1b7cef0 100644 --- a/src/plugins/languageclient/semantichighlightsupport.cpp +++ b/src/plugins/languageclient/semantichighlightsupport.cpp @@ -75,6 +75,10 @@ void SemanticTokenSupport::reloadSemanticTokens(TextDocument *textDocument) const TextDocumentIdentifier docId(DocumentUri::fromFilePath(filePath)); auto responseCallback = [this, filePath, documentVersion = m_client->documentVersion(filePath)]( const SemanticTokensFullRequest::Response &response) { + if (const auto error = response.error()) { + qCDebug(LOGLSPHIGHLIGHT) + << "received error" << error->code() << error->message() << "for" << filePath; + } handleSemanticTokens(filePath, response.result().value_or(nullptr), documentVersion); }; /*if (supportedRequests.testFlag(SemanticRequestType::Range)) { @@ -120,6 +124,10 @@ void SemanticTokenSupport::updateSemanticTokens(TextDocument *textDocument) request.setResponseCallback( [this, filePath, documentVersion]( const SemanticTokensFullDeltaRequest::Response &response) { + if (const auto error = response.error()) { + qCDebug(LOGLSPHIGHLIGHT) << "received error" << error->code() + << error->message() << "for" << filePath; + } handleSemanticTokensDelta(filePath, response.result().value_or(nullptr), documentVersion); @@ -285,6 +293,9 @@ void SemanticTokenSupport::handleSemanticTokens(const Utils::FilePath &filePath, m_tokens[filePath] = {*tokens, documentVersion}; highlight(filePath); } else { + qCDebug(LOGLSPHIGHLIGHT) + << "no data in reply to full semantic tokens request, clearing tokens" + << m_client->name() << filePath; m_tokens.remove(filePath); } } @@ -353,8 +364,10 @@ void SemanticTokenSupport::handleSemanticTokensDelta( tokens.setData(newData); tokens.setResultId(tokensDelta->resultId()); } else { + qCDebug(LOGLSPHIGHLIGHT) + << "no data in reply to semantic tokens delta request, clearing tokens" + << m_client->name() << filePath; m_tokens.remove(filePath); - qCDebug(LOGLSPHIGHLIGHT) << "Data cleared"; return; } highlight(filePath); diff --git a/src/plugins/mcusupport/mcusupportcmakemapper.cpp b/src/plugins/mcusupport/mcusupportcmakemapper.cpp index 34cd5782592..2541cd6d25a 100644 --- a/src/plugins/mcusupport/mcusupportcmakemapper.cpp +++ b/src/plugins/mcusupport/mcusupportcmakemapper.cpp @@ -56,7 +56,7 @@ static const QHash &envVarToCMakeVarMapping() {"RenesasFlashProgrammer_PATH", "RENESAS_FLASH_PROGRAMMER_PATH"}, {"MCUXpressoIDE_PATH", "MCUXPRESSO_IDE_PATH"}, {"JLINK_PATH", "JLINK_PATH"}, - {"CYPRESS_AUTO_FLASH_UTILITY_DIR", "CYPRESS_AUTO_FLASH_UTILITY_DIR"}, + {"CYPRESS_AUTO_FLASH_UTILITY_DIR", "INFINEON_AUTO_FLASH_UTILITY_DIR"}, {"EK_RA6M3G_E2_PROJECT_PATH", "EK_RA6M3G_E2_PROJECT_PATH"}, }; return mapping; diff --git a/src/plugins/mcusupport/wizards/application/CMakeLists.txt b/src/plugins/mcusupport/wizards/application/CMakeLists.txt index 71c4e023432..74c1c8357ba 100644 --- a/src/plugins/mcusupport/wizards/application/CMakeLists.txt +++ b/src/plugins/mcusupport/wizards/application/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.15) -project(%{ProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM) +project(%{ProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM ASM_MASM) find_package(Qul) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 81088c66e05..fc8af7b6507 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -2110,7 +2110,7 @@ Utils::optional MsvcToolChain::generateEnvironmentSettings(const Utils: Utils::Environment runEnv = env; runEnv.unset(QLatin1String("ORIGINALPATH")); run.setEnvironment(runEnv); - run.setTimeoutS(30); + run.setTimeoutS(60); Utils::FilePath cmdPath = Utils::FilePath::fromUserInput( QString::fromLocal8Bit(qgetenv("COMSPEC"))); if (cmdPath.isEmpty()) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index b1402e70f2f..25e49a5d908 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -794,7 +794,9 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags, cFlags = cxxFlags = commonFlags; const auto cxxLanguageVersion = arrayToStringList(getCppProp("cxxLanguageVersion")); - if (cxxLanguageVersion.contains("c++20")) + if (cxxLanguageVersion.contains("c++23")) + cxxFlags << "-std=c++2b"; + else if (cxxLanguageVersion.contains("c++20")) cxxFlags << "-std=c++20"; else if (cxxLanguageVersion.contains("c++17")) cxxFlags << "-std=c++17"; @@ -850,9 +852,12 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags, cxxFlags << "/TP"; if (!enableRtti.isUndefined()) cxxFlags << QLatin1String(enableRtti.toBool() ? "/GR" : "/GR-"); - if (getCppProp("cxxLanguageVersion").toArray().contains("c++20")) + const QJsonArray cxxLanguageVersion = getCppProp("cxxLanguageVersion").toArray(); + if (cxxLanguageVersion.contains("c++23")) + cxxFlags << "/std:c++latest"; + else if (cxxLanguageVersion.contains("c++20")) cxxFlags << "/std:c++20"; - else if (getCppProp("cxxLanguageVersion").toArray().contains("c++17")) + else if (cxxLanguageVersion.contains("c++17")) cxxFlags << "/std:c++17"; } } diff --git a/src/plugins/qmldesigner/components/bindingeditor/actioneditor.cpp b/src/plugins/qmldesigner/components/bindingeditor/actioneditor.cpp index 1f2a8224d33..ce4f124d340 100644 --- a/src/plugins/qmldesigner/components/bindingeditor/actioneditor.cpp +++ b/src/plugins/qmldesigner/components/bindingeditor/actioneditor.cpp @@ -202,33 +202,36 @@ void ActionEditor::prepareConnections() continue; const QString name = QString::fromUtf8(propertyName); + const bool writeable = modelNode.metaInfo().propertyIsWritable(propertyName); TypeName type = modelNode.metaInfo().propertyTypeName(propertyName); if (type.contains(".")) type.remove(0, 6); - connection.properties.append(ActionEditorDialog::PropertyOption(name, type)); + connection.properties.append(ActionEditorDialog::PropertyOption(name, type, writeable)); } for (const VariantProperty &variantProperty : modelNode.variantProperties()) { - if (variantProperty.isValid()) { - if (variantProperty.isDynamic()) { - if (!typeWhiteList.contains(variantProperty.dynamicTypeName())) - continue; + if (variantProperty.isValid() && variantProperty.isDynamic()) { + if (!typeWhiteList.contains(variantProperty.dynamicTypeName())) + continue; - const QString name = QString::fromUtf8(variantProperty.name()); - TypeName type = variantProperty.dynamicTypeName(); - if (type.contains(".")) - type.remove(0, 6); + const QString name = QString::fromUtf8(variantProperty.name()); + const bool writeable = modelNode.metaInfo().propertyIsWritable(variantProperty.name()); + TypeName type = variantProperty.dynamicTypeName(); + if (type.contains(".")) + type.remove(0, 6); - connection.properties.append(ActionEditorDialog::PropertyOption(name, type)); - } + connection.properties.append(ActionEditorDialog::PropertyOption(name, type, writeable)); } } for (const auto &slotName : modelNode.metaInfo().slotNames()) { + if (slotName.startsWith("q_") || slotName.startsWith("_q_")) + continue; + QmlJS::Document::MutablePtr newDoc = QmlJS::Document::create( QLatin1String(""), QmlJS::Dialect::JavaScript); - newDoc->setSource(QLatin1String(slotName)); + newDoc->setSource(modelNode.id() + "." + QLatin1String(slotName)); newDoc->parseExpression(); QmlJS::AST::ExpressionNode *expression = newDoc->expression(); @@ -263,10 +266,11 @@ void ActionEditor::prepareConnections() continue; const QString name = QString::fromUtf8(propertyName); + const bool writeable = metaInfo.propertyIsWritable(propertyName); if (type.contains(".")) type.remove(0, 6); - singelton.properties.append(ActionEditorDialog::PropertyOption(name, type)); + singelton.properties.append(ActionEditorDialog::PropertyOption(name, type, writeable)); } if (!singelton.properties.isEmpty()) { diff --git a/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.cpp b/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.cpp index 7e4fb86451b..12b3389b463 100644 --- a/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.cpp +++ b/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.cpp @@ -472,7 +472,7 @@ void ActionEditorDialog::fillAndSetTargetItem(const QString &value, bool useDefa } else { // ConnectionType::Assignment m_assignmentTargetItem->clear(); for (const auto &connection : qAsConst(m_connections)) { - if (!connection.properties.isEmpty()) + if (!connection.properties.isEmpty() && connection.hasWriteableProperties()) m_assignmentTargetItem->addItem(connection.item); } @@ -516,8 +516,10 @@ void ActionEditorDialog::fillAndSetTargetProperty(const QString &value, bool use if (idx == -1) { insertAndSetUndefined(m_assignmentTargetProperty); } else { - for (const auto &property : qAsConst(m_connections[idx].properties)) - m_assignmentTargetProperty->addItem(property.name, property.type); + for (const auto &property : qAsConst(m_connections[idx].properties)) { + if (property.isWriteable) + m_assignmentTargetProperty->addItem(property.name, property.type); + } if (m_assignmentTargetProperty->findText(value) != -1) { m_assignmentTargetProperty->setCurrentText(value); diff --git a/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.h b/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.h index e19c7fe657b..02d1cb94829 100644 --- a/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.h +++ b/src/plugins/qmldesigner/components/bindingeditor/actioneditordialog.h @@ -51,10 +51,10 @@ public: class PropertyOption { public: - PropertyOption() {} - PropertyOption(const QString &n, const TypeName &t) + PropertyOption(const QString &n, const TypeName &t, bool writeable = true) : name(n) , type(t) + , isWriteable(writeable) {} bool operator==(const QString &value) const { return value == name; } @@ -62,6 +62,7 @@ public: QString name; TypeName type; + bool isWriteable; }; class SingletonOption @@ -80,6 +81,16 @@ public: return false; } + bool hasWriteableProperties() const + { + for (const auto &p : properties) { + if (p.isWriteable) + return true; + } + + return false; + } + bool operator==(const QString &value) const { return value == item; } bool operator==(const SingletonOption &value) const { return value.item == item; } @@ -90,7 +101,6 @@ public: class ConnectionOption : public SingletonOption { public: - ConnectionOption() {} ConnectionOption(const QString &value) : SingletonOption(value) {} QStringList methods; diff --git a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h index 49505d2ca7d..6911ab27c7a 100644 --- a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h +++ b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h @@ -221,6 +221,7 @@ const int priorityLast = 60; const char addImagesDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", "Image Files"); const char addFontsDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", "Font Files"); const char addSoundsDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", "Sound Files"); +const char addVideosDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", "Video Files"); const char addShadersDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", "Shader Files"); const char add3DAssetsDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", "3D Assets"); const char addQt3DSPresentationsDisplayString[] = QT_TRANSLATE_NOOP("QmlDesignerAddResources", diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index 13774c12651..c521b653dd8 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -57,6 +57,7 @@ #include #include +#include #include #include @@ -1549,20 +1550,27 @@ void DesignerActionManager::createDefaultAddResourceHandler() registerAddResourceHandler(AddResourceHandler(category, ext, op)); }; + auto transformer = [](const QByteArray& format) -> QString { return QString("*.") + format; }; + auto imageFormats = Utils::transform(QImageReader::supportedImageFormats(), transformer); + imageFormats.push_back("*.hdr"); + // The filters will be displayed in reverse order to these lists in file dialog, // so declare most common types last - registerHandlers({"*.webp", "*.hdr", "*.svg", "*.bmp", "*.jpg", "*.png"}, + registerHandlers(imageFormats, ModelNodeOperations::addImageToProject, ComponentCoreConstants::addImagesDisplayString); registerHandlers({"*.otf", "*.ttf"}, ModelNodeOperations::addFontToProject, ComponentCoreConstants::addFontsDisplayString); - registerHandlers({"*.wav"}, + registerHandlers({"*.wav", "*.mp3"}, ModelNodeOperations::addSoundToProject, ComponentCoreConstants::addSoundsDisplayString); registerHandlers({"*.glsl", "*.glslv", "*.glslf", "*.vsh", "*.fsh", "*.vert", "*.frag"}, ModelNodeOperations::addShaderToProject, ComponentCoreConstants::addShadersDisplayString); + registerHandlers({"*.mp4"}, + ModelNodeOperations::addVideoToProject, + ComponentCoreConstants::addVideosDisplayString); } void DesignerActionManager::createDefaultModelNodePreviewImageHandlers() diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index 19ae5ea0e10..531355daca5 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -1083,6 +1083,11 @@ AddFilesResult addImageToProject(const QStringList &fileNames, const QString &de return addFilesToProject(fileNames, getAssetDefaultDirectory("images", defaultDirectory)); } +AddFilesResult addVideoToProject(const QStringList &fileNames, const QString &defaultDirectory) +{ + return addFilesToProject(fileNames, getAssetDefaultDirectory("videos", defaultDirectory)); +} + void createFlowActionArea(const SelectionContext &selectionContext) { AbstractView *view = selectionContext.view(); diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h index feb7faa556f..f9e39c06f48 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h @@ -80,6 +80,7 @@ AddFilesResult addImageToProject(const QStringList &fileNames, const QString &di AddFilesResult addFontToProject(const QStringList &fileNames, const QString &directory); AddFilesResult addSoundToProject(const QStringList &fileNames, const QString &directory); AddFilesResult addShaderToProject(const QStringList &fileNames, const QString &directory); +AddFilesResult addVideoToProject(const QStringList &fileNames, const QString &directory); void createFlowActionArea(const SelectionContext &selectionContext); void addTransition(const SelectionContext &selectionState); void addFlowEffect(const SelectionContext &selectionState, const TypeName &typeName); diff --git a/src/plugins/qmldesigner/components/itemlibrary/images/item-video-icon.png b/src/plugins/qmldesigner/components/itemlibrary/images/item-video-icon.png new file mode 100644 index 00000000000..df1b84e5c99 Binary files /dev/null and b/src/plugins/qmldesigner/components/itemlibrary/images/item-video-icon.png differ diff --git a/src/plugins/qmldesigner/components/itemlibrary/images/item-video-icon@2x.png b/src/plugins/qmldesigner/components/itemlibrary/images/item-video-icon@2x.png new file mode 100644 index 00000000000..4b9f31faf39 Binary files /dev/null and b/src/plugins/qmldesigner/components/itemlibrary/images/item-video-icon@2x.png differ diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.qrc b/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.qrc index b1777bbbec6..c6d60413d07 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.qrc +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.qrc @@ -33,5 +33,7 @@ images/x@2x.png images/browse.png images/browse@2x.png + images/item-video-icon.png + images/item-video-icon@2x.png diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsiconprovider.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsiconprovider.cpp index ece6e8abaab..ad6f3136837 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsiconprovider.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsiconprovider.cpp @@ -54,6 +54,8 @@ QPixmap ItemLibraryAssetsIconProvider::requestPixmap(const QString &id, QSize *s pixmap = Utils::StyleHelper::dpiSpecificImageFile(":/ItemLibrary/images/asset_shader_48.png"); else if (ItemLibraryAssetsModel::supportedAudioSuffixes().contains(suffix)) pixmap = Utils::StyleHelper::dpiSpecificImageFile(":/ItemLibrary/images/asset_sound_48.png"); + else if (ItemLibraryAssetsModel::supportedVideoSuffixes().contains(suffix)) + pixmap = Utils::StyleHelper::dpiSpecificImageFile(":/ItemLibrary/images/item-video-icon.png"); if (size) { size->setWidth(pixmap.width()); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp index caaaa374528..5fa13c3c16b 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp @@ -167,7 +167,13 @@ const QStringList &ItemLibraryAssetsModel::supportedFontSuffixes() const QStringList &ItemLibraryAssetsModel::supportedAudioSuffixes() { - static const QStringList retList {"*.wav"}; + static const QStringList retList {"*.wav", "*.mp3"}; + return retList; +} + +const QStringList &ItemLibraryAssetsModel::supportedVideoSuffixes() +{ + static const QStringList retList {"*.mp4"}; return retList; } @@ -300,6 +306,7 @@ const QSet &ItemLibraryAssetsModel::supportedSuffixes() const insertSuffixes(supportedShaderSuffixes()); insertSuffixes(supportedFontSuffixes()); insertSuffixes(supportedAudioSuffixes()); + insertSuffixes(supportedVideoSuffixes()); insertSuffixes(supportedTexture3DSuffixes()); } return allSuffixes; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.h index c1dcc845da0..f7621563492 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.h @@ -66,6 +66,7 @@ public: static const QStringList &supportedShaderSuffixes(); static const QStringList &supportedFontSuffixes(); static const QStringList &supportedAudioSuffixes(); + static const QStringList &supportedVideoSuffixes(); static const QStringList &supportedTexture3DSuffixes(); const QSet &previewableSuffixes() const; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index 4c02b25433b..2bb563ded3a 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -552,6 +552,9 @@ QPair ItemLibraryWidget::getAssetTypeAndData(const QString } else if (ItemLibraryAssetsModel::supportedAudioSuffixes().contains(suffix)) { // No extra data for sounds return {"application/vnd.bauhaus.libraryresource.sound", {}}; + } else if (ItemLibraryAssetsModel::supportedVideoSuffixes().contains(suffix)) { + // No extra data for videos + return {"application/vnd.bauhaus.libraryresource.video", {}}; } else if (ItemLibraryAssetsModel::supportedTexture3DSuffixes().contains(suffix)) { // Data: Image format (suffix) return {"application/vnd.bauhaus.libraryresource.texture3d", suffix.toUtf8()}; @@ -653,10 +656,12 @@ void ItemLibraryWidget::addResources(const QStringList &files) QStringList fileNames = categoryFileNames.values(category); AddResourceOperation operation = categoryToOperation.value(category); QmlDesignerPlugin::emitUsageStatistics(Constants::EVENT_RESOURCE_IMPORTED + category); - AddFilesResult result = operation(fileNames, document->fileName().parentDir().toString()); - if (result == AddFilesResult::Failed) { - Core::AsynchronousMessageBox::warning(tr("Failed to Add Files"), - tr("Could not add %1 to project.").arg(fileNames.join(' '))); + if (operation) { + AddFilesResult result = operation(fileNames, document->fileName().parentDir().toString()); + if (result == AddFilesResult::Failed) { + Core::AsynchronousMessageBox::warning(tr("Failed to Add Files"), + tr("Could not add %1 to project.").arg(fileNames.join(' '))); + } } } } diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp index d94f21bd352..4701a4079eb 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp @@ -168,12 +168,9 @@ void StatesEditorWidget::reloadQmlSource() connect(rootObject(), SIGNAL(createNewState()), m_statesEditorView.data(), SLOT(createNewState())); connect(rootObject(), SIGNAL(deleteState(int)), m_statesEditorView.data(), SLOT(removeState(int))); m_statesEditorView.data()->synchonizeCurrentStateFromWidget(); - setFixedHeight(initialSize().height()); - if (!DesignerSettings::getValue(DesignerSettingsKey::STATESEDITOR_EXPANDED).toBool()) { + if (!DesignerSettings::getValue(DesignerSettingsKey::STATESEDITOR_EXPANDED).toBool()) toggleStatesViewExpanded(); - setFixedHeight(rootObject()->height()); - } connect(rootObject(), SIGNAL(expandedChanged()), this, SLOT(handleExpandedChanged())); } @@ -184,7 +181,5 @@ void StatesEditorWidget::handleExpandedChanged() bool expanded = rootObject()->property("expanded").toBool(); DesignerSettings::setValue(DesignerSettingsKey::STATESEDITOR_EXPANDED, expanded); - - setFixedHeight(rootObject()->height()); } } diff --git a/src/plugins/qmldesigner/designercore/include/projectstorageids.h b/src/plugins/qmldesigner/designercore/include/projectstorageids.h index 765f2c9c659..082855fd912 100644 --- a/src/plugins/qmldesigner/designercore/include/projectstorageids.h +++ b/src/plugins/qmldesigner/designercore/include/projectstorageids.h @@ -25,6 +25,8 @@ #pragma once +#include + #include namespace QmlDesigner { @@ -73,6 +75,15 @@ public: InternalIntergerType id = -1; }; +template +auto toIntegers(const Container &container) +{ + using DataType = typename Container::value_type::DatabaseType; + const DataType *data = reinterpret_cast(container.data()); + + return Utils::span{data, container.size()}; +} + enum class BasicIdType { Type, PropertyType, diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index 676c9920bb2..b4b53a6d15e 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -538,8 +538,13 @@ QProcessEnvironment PuppetCreator::processEnvironment() const environment.set("QMLDESIGNER_QUICK3D_PARTICLES3D_MODE", "true"); import = QmlDesigner::Import::createLibraryImport("QtCharts", "2.0"); - if (m_model->hasImport(import, true, true)) + if (m_model->hasImport(import, true, true)) { environment.set("QMLDESIGNER_FORCE_QAPPLICATION", "true"); + } else if (m_target) { + auto bs = qobject_cast(m_target->buildSystem()); + if (bs && bs->widgetApp()) + environment.set("QMLDESIGNER_FORCE_QAPPLICATION", "true"); + } bool particlemode = QmlDesigner::DesignerSettings::getValue("particleMode").toBool(); if (!particlemode) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 49845ab13fd..d8fbbb1cd7d 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -957,7 +957,8 @@ static QList generatePossibleLibraryImports(const QHash= 0) { int minorVersion = (importKey.minorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 0 : importKey.minorVersion; QString version = QStringLiteral("%1.%2").arg(majorVersion).arg(minorVersion); - possibleImports.append(QmlDesigner::Import::createLibraryImport(libraryName, version)); + if (!libraryName.endsWith(".impl")) + possibleImports.append(QmlDesigner::Import::createLibraryImport(libraryName, version)); // In Qt6, QtQuick.Controls itself doesn't have any version as it has no types, // so it never gets added normally to possible imports. diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h index 5df23b73854..1d9fe437d26 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h @@ -77,14 +77,10 @@ public: TypeIds typeIdsToBeDeleted; - auto sourceIdValues = Utils::transform(package.sourceIds, [](SourceId sourceId) { - return &sourceId; - }); + std::sort(package.updatedSourceIds.begin(), package.updatedSourceIds.end()); - std::sort(sourceIdValues.begin(), sourceIdValues.end()); - - synchronizeFileStatuses(package.fileStatuses, sourceIdValues); - synchronizeImports(package.imports, sourceIdValues); + synchronizeFileStatuses(package.fileStatuses, package.updatedFileStatusSourceIds); + synchronizeImports(package.imports, package.updatedSourceIds); synchronizeTypes(package.types, updatedTypeIds, insertedAliasPropertyDeclarations, @@ -92,10 +88,10 @@ public: relinkableAliasPropertyDeclarations, relinkablePropertyDeclarations, relinkablePrototypes, - sourceIdValues); + package.updatedSourceIds); deleteNotUpdatedTypes(updatedTypeIds, - sourceIdValues, + package.updatedSourceIds, typeIdsToBeDeleted, relinkableAliasPropertyDeclarations, relinkablePropertyDeclarations, @@ -109,6 +105,8 @@ public: linkAliases(insertedAliasPropertyDeclarations, updatedAliasPropertyDeclarations); + synchronizeProjectDatas(package.projectDatas, package.updatedProjectSourceIds); + transaction.commit(); } @@ -271,7 +269,7 @@ public: SourceContextId fetchSourceContextId(SourceId sourceId) const { auto sourceContextId = selectSourceContextIdFromSourcesBySourceIdStatement - .template valueWithTransaction(sourceId.id); + .template valueWithTransaction(&sourceId); if (!sourceContextId) throw SourceIdDoesNotExists(); @@ -305,9 +303,16 @@ public: &sourceId); } - Storage::ProjectDatas fetchProjectDatas(SourceId sourceId) const override + Storage::ProjectDatas fetchProjectDatas(SourceId projectSourceId) const override { - return Storage::ProjectDatas{}; + return selectProjectDatasForModuleIdStatement + .template valuesWithTransaction(64, &projectSourceId); + } + + Storage::ProjectDatas fetchProjectDatas(const SourceIds &projectSourceIds) const + { + return selectProjectDatasForModuleIdsStatement + .template valuesWithTransaction(64, toIntegers(projectSourceIds)); } private: @@ -332,7 +337,7 @@ private: friend bool operator==(const Module &first, const Module &second) { - return first.id == second.id && first.value == second.value; + return &first == &second && first.value == second.value; } }; @@ -503,7 +508,7 @@ private: AliasPropertyDeclarations &relinkableAliasPropertyDeclarations, PropertyDeclarations &relinkablePropertyDeclarations, Prototypes &relinkablePrototypes, - const std::vector &sourceIdValues) + const SourceIds &updatedSourceIds) { Storage::ExportedTypes exportedTypes; exportedTypes.reserve(types.size() * 3); @@ -517,7 +522,7 @@ private: extractExportedTypes(typeId, type, exportedTypes); } - synchronizeExportedTypes(sourceIdValues, + synchronizeExportedTypes(updatedSourceIds, updatedTypeIds, exportedTypes, relinkableAliasPropertyDeclarations, @@ -532,10 +537,72 @@ private: relinkablePropertyDeclarations); } - void synchronizeFileStatuses(FileStatuses &fileStatuses, const std::vector &sourceIdValues) + void synchronizeProjectDatas(Storage::ProjectDatas &projectDatas, + const SourceIds &updatedProjectSourceIds) { auto compareKey = [](auto &&first, auto &&second) { - return first.sourceId.id - second.sourceId.id; + auto projectSourceIdDifference = &first.projectSourceId - &second.projectSourceId; + if (projectSourceIdDifference != 0) + return projectSourceIdDifference; + + return &first.sourceId - &second.sourceId; + }; + + std::sort(projectDatas.begin(), projectDatas.end(), [&](auto &&first, auto &&second) { + return std::tie(first.projectSourceId, first.sourceId) + < std::tie(second.projectSourceId, second.sourceId); + }); + + auto range = selectProjectDatasForModuleIdsStatement.template range( + toIntegers(updatedProjectSourceIds)); + + auto insert = [&](const Storage::ProjectData &projectData) { + if (!projectData.projectSourceId) + throw ProjectDataHasInvalidProjectSourceId{}; + if (!projectData.sourceId) + throw ProjectDataHasInvalidSourceId{}; + if (!projectData.moduleId) + throw ProjectDataHasInvalidModuleId{}; + + insertProjectDataStatement.write(&projectData.projectSourceId, + &projectData.sourceId, + &projectData.moduleId, + static_cast(projectData.fileType)); + }; + + auto update = [&](const Storage::ProjectData &projectDataFromDatabase, + const Storage::ProjectData &projectData) { + if (!projectData.moduleId) + throw ProjectDataHasInvalidModuleId{}; + + if (projectDataFromDatabase.fileType != projectData.fileType + || projectDataFromDatabase.moduleId != projectData.moduleId) { + updateProjectDataStatement.write(&projectData.projectSourceId, + &projectData.sourceId, + &projectData.moduleId, + static_cast(projectData.fileType)); + return Sqlite::UpdateChange::Update; + } + + return Sqlite::UpdateChange::No; + }; + + auto remove = [&](const Storage::ProjectData &projectData) { + deleteProjectDataStatement.write(&projectData.projectSourceId, &projectData.sourceId); + }; + + Sqlite::insertUpdateDelete(range, projectDatas, compareKey, insert, update, remove); + } + + void synchronizeFileStatuses(FileStatuses &fileStatuses, const SourceIds &updatedSourceIds) + { + auto updatedSourceIdValues = Utils::transform(updatedSourceIds, + [](SourceId sourceId) { + return &sourceId; + }); + + auto compareKey = [](auto &&first, auto &&second) { + return &first.sourceId - &second.sourceId; }; std::sort(fileStatuses.begin(), fileStatuses.end(), [&](auto &&first, auto &&second) { @@ -543,7 +610,7 @@ private: }); auto range = selectFileStatusesForSourceIdsStatement.template range( - Utils::span(sourceIdValues)); + toIntegers(updatedSourceIds)); auto insert = [&](const FileStatus &fileStatus) { insertFileStatusStatement.write(&fileStatus.sourceId, @@ -557,7 +624,10 @@ private: updateFileStatusStatement.write(&fileStatus.sourceId, fileStatus.size, fileStatus.lastModified); + return Sqlite::UpdateChange::Update; } + + return Sqlite::UpdateChange::No; }; auto remove = [&](const FileStatus &fileStatus) { @@ -567,30 +637,32 @@ private: Sqlite::insertUpdateDelete(range, fileStatuses, compareKey, insert, update, remove); } - void synchronizeImports(Storage::Imports &imports, std::vector &sourceIdValues) + void synchronizeImports(Storage::Imports &imports, const SourceIds &updatedSourceIds) { - deleteDocumentImportsForDeletedDocuments(imports, sourceIdValues); + deleteDocumentImportsForDeletedDocuments(imports, updatedSourceIds); - synchronizeDocumentImports(imports, sourceIdValues); + synchronizeDocumentImports(imports, updatedSourceIds); } void deleteDocumentImportsForDeletedDocuments(Storage::Imports &imports, - const std::vector &sourceIdValues) + const SourceIds &updatedSourceIds) { - std::vector importSourceIds = Utils::transform>( - imports, [](const Storage::Import &import) { return &import.sourceId; }); + SourceIds importSourceIds = Utils::transform(imports, + [](const Storage::Import &import) { + return import.sourceId; + }); std::sort(importSourceIds.begin(), importSourceIds.end()); - std::vector documentSourceIdsToBeDeleted; + SourceIds documentSourceIdsToBeDeleted; - std::set_difference(sourceIdValues.begin(), - sourceIdValues.end(), + std::set_difference(updatedSourceIds.begin(), + updatedSourceIds.end(), importSourceIds.begin(), importSourceIds.end(), std::back_inserter(documentSourceIdsToBeDeleted)); - deleteDocumentImportsWithSourceIdsStatement.write(Utils::span{documentSourceIdsToBeDeleted}); + deleteDocumentImportsWithSourceIdsStatement.write(toIntegers(documentSourceIdsToBeDeleted)); } ModuleId fetchModuleIdUnguarded(Utils::SmallStringView name) const @@ -767,17 +839,13 @@ private: } void deleteNotUpdatedTypes(const TypeIds &updatedTypeIds, - const std::vector &sourceIdValues, + const SourceIds &updatedSourceIds, const TypeIds &typeIdsToBeDeleted, AliasPropertyDeclarations &relinkableAliasPropertyDeclarations, PropertyDeclarations &relinkablePropertyDeclarations, Prototypes &relinkablePrototypes, TypeIds &deletedTypeIds) { - auto updatedTypeIdValues = Utils::transform(updatedTypeIds, [](TypeId typeId) { - return &typeId; - }); - auto callback = [&](long long typeId) { deletedTypeIds.push_back(TypeId{typeId}); deleteType(TypeId{typeId}, @@ -788,8 +856,8 @@ private: }; selectNotUpdatedTypesInSourcesStatement.readCallback(callback, - Utils::span(sourceIdValues), - Utils::span(updatedTypeIdValues)); + toIntegers(updatedSourceIds), + toIntegers(updatedTypeIds)); for (TypeId typeIdToBeDeleted : typeIdsToBeDeleted) callback(&typeIdToBeDeleted); } @@ -853,7 +921,7 @@ private: updateAliasPropertyDeclarationValues(updatedAliasPropertyDeclarations); } - void synchronizeExportedTypes(const std::vector &sourceIdValues, + void synchronizeExportedTypes(const SourceIds &exportedSourceIds, const TypeIds &updatedTypeIds, Storage::ExportedTypes &exportedTypes, AliasPropertyDeclarations &relinkableAliasPropertyDeclarations, @@ -865,17 +933,13 @@ private: < std::tie(second.moduleId, second.name, second.version); }); - Utils::span typeIdValues{static_cast( - &updatedTypeIds.data()->id), - updatedTypeIds.size()}; - auto range = selectExportedTypesForSourceIdsStatement - .template range(Utils::span{sourceIdValues}, - typeIdValues); + .template range(toIntegers(exportedSourceIds), + toIntegers(updatedTypeIds)); auto compareKey = [](const Storage::ExportedTypeView &view, const Storage::ExportedType &type) -> long long { - auto moduleIdDifference = view.moduleId.id - type.moduleId.id; + auto moduleIdDifference = &view.moduleId - &type.moduleId; if (moduleIdDifference != 0) return moduleIdDifference; @@ -924,7 +988,9 @@ private: relinkableAliasPropertyDeclarations); handlePrototypes(view.typeId, relinkablePrototypes); updateExportedTypeNameTypeIdStatement.write(&view.exportedTypeNameId, &type.typeId); + return Sqlite::UpdateChange::Update; } + return Sqlite::UpdateChange::No; }; auto remove = [&](const Storage::ExportedTypeView &view) { @@ -998,7 +1064,7 @@ private: view.aliasId); } - void synchronizePropertyDeclarationsUpdateProperty(const Storage::PropertyDeclarationView &view, + auto synchronizePropertyDeclarationsUpdateProperty(const Storage::PropertyDeclarationView &view, const Storage::PropertyDeclaration &value, SourceId sourceId, PropertyDeclarationIds &propertyDeclarationIds) @@ -1012,7 +1078,7 @@ private: if (view.traits == value.traits && propertyTypeId == view.typeId && propertyImportedTypeNameId == view.typeNameId) - return; + return Sqlite::UpdateChange::No; updatePropertyDeclarationStatement.write(&view.id, &propertyTypeId, @@ -1021,6 +1087,7 @@ private: updatePropertyAliasDeclarationRecursivelyWithTypeAndTraitsStatement .write(&view.id, &propertyTypeId, static_cast(value.traits)); propertyDeclarationIds.push_back(view.id); + return Sqlite::UpdateChange::Update; } void synchronizePropertyDeclarations(TypeId typeId, @@ -1064,11 +1131,13 @@ private: sourceId); propertyDeclarationIds.push_back(view.id); } else { - synchronizePropertyDeclarationsUpdateProperty(view, - value, - sourceId, - propertyDeclarationIds); + return synchronizePropertyDeclarationsUpdateProperty(view, + value, + sourceId, + propertyDeclarationIds); } + + return Sqlite::UpdateChange::No; }; auto remove = [&](const Storage::PropertyDeclarationView &view) { @@ -1127,7 +1196,7 @@ private: auto insert = [&](const Storage::PropertyDeclaration &) {}; auto update = [&](const AliasPropertyDeclarationView &, - const Storage::PropertyDeclaration &) {}; + const Storage::PropertyDeclaration &) { return Sqlite::UpdateChange::No; }; auto remove = [&](const AliasPropertyDeclarationView &view) { updatePropertyDeclarationAliasIdToNullStatement.write(&view.id); @@ -1151,7 +1220,7 @@ private: PropertyCompare{}); } - void synchronizeDocumentImports(Storage::Imports &imports, const std::vector &sourceIdValues) + void synchronizeDocumentImports(Storage::Imports &imports, const SourceIds &updatedSourceIds) { std::sort(imports.begin(), imports.end(), [](auto &&first, auto &&second) { return std::tie(first.sourceId, first.moduleId, first.version) @@ -1159,15 +1228,15 @@ private: }); auto range = selectDocumentImportForSourceIdStatement.template range( - Utils::span{sourceIdValues}); + toIntegers(updatedSourceIds)); auto compareKey = [](const Storage::ImportView &view, const Storage::Import &import) -> long long { - auto sourceIdDifference = view.sourceId.id - import.sourceId.id; + auto sourceIdDifference = &view.sourceId - &import.sourceId; if (sourceIdDifference != 0) return sourceIdDifference; - auto moduleIdDifference = view.moduleId.id - import.moduleId.id; + auto moduleIdDifference = &view.moduleId - &import.moduleId; if (moduleIdDifference != 0) return moduleIdDifference; @@ -1193,7 +1262,9 @@ private: } }; - auto update = [](const Storage::ImportView &, const Storage::Import &) {}; + auto update = [](const Storage::ImportView &, const Storage::Import &) { + return Sqlite::UpdateChange::No; + }; auto remove = [&](const Storage::ImportView &view) { deleteDocumentImportStatement.write(&view.importId); @@ -1258,9 +1329,11 @@ private: Utils::PathString signature{createJson(value.parameters)}; if (value.returnTypeName == view.returnTypeName && signature == view.signature) - return; + return Sqlite::UpdateChange::No; updateFunctionDeclarationStatement.write(&view.id, value.returnTypeName, signature); + + return Sqlite::UpdateChange::Update; }; auto remove = [&](const Storage::FunctionDeclarationView &view) { @@ -1295,9 +1368,11 @@ private: Utils::PathString signature{createJson(value.parameters)}; if (signature == view.signature) - return; + return Sqlite::UpdateChange::No; updateSignalDeclarationStatement.write(&view.id, signature); + + return Sqlite::UpdateChange::Update; }; auto remove = [&](const Storage::SignalDeclarationView &view) { @@ -1360,9 +1435,11 @@ private: Utils::PathString enumeratorDeclarations{createJson(value.enumeratorDeclarations)}; if (enumeratorDeclarations == view.enumeratorDeclarations) - return; + return Sqlite::UpdateChange::No; updateEnumerationDeclarationStatement.write(&view.id, enumeratorDeclarations); + + return Sqlite::UpdateChange::Update; }; auto remove = [&](const Storage::EnumerationDeclarationView &view) { @@ -1760,6 +1837,7 @@ private: createSignalsTable(database); createDocumentImportsTable(database, moduleIdColumn); createFileStatusesTable(database); + createProjectDatasTable(database); transaction.commit(); @@ -2002,6 +2080,22 @@ private: table.initialize(database); } + + void createProjectDatasTable(Database &database) + { + Sqlite::Table table; + table.setUseIfNotExists(true); + table.setUseWithoutRowId(true); + table.setName("projectDatas"); + auto &projectSourceIdColumn = table.addColumn("projectSourceId"); + auto &sourceIdColumn = table.addColumn("sourceId"); + table.addColumn("moduleId"); + table.addColumn("fileType"); + + table.addPrimaryKeyContraint({projectSourceIdColumn, sourceIdColumn}); + + table.initialize(database); + } }; public: @@ -2442,6 +2536,22 @@ public: "DELETE FROM exportedTypeNames WHERE exportedTypeNameId=?", database}; WriteStatement updateExportedTypeNameTypeIdStatement{ "UPDATE exportedTypeNames SET typeId=?2 WHERE exportedTypeNameId=?1", database}; + mutable ReadStatement<4> selectProjectDatasForModuleIdsStatement{ + "SELECT projectSourceId, sourceId, moduleId, fileType FROM projectDatas WHERE " + "projectSourceId IN carray(?1) ORDER BY projectSourceId, sourceId", + database}; + WriteStatement insertProjectDataStatement{"INSERT INTO projectDatas(projectSourceId, sourceId, " + "moduleId, fileType) VALUES(?1, ?2, ?3, ?4)", + database}; + WriteStatement deleteProjectDataStatement{ + "DELETE FROM projectDatas WHERE projectSourceId=?1 AND sourceId=?2", database}; + WriteStatement updateProjectDataStatement{ + "UPDATE projectDatas SET moduleId=?3, fileType=?4 WHERE projectSourceId=?1 AND sourceId=?2", + database}; + mutable ReadStatement<4> selectProjectDatasForModuleIdStatement{ + "SELECT projectSourceId, sourceId, moduleId, fileType FROM projectDatas WHERE " + "projectSourceId=?1", + database}; }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h index 42790bded68..9b22a6d1973 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h @@ -107,4 +107,28 @@ public: const char *what() const noexcept override { return "Cannot parse qml types file!"; } }; +class CannotParseQmlDocumentFile : std::exception +{ +public: + const char *what() const noexcept override { return "Cannot parse qml types file!"; } +}; + +class ProjectDataHasInvalidProjectSourceId : std::exception +{ +public: + const char *what() const noexcept override { return "The project source id is invalid!"; } +}; + +class ProjectDataHasInvalidSourceId : std::exception +{ +public: + const char *what() const noexcept override { return "The source id is invalid!"; } +}; + +class ProjectDataHasInvalidModuleId : std::exception +{ +public: + const char *what() const noexcept override { return "The module id is invalid!"; } +}; + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h index a31999d5bf0..f36a94ff29f 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h @@ -47,6 +47,8 @@ enum class PropertyDeclarationTraits : unsigned int { enum class TypeNameKind { Native = 0, Exported = 1, QualifiedExported = 2 }; +enum class FileType : char { QmlTypes, QmlDocument }; + constexpr PropertyDeclarationTraits operator|(PropertyDeclarationTraits first, PropertyDeclarationTraits second) { @@ -630,7 +632,7 @@ public: PropertyDeclarationId aliasId; }; -enum class ChangeLevel { Full, Minimal }; +enum class ChangeLevel : char { Full, Minimal, ExcludeExportedTypes }; class Type { @@ -668,6 +670,18 @@ public: , prototypeId{prototypeId} {} + explicit Type(Utils::SmallStringView typeName, + ImportedTypeName prototype, + TypeAccessSemantics accessSemantics, + SourceId sourceId, + ChangeLevel changeLevel) + : typeName{typeName} + , prototype{std::move(prototype)} + , accessSemantics{accessSemantics} + , sourceId{sourceId} + , changeLevel{changeLevel} + {} + explicit Type(Utils::SmallStringView typeName, Utils::SmallStringView prototype, int accessSemantics, @@ -721,8 +735,31 @@ using Types = std::vector; class ProjectData { public: - ModuleId extraModuleId; + ProjectData(SourceId projectSourceId, SourceId sourceId, ModuleId moduleId, FileType fileType) + : projectSourceId{projectSourceId} + , sourceId{sourceId} + , moduleId{moduleId} + , fileType{fileType} + {} + + ProjectData(int projectSourceId, int sourceId, int moduleId, int fileType) + : projectSourceId{projectSourceId} + , sourceId{sourceId} + , moduleId{moduleId} + , fileType{static_cast(fileType)} + {} + + friend bool operator==(const ProjectData &first, const ProjectData &second) + { + return first.projectSourceId == second.projectSourceId && first.sourceId == second.sourceId + && first.moduleId == second.moduleId && first.fileType == second.fileType; + } + +public: + SourceId projectSourceId; SourceId sourceId; + ModuleId moduleId; + FileType fileType; }; using ProjectDatas = std::vector; @@ -731,30 +768,38 @@ class SynchronizationPackage { public: SynchronizationPackage() = default; - SynchronizationPackage(Imports imports, Types types, SourceIds sourceIds) + SynchronizationPackage(Imports imports, Types types, SourceIds updatedSourceIds) : imports{std::move(imports)} , types{std::move(types)} - , sourceIds(std::move(sourceIds)) + , updatedSourceIds(std::move(updatedSourceIds)) {} SynchronizationPackage(Types types) : types{std::move(types)} {} - SynchronizationPackage(SourceIds sourceIds) - : sourceIds(std::move(sourceIds)) + SynchronizationPackage(SourceIds updatedSourceIds) + : updatedSourceIds(std::move(updatedSourceIds)) {} - SynchronizationPackage(SourceIds sourceIds, FileStatuses fileStatuses) - : sourceIds(std::move(sourceIds)) + SynchronizationPackage(SourceIds updatedFileStatusSourceIds, FileStatuses fileStatuses) + : updatedFileStatusSourceIds(std::move(updatedFileStatusSourceIds)) , fileStatuses(std::move(fileStatuses)) {} + SynchronizationPackage(SourceIds updatedProjectSourceIds, ProjectDatas projectDatas) + : projectDatas(std::move(projectDatas)) + , updatedProjectSourceIds(std::move(updatedProjectSourceIds)) + {} + public: Imports imports; Types types; - SourceIds sourceIds; + SourceIds updatedSourceIds; FileStatuses fileStatuses; + ProjectDatas projectDatas; + SourceIds updatedProjectSourceIds; + SourceIds updatedFileStatusSourceIds; }; } // namespace QmlDesigner::Storage diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp index cc91a06faee..62c5cfee8cc 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp @@ -38,6 +38,7 @@ #include namespace QmlDesigner { +namespace { ComponentReferences createComponentReferences(const QMultiHash &components) { @@ -50,53 +51,117 @@ ComponentReferences createComponentReferences(const QMultiHash &idPaths) {} void ProjectUpdater::parseTypeInfos(const QStringList &typeInfos, + SourceId qmldirSourceId, SourceContextId directoryId, - Storage::SynchronizationPackage &package) + ModuleId moduleId, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds, + SourceIds ¬UpdatedSourceIds) { QString directory{m_pathCache.sourceContextPath(directoryId)}; @@ -104,37 +169,140 @@ void ProjectUpdater::parseTypeInfos(const QStringList &typeInfos, SourceId sourceId = m_pathCache.sourceId(directoryId, Utils::SmallString{typeInfo}); QString qmltypesPath = directory + "/" + typeInfo; - Storage::ProjectData projectData{ModuleId{}, sourceId}; + auto projectData = package.projectDatas.emplace_back(qmldirSourceId, + sourceId, + moduleId, + Storage::FileType::QmlTypes); - parseTypeInfo(projectData, qmltypesPath, package); + parseTypeInfo(projectData, + qmltypesPath, + package, + notUpdatedFileStatusSourceIds, + notUpdatedSourceIds); } } void ProjectUpdater::parseTypeInfos(const Storage::ProjectDatas &projectDatas, - Storage::SynchronizationPackage &package) + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds, + SourceIds ¬UpdatedSourceIds) { for (const Storage::ProjectData &projectData : projectDatas) { + if (projectData.fileType != Storage::FileType::QmlTypes) + continue; + QString qmltypesPath = m_pathCache.sourcePath(projectData.sourceId).toQString(); - parseTypeInfo(projectData, qmltypesPath, package); + parseTypeInfo(projectData, + qmltypesPath, + package, + notUpdatedFileStatusSourceIds, + notUpdatedSourceIds); } } void ProjectUpdater::parseTypeInfo(const Storage::ProjectData &projectData, const QString &qmltypesPath, - Storage::SynchronizationPackage &package) + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds, + SourceIds ¬UpdatedSourceIds) { - if (fileState(projectData.sourceId, package.fileStatuses) == FileState::Changed) { - package.sourceIds.push_back(projectData.sourceId); + auto state = fileState(projectData.sourceId, + package.fileStatuses, + package.updatedFileStatusSourceIds, + notUpdatedFileStatusSourceIds); + switch (state) { + case FileState::Changed: { + package.updatedSourceIds.push_back(projectData.sourceId); + const auto content = m_fileSystem.contentAsQString(qmltypesPath); m_qmlTypesParser.parse(content, package.imports, package.types, projectData); + break; + } + case FileState::NotChanged: { + notUpdatedSourceIds.push_back(projectData.sourceId); + break; + } + case FileState::NotExists: + break; } } +void ProjectUpdater::parseQmlComponent(Utils::SmallStringView fileName, + Utils::SmallStringView directory, + Utils::SmallStringView typeName, + Storage::Version version, + ModuleId moduleId, + SourceId qmldirSourceId, + SourceContextId directoryId, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds) +{ + SourceId sourceId = m_pathCache.sourceId(directoryId, fileName); + + Storage::Type type; + + auto state = fileState(sourceId, + package.fileStatuses, + package.updatedFileStatusSourceIds, + notUpdatedFileStatusSourceIds); + switch (state) { + case FileState::NotChanged: + type.changeLevel = Storage::ChangeLevel::Minimal; + break; + case FileState::NotExists: + throw CannotParseQmlDocumentFile{}; + case FileState::Changed: + const auto content = m_fileSystem.contentAsQString( + QString{Utils::PathString{directory} + "/" + fileName}); + type = m_qmlDocumentParser.parse(content, package.imports); + break; + } + + package.projectDatas.emplace_back(qmldirSourceId, sourceId, moduleId, Storage::FileType::QmlDocument); + + package.updatedSourceIds.push_back(sourceId); + + type.typeName = fileName; + type.accessSemantics = Storage::TypeAccessSemantics::Reference; + type.sourceId = sourceId; + type.exportedTypes.push_back(Storage::ExportedType{moduleId, typeName, version}); + + package.types.push_back(std::move(type)); +} + +void ProjectUpdater::parseQmlComponent(Utils::SmallStringView fileName, + Utils::SmallStringView filePath, + SourceId sourceId, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds) +{ + auto state = fileState(sourceId, + package.fileStatuses, + package.updatedFileStatusSourceIds, + notUpdatedFileStatusSourceIds); + if (state != FileState::Changed) + return; + + package.updatedSourceIds.push_back(sourceId); + + const auto content = m_fileSystem.contentAsQString(QString{filePath}); + auto type = m_qmlDocumentParser.parse(content, package.imports); + + type.typeName = fileName; + type.accessSemantics = Storage::TypeAccessSemantics::Reference; + type.sourceId = sourceId; + type.changeLevel = Storage::ChangeLevel::ExcludeExportedTypes; + + package.types.push_back(std::move(type)); +} + void ProjectUpdater::parseQmlComponents(ComponentReferences components, + SourceId qmldirSourceId, SourceContextId directoryId, ModuleId moduleId, - Storage::SynchronizationPackage &package) + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds) { std::sort(components.begin(), components.end(), [](auto &&first, auto &&second) { return std::tie(first.get().typeName, first.get().majorVersion, first.get().minorVersion) @@ -148,33 +316,43 @@ void ProjectUpdater::parseQmlComponents(ComponentReferences components, components.erase(newEnd, components.end()); - QString directory{m_pathCache.sourceContextPath(directoryId)}; + auto directory = m_pathCache.sourceContextPath(directoryId); for (const QmlDirParser::Component &component : components) { - Utils::SmallString fileName{component.fileName}; - SourceId sourceId = m_pathCache.sourceId(directoryId, fileName); - - if (fileState(sourceId, package.fileStatuses) != FileState::Changed) - continue; - - package.sourceIds.push_back(sourceId); - - const auto content = m_fileSystem.contentAsQString(directory + "/" + component.fileName); - auto type = m_qmlDocumentParser.parse(content, package.imports); - - type.typeName = fileName; - type.accessSemantics = Storage::TypeAccessSemantics::Reference; - type.sourceId = sourceId; - type.exportedTypes.push_back( - Storage::ExportedType{moduleId, - Utils::SmallString{component.typeName}, - Storage::Version{component.majorVersion, component.minorVersion}}); - - package.types.push_back(std::move(type)); + parseQmlComponent(Utils::SmallString{component.fileName}, + directory, + Utils::SmallString{component.typeName}, + Storage::Version{component.majorVersion, component.minorVersion}, + moduleId, + qmldirSourceId, + directoryId, + package, + notUpdatedFileStatusSourceIds); } } -ProjectUpdater::FileState ProjectUpdater::fileState(SourceId sourceId, FileStatuses &fileStatuses) const +void ProjectUpdater::parseQmlComponents(const Storage::ProjectDatas &projectDatas, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds) +{ + for (const Storage::ProjectData &projectData : projectDatas) { + if (projectData.fileType != Storage::FileType::QmlDocument) + continue; + + SourcePath qmlDocumentPath = m_pathCache.sourcePath(projectData.sourceId); + + parseQmlComponent(qmlDocumentPath.name(), + qmlDocumentPath, + projectData.sourceId, + package, + notUpdatedFileStatusSourceIds); + } +} + +ProjectUpdater::FileState ProjectUpdater::fileState(SourceId sourceId, + FileStatuses &fileStatuses, + SourceIds &updatedSourceIds, + SourceIds ¬UpdatedSourceIds) const { auto currentFileStatus = m_fileStatusCache.find(sourceId); @@ -185,9 +363,11 @@ ProjectUpdater::FileState ProjectUpdater::fileState(SourceId sourceId, FileStatu if (!projectStorageFileStatus.isValid() || projectStorageFileStatus != currentFileStatus) { fileStatuses.push_back(currentFileStatus); + updatedSourceIds.push_back(currentFileStatus.sourceId); return FileState::Changed; } + notUpdatedSourceIds.push_back(currentFileStatus.sourceId); return FileState::NotChanged; } diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h index e3323d76099..4ab75a52548 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h @@ -87,19 +87,49 @@ private: }; void parseTypeInfos(const QStringList &typeInfos, + SourceId qmldirSourceId, SourceContextId directoryId, - Storage::SynchronizationPackage &package); + ModuleId moduleId, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds, + SourceIds ¬UpdatedSourceIds); void parseTypeInfos(const Storage::ProjectDatas &projectDatas, - Storage::SynchronizationPackage &package); + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds, + SourceIds ¬UpdatedSourceIds); void parseTypeInfo(const Storage::ProjectData &projectData, const QString &qmltypesPath, - Storage::SynchronizationPackage &package); + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds, + SourceIds ¬UpdatedSourceIds); void parseQmlComponents(ComponentReferences components, + SourceId qmldirSourceId, SourceContextId directoryId, ModuleId moduleId, - Storage::SynchronizationPackage &package); + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds); + void parseQmlComponents(const Storage::ProjectDatas &projectDatas, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds); + void parseQmlComponent(Utils::SmallStringView fileName, + Utils::SmallStringView directory, + Utils::SmallStringView typeName, + Storage::Version version, + ModuleId moduleId, + SourceId qmldirSourceId, + SourceContextId directoryId, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds); + void parseQmlComponent(Utils::SmallStringView fileName, + Utils::SmallStringView filePath, + SourceId sourceId, + Storage::SynchronizationPackage &package, + SourceIds ¬UpdatedFileStatusSourceIds); - FileState fileState(SourceId sourceId, FileStatuses &fileStatuses) const; + FileState fileState(SourceId sourceId, + FileStatuses &fileStatuses, + SourceIds &updatedSourceIds, + SourceIds ¬UpdatedSourceIds) const; private: ProjectManagerInterface &m_projectManager; diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp index f5d09409aa3..e1b66378e62 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp @@ -283,7 +283,7 @@ void addTypes(Storage::Types &types, types.reserve(Utils::usize(objects) + types.size()); for (const auto &object : objects) - addType(types, projectData.sourceId, projectData.extraModuleId, *object.get(), storage); + addType(types, projectData.sourceId, projectData.moduleId, *object.get(), storage); } } // namespace diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index d7ac77da36c..68b50ae4db3 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -231,6 +231,7 @@ void DesignModeWidget::setup() ADS::DockManager::setConfigFlags(ADS::DockManager::DefaultNonOpaqueConfig); ADS::DockManager::setConfigFlag(ADS::DockManager::FocusHighlighting, true); + ADS::DockManager::setConfigFlag(ADS::DockManager::OpaqueSplitterResize, true); ADS::DockManager::setConfigFlag(ADS::DockManager::AllTabsHaveCloseButton, true); m_dockManager = new ADS::DockManager(this); m_dockManager->setSettings(settings); diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-16px.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-16px.png deleted file mode 100644 index d9fd2f57bf4..00000000000 Binary files a/src/plugins/qmldesigner/qtquickplugin/images/audio-16px.png and /dev/null differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-24px.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-24px.png deleted file mode 100644 index 9e477c806db..00000000000 Binary files a/src/plugins/qmldesigner/qtquickplugin/images/audio-24px.png and /dev/null differ diff --git a/src/plugins/qmldesigner/qtquickplugin/images/audio-24px@2x.png b/src/plugins/qmldesigner/qtquickplugin/images/audio-24px@2x.png deleted file mode 100644 index 41948718fd1..00000000000 Binary files a/src/plugins/qmldesigner/qtquickplugin/images/audio-24px@2x.png and /dev/null differ diff --git a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc index af2ff0ff415..0098d05a37d 100644 --- a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc +++ b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.qrc @@ -31,7 +31,6 @@ images/text-edit-icon16.png images/text-input-icon16.png images/webview-icon16.png - source/audio.qml source/listview.qml source/listviewv2.qml source/gridview.qml @@ -84,9 +83,6 @@ images/loader-icon.png images/loader-icon@2x.png images/loader-icon16.png - images/audio-16px.png - images/audio-24px.png - images/audio-24px@2x.png images/audio-output-16px.png images/audio-output-24px.png images/audio-output-24px@2x.png diff --git a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo index 7858ca08ea1..d21d8420b4b 100644 --- a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo +++ b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo @@ -522,28 +522,6 @@ MetaInfo { } } - Type { - name: "QtMultimedia.MediaPlayer" - icon: ":/qtquickplugin/images/audio-16px.png" - - Hints { - visibleInNavigator: true - canBeDroppedInNavigator: true - canBeDroppedInFormEditor: false - canBeContainer: false - } - - ItemLibraryEntry { - name: "Audio" - category: "f.Qt Quick - Multimedia" - libraryIcon: ":/qtquickplugin/images/audio-24px.png" - version: "6.0" - requiredImport: "QtMultimedia" - - QmlSource { source: ":/qtquickplugin/source/audio.qml" } - } - } - Type { name: "QtMultimedia.AudioOutput" icon: ":/qtquickplugin/images/audio-output-16px.png" @@ -564,6 +542,26 @@ MetaInfo { } } + Type { + name: "QtMultimedia.VideoOutput" + icon: ":/qtquickplugin/images/video-output-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: false + } + + ItemLibraryEntry { + name: "Video Output" + category: "f.Qt Quick - Multimedia" + libraryIcon: ":/qtquickplugin/images/video-output-24px.png" + version: "6.0" + requiredImport: "QtMultimedia" + } + } + Type { name: "QtMultimedia.Video" icon: ":/qtquickplugin/images/video-16px.png" diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp index 962b4034925..80b2d08ca7e 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp @@ -123,6 +123,10 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi if (qt6ProjectProperty.isValid() && qt6ProjectProperty.value.toBool()) projectItem->setQt6Project(qt6ProjectProperty.value.toBool()); + const auto widgetAppProperty = rootNode->property("widgetApp"); + if (widgetAppProperty.isValid()) + projectItem->setWidgetApp(widgetAppProperty.value.toBool()); + if (debug) qDebug() << "importPath:" << importPathsProperty.value << "mainFile:" << mainFileProperty.value; diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h index 90d17e48591..a104e906464 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h @@ -78,6 +78,9 @@ public: QString mainFile() const { return m_mainFile; } void setMainFile(const QString &mainFilePath) { m_mainFile = mainFilePath; } + bool widgetApp() const { return m_widgetApp; } + void setWidgetApp(bool widgetApp) { m_widgetApp = widgetApp; } + void appendContent(QmlProjectContentItem *item) { m_content.append(item); } Utils::EnvironmentItems environment() const; @@ -99,6 +102,7 @@ protected: bool m_forceFreeType = false; bool m_qtForMCUs = false; bool m_qt6Project = false; + bool m_widgetApp = false; }; } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index c17f7f158bc..35ff194f950 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -585,6 +585,13 @@ bool QmlBuildSystem::forceFreeType() const return false; } +bool QmlBuildSystem::widgetApp() const +{ + if (m_projectItem) + return m_projectItem.data()->widgetApp(); + return false; +} + bool QmlBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FilePaths *) { if (!dynamic_cast(context)) diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index 4f347d07e1d..9defdbc0edc 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -93,6 +93,7 @@ public: QString primaryLanguage() const; void setPrimaryLanguage(QString language); bool forceFreeType() const; + bool widgetApp() const; bool addFiles(const QStringList &filePaths); diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index f66c3005d0a..e0c7cb30459 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -227,6 +227,11 @@ QString QmlProjectRunConfiguration::commandLineArguments() const ProcessArgs::addArg(&args, "windows:fontengine=freetype", osType); } + if (bs->qt6Project() && bs->widgetApp()) { + ProcessArgs::addArg(&args, "--apptype", osType); + ProcessArgs::addArg(&args, "widget", osType); + } + const QString main = bs->targetFile(FilePath::fromString(mainScript())).toString(); if (!main.isEmpty()) ProcessArgs::addArg(&args, main, osType); diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 984d593b4e0..354de0bb93f 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -185,7 +185,13 @@ void QnxToolChain::setCpuDir(const QString &cpuDir) GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const { - return detectTargetAbis(m_sdpPath); + // "unknown-qnx-gnu"is needed to get the "--target=xxx" parameter sent code model, + // which gets translated as "x86_64-qnx-gnu", which gets Clang to happily parse + // the QNX code. + // + // Without it on Windows Clang defaults to a MSVC mode, which breaks with + // the QNX code, which is mostly GNU based. + return GccToolChain::DetectedAbisResult{detectTargetAbis(m_sdpPath), "unknown-qnx-gnu"}; } bool QnxToolChain::operator ==(const ToolChain &other) const diff --git a/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp b/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp index 0e502925040..e14678431ac 100644 --- a/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp +++ b/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp @@ -96,7 +96,7 @@ QPixmap NewProjectDialogImageProvider::requestDefaultPixmap(const QString &id, Q } if (pixmap.isNull()) - return QPixmap{}; + return {}; if (requestedSize.isValid()) return pixmap.scaled(requestedSize); diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index 1ab2a45ee8b..50e3a085ca0 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -94,7 +94,7 @@ QdsNewDialog::QdsNewDialog(QWidget *parent) m_dialog->setWindowModality(Qt::ApplicationModal); m_dialog->setWindowFlags(Qt::Dialog); m_dialog->setAttribute(Qt::WA_DeleteOnClose); - m_dialog->setMinimumSize(1110, 554); + m_dialog->setMinimumSize(1066, 554); QSize screenSize = m_dialog->screen()->geometry().size(); if (screenSize.height() < 1080) diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 7224ef6906c..8e5f1471bde 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -126,7 +126,7 @@ CodeAssistantPrivate::CodeAssistantPrivate(CodeAssistant *assistant) connect(&m_automaticProposalTimer, &QTimer::timeout, this, &CodeAssistantPrivate::automaticProposalTimeout); - m_settings = TextEditorSettings::completionSettings(); + updateFromCompletionSettings(TextEditorSettings::completionSettings()); connect(TextEditorSettings::instance(), &TextEditorSettings::completionSettingsChanged, this, &CodeAssistantPrivate::updateFromCompletionSettings); diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index 7c513d96bf1..aa0902493dc 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -93,10 +93,8 @@ bool FindInCurrentFile::isEnabled() const void FindInCurrentFile::handleFileChange(Core::IEditor *editor) { if (!editor) { - if (m_currentDocument) { - m_currentDocument = nullptr; - emit enabledChanged(isEnabled()); - } + m_currentDocument = nullptr; + emit enabledChanged(isEnabled()); } else { Core::IDocument *document = editor->document(); if (document != m_currentDocument) { diff --git a/src/plugins/texteditor/snippets/snippetscollection.cpp b/src/plugins/texteditor/snippets/snippetscollection.cpp index d47e50fdf75..e678a93ef25 100644 --- a/src/plugins/texteditor/snippets/snippetscollection.cpp +++ b/src/plugins/texteditor/snippets/snippetscollection.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -77,7 +78,7 @@ const QLatin1String kModified("modified"); SnippetsCollection::Hint::Hint(int index) : m_index(index) {} -SnippetsCollection::Hint::Hint(int index, QList::iterator it) : m_index(index), m_it(it) +SnippetsCollection::Hint::Hint(int index, QVector::iterator it) : m_index(index), m_it(it) {} int SnippetsCollection::Hint::index() const @@ -112,7 +113,7 @@ void SnippetsCollection::insertSnippet(const Snippet &snippet, const Hint &hint) { const int group = groupIndex(snippet.groupId()); if (snippet.isBuiltIn() && snippet.isRemoved()) { - m_activeSnippetsEnd[group] = m_snippets[group].insert(m_activeSnippetsEnd[group], snippet); + m_snippets[group].append(snippet); } else { m_snippets[group].insert(hint.m_it, snippet); updateActiveSnippetsEnd(group); @@ -122,9 +123,12 @@ void SnippetsCollection::insertSnippet(const Snippet &snippet, const Hint &hint) SnippetsCollection::Hint SnippetsCollection::computeInsertionHint(const Snippet &snippet) { const int group = groupIndex(snippet.groupId()); - QList &snippets = m_snippets[group]; - QList::iterator it = std::upper_bound(snippets.begin(), m_activeSnippetsEnd.at(group), - snippet, snippetComp); + QVector &snippets = m_snippets[group]; + QVector::iterator it = std::upper_bound(snippets.begin(), + snippets.begin() + + m_activeSnippetsCount.at(group), + snippet, + snippetComp); return Hint(static_cast(std::distance(snippets.begin(), it)), it); } @@ -157,13 +161,16 @@ SnippetsCollection::Hint SnippetsCollection::computeReplacementHint(int index, const Snippet &snippet) { const int group = groupIndex(snippet.groupId()); - QList &snippets = m_snippets[group]; - QList::iterator it = std::lower_bound(snippets.begin(), m_activeSnippetsEnd.at(group), - snippet, snippetComp); + QVector &snippets = m_snippets[group]; + auto activeSnippetsEnd = snippets.begin() + m_activeSnippetsCount.at(group); + QVector::iterator it = std::lower_bound(snippets.begin(), + activeSnippetsEnd, + snippet, + snippetComp); int hintIndex = static_cast(std::distance(snippets.begin(), it)); if (index < hintIndex - 1) return Hint(hintIndex - 1, it); - it = std::upper_bound(it, m_activeSnippetsEnd.at(group), snippet, snippetComp); + it = std::upper_bound(it, activeSnippetsEnd, snippet, snippetComp); hintIndex = static_cast(std::distance(snippets.begin(), it)); if (index > hintIndex) return Hint(hintIndex, it); @@ -176,11 +183,10 @@ void SnippetsCollection::removeSnippet(int index, const QString &groupId) const int group = groupIndex(groupId); Snippet snippet(m_snippets.at(group).at(index)); m_snippets[group].removeAt(index); + updateActiveSnippetsEnd(group); if (snippet.isBuiltIn()) { snippet.setIsRemoved(true); - m_activeSnippetsEnd[group] = m_snippets[group].insert(m_activeSnippetsEnd[group], snippet); - } else { - updateActiveSnippetsEnd(group); + m_snippets[group].append(snippet); } } @@ -202,8 +208,7 @@ void SnippetsCollection::setSnippetContent(int index, int SnippetsCollection::totalActiveSnippets(const QString &groupId) const { const int group = groupIndex(groupId); - return std::distance::const_iterator>(m_snippets.at(group).begin(), - QList::const_iterator(m_activeSnippetsEnd.at(group))); + return m_activeSnippetsCount.at(group); } int SnippetsCollection::totalSnippets(const QString &groupId) const @@ -225,14 +230,14 @@ void SnippetsCollection::clearSnippets() void SnippetsCollection::clearSnippets(int groupIndex) { m_snippets[groupIndex].clear(); - m_activeSnippetsEnd[groupIndex] = m_snippets[groupIndex].end(); + m_activeSnippetsCount[groupIndex] = m_snippets[groupIndex].size(); } void SnippetsCollection::updateActiveSnippetsEnd(int groupIndex) { - m_activeSnippetsEnd[groupIndex] = std::find_if(m_snippets[groupIndex].begin(), - m_snippets[groupIndex].end(), - [](const Snippet &s) { return s.isRemoved(); }); + const int index = Utils::indexOf(m_snippets[groupIndex], + [](const Snippet &s) { return s.isRemoved(); }); + m_activeSnippetsCount[groupIndex] = index < 0 ? m_snippets[groupIndex].size() : index; } void SnippetsCollection::restoreRemovedSnippets(const QString &groupId) @@ -240,9 +245,11 @@ void SnippetsCollection::restoreRemovedSnippets(const QString &groupId) // The version restored contains the last modifications (if any) by the user. // Reverting the snippet can still bring it to the original version const int group = groupIndex(groupId); - QVector toRestore(std::distance(m_activeSnippetsEnd[group], m_snippets[group].end())); - std::copy(m_activeSnippetsEnd[group], m_snippets[group].end(), toRestore.begin()); - m_snippets[group].erase(m_activeSnippetsEnd[group], m_snippets[group].end()); + if (m_activeSnippetsCount[group] == m_snippets[group].size()) // no removed snippets + return; + const QVector toRestore = m_snippets[group].mid(m_activeSnippetsCount[group]); + m_snippets[group].resize(m_activeSnippetsCount[group]); + for (Snippet snippet : qAsConst(toRestore)) { snippet.setIsRemoved(false); insertSnippet(snippet); @@ -425,8 +432,8 @@ void SnippetsCollection::identifyGroups() const int groupIndex = m_groupIndexById.size(); m_groupIndexById.insert(provider.groupId(), groupIndex); m_snippets.resize(groupIndex + 1); - m_activeSnippetsEnd.resize(groupIndex + 1); - m_activeSnippetsEnd[groupIndex] = m_snippets[groupIndex].end(); + m_activeSnippetsCount.resize(groupIndex + 1); + m_activeSnippetsCount[groupIndex] = m_snippets[groupIndex].size(); } reload(); diff --git a/src/plugins/texteditor/snippets/snippetscollection.h b/src/plugins/texteditor/snippets/snippetscollection.h index 98be56b452f..3a0ad474c17 100644 --- a/src/plugins/texteditor/snippets/snippetscollection.h +++ b/src/plugins/texteditor/snippets/snippetscollection.h @@ -61,9 +61,9 @@ public: int index() const; private: explicit Hint(int index); - Hint(int index, QList::iterator it); + Hint(int index, QVector::iterator it); int m_index; - QList::iterator m_it; + QVector::iterator m_it; }; void insertSnippet(const Snippet &snippet); @@ -120,8 +120,8 @@ private: // Snippets for each group are kept in a list. However, not all of them are necessarily // active. Specifically, removed built-in snippets are kept as the last ones (for each // group there is a iterator that marks the logical end). - QVector > m_snippets; - QVector::iterator> m_activeSnippetsEnd; + QVector > m_snippets; + QVector m_activeSnippetsCount; QHash m_groupIndexById; }; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index a02a29b8fc4..99dcc3511bf 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -2400,7 +2400,7 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) if (camelCaseNavigationEnabled()) CamelCaseCursor::left(&cursor, this, QTextCursor::KeepAnchor); else - d->moveCursor(QTextCursor::PreviousWord, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor); } cursor.removeSelectedText(); setMultiTextCursor(cursor); @@ -2411,7 +2411,7 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) if (camelCaseNavigationEnabled()) CamelCaseCursor::right(&cursor, this, QTextCursor::KeepAnchor); else - d->moveCursor(QTextCursor::NextWord, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor); } cursor.removeSelectedText(); setMultiTextCursor(cursor); @@ -6257,10 +6257,10 @@ MultiTextCursor TextEditorWidget::multiTextCursor() const void TextEditorWidget::setMultiTextCursor(const Utils::MultiTextCursor &cursor) { - if (d->m_cursors == cursor) - return; - MultiTextCursor oldCursor = d->m_cursors; + const MultiTextCursor oldCursor = d->m_cursors; const_cast(d->m_cursors) = cursor; + if (oldCursor == d->m_cursors) + return; doSetTextCursor(d->m_cursors.mainCursor(), /*keepMultiSelection*/ true); QRect updateRect = d->cursorUpdateRect(oldCursor); if (d->m_highlightCurrentLine) diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index dd1397f3c1e..076a2d7ca61 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -70,7 +70,7 @@ def main(): template = current.values()[0] with TestSection("Testing project template %s -> %s" % (category, template)): displayedPlatforms = __createProject__(category, template) - if template.startswith("Qt Quick Application - "): + if template == "Qt Quick Application": qtVersionsForQuick = ["5.14"] for counter, qtVersion in enumerate(qtVersionsForQuick): def additionalFunc(displayedPlatforms, qtVersion): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py index a7ff1801d22..370d8357095 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py @@ -30,8 +30,8 @@ def main(): if not startedWithoutPluginError(): return - available = [("5.14", "Qt Quick Application - Empty", Targets.DESKTOP_5_14_1_DEFAULT), - ("5.14", "Qt Quick Application - Swipe", Targets.DESKTOP_5_14_1_DEFAULT)] + available = [("5.14", "Qt Quick Application", Targets.DESKTOP_5_14_1_DEFAULT), + ] for qtVersion, appTemplate, targ in available: # using a temporary directory won't mess up a potentially existing diff --git a/tests/unit/unittest/clientserveroutsideprocess-test.cpp b/tests/unit/unittest/clientserveroutsideprocess-test.cpp index 75e838c8a66..20ccce70fcb 100644 --- a/tests/unit/unittest/clientserveroutsideprocess-test.cpp +++ b/tests/unit/unittest/clientserveroutsideprocess-test.cpp @@ -71,7 +71,7 @@ TEST_F(ClientServerOutsideProcessSlowTest, RestartProcessAsynchronously) ASSERT_TRUE(client.isConnected()); } -TEST_F(ClientServerOutsideProcessSlowTest, RestartProcessAfterAliveTimeout) +TEST_F(ClientServerOutsideProcessSlowTest, DISABLED_RestartProcessAfterAliveTimeout) { QSignalSpy clientSpy(&client, &ConnectionClient::connectedToLocalSocket); @@ -81,7 +81,7 @@ TEST_F(ClientServerOutsideProcessSlowTest, RestartProcessAfterAliveTimeout) ASSERT_THAT(clientSpy, SizeIs(1)); } -TEST_F(ClientServerOutsideProcessSlowTest, RestartProcessAfterTermination) +TEST_F(ClientServerOutsideProcessSlowTest, DISABLED_RestartProcessAfterTermination) { QSignalSpy clientSpy(&client, &ConnectionClient::connectedToLocalSocket); diff --git a/tests/unit/unittest/gtest-creator-printing.cpp b/tests/unit/unittest/gtest-creator-printing.cpp index 3123ffcf1d7..772bb71e7fb 100644 --- a/tests/unit/unittest/gtest-creator-printing.cpp +++ b/tests/unit/unittest/gtest-creator-printing.cpp @@ -1070,8 +1070,57 @@ const char *importKindToText(ImportKind kind) return ""; } +const char *fileTypeToText(FileType fileType) +{ + switch (fileType) { + case FileType::QmlDocument: + return "QmlDocument"; + case FileType::QmlTypes: + return "QmlTypes"; + } + + return ""; +} + +const char *changeLevelToText(ChangeLevel changeLevel) +{ + switch (changeLevel) { + case ChangeLevel::Full: + return "Full"; + case ChangeLevel::Minimal: + return "Minimal"; + case ChangeLevel::ExcludeExportedTypes: + return "ExcludeExportedTypes"; + } + + return ""; +} + } // namespace +std::ostream &operator<<(std::ostream &out, FileType fileType) +{ + return out << fileTypeToText(fileType); +} + +std::ostream &operator<<(std::ostream &out, ChangeLevel changeLevel) +{ + return out << changeLevelToText(changeLevel); +} + +std::ostream &operator<<(std::ostream &out, const SynchronizationPackage &package) +{ + return out << "(" << package.imports << ", " << package.types << ", " + << package.updatedSourceIds << ", " << package.fileStatuses << ", " + << package.updatedFileStatusSourceIds << ", " << package.projectDatas << ")"; +} + +std::ostream &operator<<(std::ostream &out, const ProjectData &data) +{ + return out << "(" << data.projectSourceId << ", " << data.sourceId << ", " << data.moduleId + << ", " << data.fileType << ")"; +} + std::ostream &operator<<(std::ostream &out, TypeAccessSemantics accessSemantics) { return out << typeAccessSemanticsToString(accessSemantics) @@ -1106,7 +1155,7 @@ std::ostream &operator<<(std::ostream &out, const NativeType &nativeType) std::ostream &operator<<(std::ostream &out, const ImportedType &importedType) { - return out << "(\"" << importedType.name << ")"; + return out << "(\"" << importedType.name << "\")"; } std::ostream &operator<<(std::ostream &out, const QualifiedImportedType &importedType) { @@ -1120,7 +1169,8 @@ std::ostream &operator<<(std::ostream &out, const Type &type) << type.prototypeId << ", " << type.accessSemantics << ", source: " << type.sourceId << ", exports: " << type.exportedTypes << ", properties: " << type.propertyDeclarations << ", functions: " << type.functionDeclarations - << ", signals: " << type.signalDeclarations << ")"; + << ", signals: " << type.signalDeclarations << ", changeLevel: " << type.changeLevel + << ")"; } std::ostream &operator<<(std::ostream &out, const PropertyDeclaration &propertyDeclaration) diff --git a/tests/unit/unittest/gtest-creator-printing.h b/tests/unit/unittest/gtest-creator-printing.h index 074fada6d91..d84534b9b0f 100644 --- a/tests/unit/unittest/gtest-creator-printing.h +++ b/tests/unit/unittest/gtest-creator-printing.h @@ -263,6 +263,10 @@ class EnumeratorDeclaration; enum class ImportKind : char; class Import; enum class IsQualified : int; +class ProjectData; +class SynchronizationPackage; +enum class FileType : char; +enum class ChangeLevel : char; std::ostream &operator<<(std::ostream &out, TypeAccessSemantics accessSemantics); std::ostream &operator<<(std::ostream &out, VersionNumber versionNumber); @@ -282,6 +286,10 @@ std::ostream &operator<<(std::ostream &out, const EnumeratorDeclaration &enumera std::ostream &operator<<(std::ostream &out, const ImportKind &importKind); std::ostream &operator<<(std::ostream &out, const Import &import); std::ostream &operator<<(std::ostream &out, IsQualified isQualified); +std::ostream &operator<<(std::ostream &out, const ProjectData &data); +std::ostream &operator<<(std::ostream &out, const SynchronizationPackage &package); +std::ostream &operator<<(std::ostream &out, FileType fileType); +std::ostream &operator<<(std::ostream &out, ChangeLevel changeLevel); } // namespace Storage diff --git a/tests/unit/unittest/projectstorage-test.cpp b/tests/unit/unittest/projectstorage-test.cpp index 43ac728fd99..1e2cc0bd068 100644 --- a/tests/unit/unittest/projectstorage-test.cpp +++ b/tests/unit/unittest/projectstorage-test.cpp @@ -95,7 +95,7 @@ MATCHER_P4(IsStorageType, const Storage::Type &type = arg; return type.sourceId == sourceId && type.typeName == typeName - && type.accessSemantics == accessSemantics && prototypeId.id == type.prototypeId.id; + && type.accessSemantics == accessSemantics && &prototypeId == &type.prototypeId; } MATCHER_P(IsExportedType, @@ -266,7 +266,7 @@ protected: Storage::ExportedType{qmlModuleId, "Obj", Storage::Version{2}}, Storage::ExportedType{qmlNativeModuleId, "QObject"}}}); - package.sourceIds = {sourceId1, sourceId2}; + package.updatedSourceIds = {sourceId1, sourceId2}; return package; } @@ -324,8 +324,8 @@ protected: Storage::ImportedType{"QObject"}, Storage::PropertyDeclarationTraits::IsList}); - package.sourceIds.push_back(sourceId3); - package.sourceIds.push_back(sourceId4); + package.updatedSourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId4); return package; } @@ -359,7 +359,7 @@ protected: package.types.back().propertyDeclarations.push_back( Storage::PropertyDeclaration{"objects", Storage::ImportedType{"AliasItem"}, "objects"}); - package.sourceIds.push_back(sourceId5); + package.updatedSourceIds.push_back(sourceId5); return package; } @@ -403,7 +403,7 @@ protected: Storage::ExportedType{qmlModuleId, "BuiltInObj", Storage::Version{3, 4}}, Storage::ExportedType{qmlNativeModuleId, "QObject4"}}}); - package.sourceIds.push_back(sourceId1); + package.updatedSourceIds.push_back(sourceId1); return package; } @@ -435,6 +435,8 @@ protected: SourceId sourceId3{sourcePathCache.sourceId(path3)}; SourceId sourceId4{sourcePathCache.sourceId(path4)}; SourceId sourceId5{sourcePathCache.sourceId(path5)}; + SourceId qmlProjectSourceId{sourcePathCache.sourceId("/path1/qmldir")}; + SourceId qtQuickProjectSourceId{sourcePathCache.sourceId("/path2/qmldir")}; ModuleId qmlModuleId{storage.moduleId("Qml")}; ModuleId qmlNativeModuleId{storage.moduleId("Qml-cppnative")}; ModuleId qtQuickModuleId{storage.moduleId("QtQuick")}; @@ -2400,7 +2402,7 @@ TEST_F(ProjectStorage, sourceId5, {Storage::ExportedType{qtQuickModuleId, "Object2"}, Storage::ExportedType{qtQuickModuleId, "Obj2"}}}); - package.sourceIds.push_back(sourceId5); + package.updatedSourceIds.push_back(sourceId5); storage.synchronize(package); @@ -2849,7 +2851,7 @@ TEST_F(ProjectStorage, QualifiedPrototype) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object"}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); storage.synchronize(package); @@ -2884,7 +2886,7 @@ TEST_F(ProjectStorage, QualifiedPrototypeUpperInTheModuleChain) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object"}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); storage.synchronize(package); @@ -2908,7 +2910,7 @@ TEST_F(ProjectStorage, QualifiedPrototypeWithWrongVersionThrows) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object"}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); ASSERT_THROW(storage.synchronize(package), QmlDesigner::TypeNameDoesNotExists); } @@ -2924,7 +2926,7 @@ TEST_F(ProjectStorage, QualifiedPrototypeWithVersion) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object"}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); storage.synchronize(package); @@ -2948,7 +2950,7 @@ TEST_F(ProjectStorage, QualifiedPrototypeWithVersionInTheProtoTypeChain) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object", Storage::Version{2}}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); storage.synchronize(package); @@ -2981,7 +2983,7 @@ TEST_F(ProjectStorage, QualifiedPropertyDeclarationTypeName) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object"}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); storage.synchronize(package); @@ -3013,7 +3015,7 @@ TEST_F(ProjectStorage, QualifiedPropertyDeclarationTypeNameInTheModuleChain) sourceId3, {Storage::ExportedType{qtQuickModuleId, "Object"}}}); package.imports.emplace_back(qtQuickModuleId, Storage::Version{}, sourceId3); - package.sourceIds.push_back(sourceId3); + package.updatedSourceIds.push_back(sourceId3); storage.synchronize(package); @@ -3115,7 +3117,7 @@ TEST_F(ProjectStorage, UpdateFileStatus) UnorderedElementsAre(fileStatus1, fileStatus2b)); } -TEST_F(ProjectStorage, ThrowForInvalidSourceId) +TEST_F(ProjectStorage, ThrowForInvalidSourceIdInFileStatus) { FileStatus fileStatus1{SourceId{}, 100, 100}; @@ -3654,4 +3656,191 @@ TEST_F(ProjectStorage, PopulateModuleCache) ASSERT_THAT(newStorage.moduleName(id), Eq("Qml")); } +TEST_F(ProjectStorage, AddProjectDataes) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2{qmlProjectSourceId, + sourceId2, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData3{qtQuickProjectSourceId, + sourceId3, + qtQuickModuleId, + Storage::FileType::QmlTypes}; + + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, + {projectData1, projectData2, projectData3}}); + + ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(projectData1, projectData2, projectData3)); +} + +TEST_F(ProjectStorage, RemoveProjectData) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2{qmlProjectSourceId, + sourceId2, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData3{qtQuickProjectSourceId, + sourceId3, + qtQuickModuleId, + Storage::FileType::QmlTypes}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, + {projectData1, projectData2, projectData3}}); + + storage.synchronize( + SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, {projectData1}}); + + ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(projectData1)); +} + +TEST_F(ProjectStorage, UpdateProjectDataFileType) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2{qmlProjectSourceId, + sourceId2, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2b{qmlProjectSourceId, + sourceId2, + qmlModuleId, + Storage::FileType::QmlTypes}; + Storage::ProjectData projectData3{qtQuickProjectSourceId, + sourceId3, + qtQuickModuleId, + Storage::FileType::QmlTypes}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, + {projectData1, projectData2, projectData3}}); + + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1, projectData2b}}); + + ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(projectData1, projectData2b, projectData3)); +} + +TEST_F(ProjectStorage, UpdateProjectDataModuleId) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2{qmlProjectSourceId, + sourceId3, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2b{qmlProjectSourceId, + sourceId3, + qtQuickModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData3{qtQuickProjectSourceId, + sourceId2, + qtQuickModuleId, + Storage::FileType::QmlTypes}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, + {projectData1, projectData2, projectData3}}); + + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1, projectData2b}}); + + ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(projectData1, projectData2b, projectData3)); +} + +TEST_F(ProjectStorage, ThrowForInvalidSourceIdInProjectData) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + SourceId{}, + qmlModuleId, + Storage::FileType::QmlDocument}; + + ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}), + QmlDesigner::ProjectDataHasInvalidSourceId); +} + +TEST_F(ProjectStorage, ThrowForInvalidModuleIdInProjectData) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + ModuleId{}, + Storage::FileType::QmlDocument}; + + ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}), + QmlDesigner::ProjectDataHasInvalidModuleId); +} + +TEST_F(ProjectStorage, ThrowForUpdatingWithInvalidModuleIdInProjectData) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}); + projectData1.moduleId = ModuleId{}; + + ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}), + QmlDesigner::ProjectDataHasInvalidModuleId); +} + +TEST_F(ProjectStorage, ThrowForUpdatingWithInvalidProjectSourceIdInProjectData) +{ + Storage::ProjectData projectData1{SourceId{}, sourceId1, qmlModuleId, Storage::FileType::QmlDocument}; + + ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}), + QmlDesigner::ProjectDataHasInvalidProjectSourceId); +} + +TEST_F(ProjectStorage, FetchProjectDatasByModuleIds) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2{qmlProjectSourceId, + sourceId2, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData3{qtQuickProjectSourceId, + sourceId3, + qtQuickModuleId, + Storage::FileType::QmlTypes}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, + {projectData1, projectData2, projectData3}}); + + auto projectDatas = storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}); + + ASSERT_THAT(projectDatas, UnorderedElementsAre(projectData1, projectData2, projectData3)); +} + +TEST_F(ProjectStorage, FetchProjectDatasByModuleId) +{ + Storage::ProjectData projectData1{qmlProjectSourceId, + sourceId1, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData2{qmlProjectSourceId, + sourceId2, + qmlModuleId, + Storage::FileType::QmlDocument}; + Storage::ProjectData projectData3{qtQuickProjectSourceId, + sourceId3, + qtQuickModuleId, + Storage::FileType::QmlTypes}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, + {projectData1, projectData2, projectData3}}); + + auto projectData = storage.fetchProjectDatas(qmlProjectSourceId); + + ASSERT_THAT(projectData, UnorderedElementsAre(projectData1, projectData2)); +} + } // namespace diff --git a/tests/unit/unittest/projectstorageupdater-test.cpp b/tests/unit/unittest/projectstorageupdater-test.cpp index c26aaa7b70a..63da5a66287 100644 --- a/tests/unit/unittest/projectstorageupdater-test.cpp +++ b/tests/unit/unittest/projectstorageupdater-test.cpp @@ -47,21 +47,24 @@ using QmlDesigner::SourceId; using QmlDesigner::Storage::TypeAccessSemantics; namespace Storage = QmlDesigner::Storage; using QmlDesigner::IdPaths; +using QmlDesigner::Storage::FileType; using QmlDesigner::Storage::SynchronizationPackage; using QmlDesigner::Storage::Version; -MATCHER_P4(IsStorageType, +MATCHER_P5(IsStorageType, typeName, prototype, accessSemantics, sourceId, + changeLevel, std::string(negation ? "isn't " : "is ") - + PrintToString(Storage::Type{typeName, prototype, accessSemantics, sourceId})) + + PrintToString(Storage::Type(typeName, prototype, accessSemantics, sourceId, changeLevel))) { const Storage::Type &type = arg; return type.typeName == typeName && type.accessSemantics == accessSemantics - && type.sourceId == sourceId && Storage::ImportedTypeName{prototype} == type.prototype; + && type.sourceId == sourceId && Storage::ImportedTypeName{prototype} == type.prototype + && type.changeLevel == changeLevel; } MATCHER_P3(IsPropertyDeclaration, @@ -107,12 +110,27 @@ MATCHER_P3(IsFileStatus, && fileStatus.lastModified == lastModified; } +MATCHER_P4(IsProjectData, + projectSourceId, + sourceId, + moduleId, + fileType, + std::string(negation ? "isn't " : "is ") + + PrintToString(Storage::ProjectData{projectSourceId, sourceId, moduleId, fileType})) +{ + const Storage::ProjectData &projectData = arg; + + return projectData.projectSourceId == projectSourceId && projectData.sourceId == sourceId + && projectData.moduleId == moduleId && projectData.fileType == fileType; +} + MATCHER(PackageIsEmpty, std::string(negation ? "isn't empty" : "is empty")) { const Storage::SynchronizationPackage &package = arg; return package.imports.empty() && package.types.empty() && package.fileStatuses.empty() - && package.sourceIds.empty(); + && package.updatedSourceIds.empty() && package.projectDatas.empty() + && package.updatedFileStatusSourceIds.empty() && package.updatedProjectSourceIds.empty(); } class ProjectStorageUpdater : public testing::Test @@ -135,15 +153,9 @@ public: ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDirPathSourceId))) .WillByDefault(Return(FileStatus{qmlDirPathSourceId, 2, 421})); - ON_CALL(projectStorageMock, fetchProjectDatas(Eq(qmlDirPathSourceId))) - .WillByDefault( - Return(QmlDesigner::Storage::ProjectDatas{{ModuleId{}, qmltypesPathSourceId}, - {ModuleId{}, qmltypes2PathSourceId}})); - - QString qmldir{"module Example\ntypeinfo example.qmltypes\n"}; ON_CALL(projectManagerMock, qtQmlDirs()).WillByDefault(Return(QStringList{"/path/qmldir"})); ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))) - .WillByDefault(Return(qmldir)); + .WillByDefault(Return(qmldirContent)); ON_CALL(fileSystemMock, fileStatus(Eq(qmlDocumentSourceId1))) .WillByDefault(Return(FileStatus{qmlDocumentSourceId1, 22, 12})); @@ -170,6 +182,10 @@ public: .WillByDefault(Return(qmlDocument2)); ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/Second.qml")))) .WillByDefault(Return(qmlDocument3)); + ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/example.qmltypes")))) + .WillByDefault(Return(qmltypes1)); + ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/example2.qmltypes")))) + .WillByDefault(Return(qmltypes2)); ON_CALL(qmlDocumentParserMock, parse(qmlDocument1, _)).WillByDefault([&](auto, auto &imports) { imports.push_back(import1); @@ -183,6 +199,16 @@ public: imports.push_back(import3); return thirdType; }); + ON_CALL(qmlTypesParserMock, parse(Eq(qmltypes1), _, _, _)) + .WillByDefault([&](auto, auto &imports, auto &types, auto) { + types.push_back(objectType); + imports.push_back(import4); + }); + ON_CALL(qmlTypesParserMock, parse(Eq(qmltypes2), _, _, _)) + .WillByDefault([&](auto, auto &imports, auto &types, auto) { + types.push_back(itemType); + imports.push_back(import5); + }); } protected: @@ -203,8 +229,6 @@ protected: sourcePathCache, qmlDocumentParserMock, qmlTypesParserMock}; - SourceId objectTypeSourceId{sourcePathCache.sourceId("/path/Object")}; - SourceId qmltypesPathSourceId = sourcePathCache.sourceId("/path/example.qmltypes"); SourceId qmltypes2PathSourceId = sourcePathCache.sourceId("/path/example2.qmltypes"); SourceId qmlDirPathSourceId = sourcePathCache.sourceId("/path/qmldir"); @@ -216,9 +240,14 @@ protected: Storage::Type objectType{"QObject", Storage::NativeType{}, Storage::TypeAccessSemantics::Reference, - objectTypeSourceId, + qmltypesPathSourceId, {Storage::ExportedType{exampleModuleId, "Object"}, Storage::ExportedType{exampleModuleId, "Obj"}}}; + Storage::Type itemType{"QItem", + Storage::NativeType{}, + Storage::TypeAccessSemantics::Reference, + qmltypes2PathSourceId, + {Storage::ExportedType{exampleModuleId, "Item"}}}; QString qmlDocument1{"First{}"}; QString qmlDocument2{"Second{}"}; QString qmlDocument3{"Third{}"}; @@ -228,6 +257,11 @@ protected: Storage::Import import1{qmlModuleId, Storage::Version{2, 3}, qmlDocumentSourceId1}; Storage::Import import2{qmlModuleId, Storage::Version{}, qmlDocumentSourceId2}; Storage::Import import3{qmlModuleId, Storage::Version{2}, qmlDocumentSourceId3}; + Storage::Import import4{qmlModuleId, Storage::Version{2, 3}, qmltypesPathSourceId}; + Storage::Import import5{qmlModuleId, Storage::Version{2, 3}, qmltypes2PathSourceId}; + QString qmldirContent{"module Example\ntypeinfo example.qmltypes\n"}; + QString qmltypes1{"Module {\ndependencies: [module1]}"}; + QString qmltypes2{"Module {\ndependencies: [module2]}"}; }; TEST_F(ProjectStorageUpdater, GetContentForQmlDirPathsIfFileStatusIsDifferent) @@ -266,7 +300,8 @@ TEST_F(ProjectStorageUpdater, RequestFileStatusFromFileSystem) TEST_F(ProjectStorageUpdater, GetContentForQmlTypes) { - QString qmldir{"module Example\ntypeinfo example.qmltypes\n"}; + QString qmldir{R"(module Example + typeinfo example.qmltypes)"}; EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))) .WillRepeatedly(Return(qmldir)); @@ -277,7 +312,8 @@ TEST_F(ProjectStorageUpdater, GetContentForQmlTypes) TEST_F(ProjectStorageUpdater, GetContentForQmlTypesIfProjectStorageFileStatusIsInvalid) { - QString qmldir{"module Example\ntypeinfo example.qmltypes\n"}; + QString qmldir{R"(module Example + typeinfo example.qmltypes)"}; EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))) .WillRepeatedly(Return(qmldir)); ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmltypesPathSourceId))) @@ -290,7 +326,8 @@ TEST_F(ProjectStorageUpdater, GetContentForQmlTypesIfProjectStorageFileStatusIsI TEST_F(ProjectStorageUpdater, DontGetContentForQmlTypesIfFileSystemFileStatusIsInvalid) { - QString qmldir{"module Example\ntypeinfo example.qmltypes\n"}; + QString qmldir{R"(module Example + typeinfo example.qmltypes)"}; EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))) .WillRepeatedly(Return(qmldir)); ON_CALL(fileSystemMock, fileStatus(Eq(qmltypesPathSourceId))).WillByDefault(Return(FileStatus{})); @@ -302,7 +339,9 @@ TEST_F(ProjectStorageUpdater, DontGetContentForQmlTypesIfFileSystemFileStatusIsI TEST_F(ProjectStorageUpdater, ParseQmlTypes) { - QString qmldir{"module Example\ntypeinfo example.qmltypes\ntypeinfo example2.qmltypes\n"}; + QString qmldir{R"(module Example + typeinfo example.qmltypes + typeinfo example2.qmltypes)"}; ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))).WillByDefault(Return(qmldir)); QString qmltypes{"Module {\ndependencies: []}"}; QString qmltypes2{"Module {\ndependencies: [foo]}"}; @@ -333,8 +372,6 @@ TEST_F(ProjectStorageUpdater, SynchronizeIsEmptyForNoChange) TEST_F(ProjectStorageUpdater, SynchronizeQmlTypes) { - auto qmlDirPathSourceId = sourcePathCache.sourceId("/path/qmldir"); - auto qmltypesPathSourceId = sourcePathCache.sourceId("/path/example.qmltypes"); Storage::Import import{qmlModuleId, Storage::Version{2, 3}, qmltypesPathSourceId}; QString qmltypes{"Module {\ndependencies: []}"}; ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/example.qmltypes")))) @@ -350,11 +387,18 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlTypes) synchronize( AllOf(Field(&SynchronizationPackage::imports, ElementsAre(import)), Field(&SynchronizationPackage::types, ElementsAre(Eq(objectType))), - Field(&SynchronizationPackage::sourceIds, + Field(&SynchronizationPackage::updatedSourceIds, UnorderedElementsAre(qmlDirPathSourceId, qmltypesPathSourceId)), Field(&SynchronizationPackage::fileStatuses, UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 21, 421), - IsFileStatus(qmltypesPathSourceId, 21, 421)))))); + IsFileStatus(qmltypesPathSourceId, 21, 421))), + Field(&SynchronizationPackage::projectDatas, + UnorderedElementsAre(IsProjectData(qmlDirPathSourceId, + qmltypesPathSourceId, + exampleModuleId, + FileType::QmlTypes))), + Field(&SynchronizationPackage::updatedProjectSourceIds, + UnorderedElementsAre(qmlDirPathSourceId))))); updater.update(); } @@ -394,8 +438,10 @@ TEST_F(ProjectStorageUpdater, GetContentForQmlDocuments) TEST_F(ProjectStorageUpdater, ParseQmlDocuments) { - QString qmldir{"module Example\nFirstType 1.0 First.qml\nFirstTypeV2 2.2 " - "First.2.qml\nSecondType 2.1 OldSecond.qml\nSecondType 2.2 Second.qml\n"}; + QString qmldir{R"(module Example + FirstType 1.0 First.qml + FirstTypeV2 2.2 First.2.qml + SecondType 2.2 Second.qml)"}; QString qmlDocument1{"First{}"}; QString qmlDocument2{"Second{}"}; QString qmlDocument3{"Third{}"}; @@ -414,10 +460,21 @@ TEST_F(ProjectStorageUpdater, ParseQmlDocuments) updater.update(); } +TEST_F(ProjectStorageUpdater, ParseQmlDocumentsWithNonExistingQmlDocumentThrows) +{ + QString qmldir{R"(module Example + NonexitingType 1.0 NonexitingType.qml)"}; + ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))).WillByDefault(Return(qmldir)); + + ASSERT_THROW(updater.update(), QmlDesigner::CannotParseQmlDocumentFile); +} + TEST_F(ProjectStorageUpdater, SynchronizeQmlDocuments) { - QString qmldir{"module Example\nFirstType 1.0 First.qml\nFirstType 2.2 " - "First.2.qml\nSecondType 2.1 OldSecond.qml\nSecondType 2.2 Second.qml\n"}; + QString qmldir{R"(module Example + FirstType 1.0 First.qml + FirstType 2.2 First.2.qml + SecondType 2.2 Second.qml)"}; ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))).WillByDefault(Return(qmldir)); EXPECT_CALL( @@ -429,22 +486,30 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocuments) AllOf(IsStorageType("First.qml", Storage::ImportedType{"Object"}, TypeAccessSemantics::Reference, - qmlDocumentSourceId1), + qmlDocumentSourceId1, + Storage::ChangeLevel::Full), Field(&Storage::Type::exportedTypes, ElementsAre(IsExportedType(exampleModuleId, "FirstType", 1, 0)))), AllOf(IsStorageType("First.2.qml", Storage::ImportedType{"Object2"}, TypeAccessSemantics::Reference, - qmlDocumentSourceId2), + qmlDocumentSourceId2, + Storage::ChangeLevel::Full), Field(&Storage::Type::exportedTypes, ElementsAre(IsExportedType(exampleModuleId, "FirstType", 2, 2)))), AllOf(IsStorageType("Second.qml", Storage::ImportedType{"Object3"}, TypeAccessSemantics::Reference, - qmlDocumentSourceId3), + qmlDocumentSourceId3, + Storage::ChangeLevel::Full), Field(&Storage::Type::exportedTypes, ElementsAre(IsExportedType(exampleModuleId, "SecondType", 2, 2)))))), - Field(&SynchronizationPackage::sourceIds, + Field(&SynchronizationPackage::updatedSourceIds, + UnorderedElementsAre(qmlDirPathSourceId, + qmlDocumentSourceId1, + qmlDocumentSourceId2, + qmlDocumentSourceId3)), + Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmlDirPathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2, @@ -453,15 +518,112 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocuments) UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 21, 421), IsFileStatus(qmlDocumentSourceId1, 22, 12), IsFileStatus(qmlDocumentSourceId2, 22, 13), - IsFileStatus(qmlDocumentSourceId3, 22, 14)))))); + IsFileStatus(qmlDocumentSourceId3, 22, 14))), + Field(&SynchronizationPackage::updatedProjectSourceIds, + UnorderedElementsAre(qmlDirPathSourceId)), + Field(&SynchronizationPackage::projectDatas, + UnorderedElementsAre(IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId1, + exampleModuleId, + FileType::QmlDocument), + IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId2, + exampleModuleId, + FileType::QmlDocument), + IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId3, + exampleModuleId, + FileType::QmlDocument)))))); + + updater.update(); +} + +TEST_F(ProjectStorageUpdater, SynchronizeRemoved) +{ + QString qmldir{R"(module Example + FirstType 1.0 First.qml + FirstType 2.2 First.2.qml + typeinfo example.qmltypes + typeinfo example2.qmltypes + )"}; + ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))).WillByDefault(Return(qmldir)); + ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDocumentSourceId2))) + .WillByDefault(Return(FileStatus{qmlDocumentSourceId2, 22, 13})); + ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmltypes2PathSourceId))) + .WillByDefault(Return(FileStatus{qmltypes2PathSourceId, 21, 421})); + ON_CALL(projectStorageMock, fetchProjectDatas(Eq(qmlDirPathSourceId))) + .WillByDefault(Return(QmlDesigner::Storage::ProjectDatas{ + {qmlDirPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmlDocumentSourceId1, exampleModuleId, FileType::QmlDocument}, + {qmlDirPathSourceId, qmlDocumentSourceId2, exampleModuleId, FileType::QmlDocument}, + {qmlDirPathSourceId, qmlDocumentSourceId3, exampleModuleId, FileType::QmlDocument}})); + + EXPECT_CALL( + projectStorageMock, + synchronize(AllOf( + Field(&SynchronizationPackage::imports, UnorderedElementsAre(import1, import4)), + Field(&SynchronizationPackage::types, + UnorderedElementsAre( + Eq(objectType), + AllOf(IsStorageType("First.qml", + Storage::ImportedType{"Object"}, + TypeAccessSemantics::Reference, + qmlDocumentSourceId1, + Storage::ChangeLevel::Full), + Field(&Storage::Type::exportedTypes, + ElementsAre(IsExportedType(exampleModuleId, "FirstType", 1, 0)))), + AllOf(IsStorageType("First.2.qml", + Storage::NativeType{}, + TypeAccessSemantics::Reference, + qmlDocumentSourceId2, + Storage::ChangeLevel::Minimal), + Field(&Storage::Type::exportedTypes, + ElementsAre(IsExportedType(exampleModuleId, "FirstType", 2, 2)))))), + Field(&SynchronizationPackage::updatedSourceIds, + UnorderedElementsAre(qmlDirPathSourceId, + qmltypesPathSourceId, + qmlDocumentSourceId1, + qmlDocumentSourceId2, + qmlDocumentSourceId3)), + Field(&SynchronizationPackage::updatedFileStatusSourceIds, + UnorderedElementsAre(qmlDirPathSourceId, + qmlDocumentSourceId1, + qmltypesPathSourceId, + qmlDocumentSourceId3)), + Field(&SynchronizationPackage::fileStatuses, + UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 21, 421), + IsFileStatus(qmlDocumentSourceId1, 22, 12), + IsFileStatus(qmltypesPathSourceId, 21, 421))), + Field(&SynchronizationPackage::updatedProjectSourceIds, + UnorderedElementsAre(qmlDirPathSourceId)), + Field(&SynchronizationPackage::projectDatas, + UnorderedElementsAre(IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId1, + exampleModuleId, + FileType::QmlDocument), + IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId2, + exampleModuleId, + FileType::QmlDocument), + IsProjectData(qmlDirPathSourceId, + qmltypesPathSourceId, + exampleModuleId, + FileType::QmlTypes), + IsProjectData(qmlDirPathSourceId, + qmltypes2PathSourceId, + exampleModuleId, + FileType::QmlTypes)))))); updater.update(); } TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsDontUpdateIfUpToDate) { - QString qmldir{"module Example\nFirstType 1.0 First.qml\nFirstType 2.2 " - "First.2.qml\nSecondType 2.1 OldSecond.qml\nSecondType 2.2 Second.qml\n"}; + QString qmldir{R"(module Example + FirstType 1.0 First.qml + FirstType 2.2 First.2.qml + SecondType 2.2 Second.qml)"}; ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))).WillByDefault(Return(qmldir)); ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDocumentSourceId3))) .WillByDefault(Return(FileStatus{qmlDocumentSourceId3, 22, 14})); @@ -475,29 +637,60 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsDontUpdateIfUpToDate) AllOf(IsStorageType("First.qml", Storage::ImportedType{"Object"}, TypeAccessSemantics::Reference, - qmlDocumentSourceId1), + qmlDocumentSourceId1, + Storage::ChangeLevel::Full), Field(&Storage::Type::exportedTypes, ElementsAre(IsExportedType(exampleModuleId, "FirstType", 1, 0)))), AllOf(IsStorageType("First.2.qml", Storage::ImportedType{"Object2"}, TypeAccessSemantics::Reference, - qmlDocumentSourceId2), + qmlDocumentSourceId2, + Storage::ChangeLevel::Full), Field(&Storage::Type::exportedTypes, - ElementsAre(IsExportedType(exampleModuleId, "FirstType", 2, 2)))))), - Field(&SynchronizationPackage::sourceIds, - UnorderedElementsAre(qmlDirPathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), + ElementsAre(IsExportedType(exampleModuleId, "FirstType", 2, 2)))), + AllOf(IsStorageType("Second.qml", + Storage::NativeType{}, + TypeAccessSemantics::Reference, + qmlDocumentSourceId3, + Storage::ChangeLevel::Minimal), + Field(&Storage::Type::exportedTypes, + ElementsAre(IsExportedType(exampleModuleId, "SecondType", 2, 2)))))), + Field(&SynchronizationPackage::updatedSourceIds, + UnorderedElementsAre(qmlDirPathSourceId, + qmlDocumentSourceId1, + qmlDocumentSourceId2, + qmlDocumentSourceId3)), Field(&SynchronizationPackage::fileStatuses, UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 21, 421), IsFileStatus(qmlDocumentSourceId1, 22, 12), - IsFileStatus(qmlDocumentSourceId2, 22, 13)))))); + IsFileStatus(qmlDocumentSourceId2, 22, 13))), + Field(&SynchronizationPackage::updatedFileStatusSourceIds, + UnorderedElementsAre(qmlDirPathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), + Field(&SynchronizationPackage::updatedProjectSourceIds, + UnorderedElementsAre(qmlDirPathSourceId)), + Field(&SynchronizationPackage::projectDatas, + UnorderedElementsAre(IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId1, + exampleModuleId, + FileType::QmlDocument), + IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId2, + exampleModuleId, + FileType::QmlDocument), + IsProjectData(qmlDirPathSourceId, + qmlDocumentSourceId3, + exampleModuleId, + FileType::QmlDocument)))))); updater.update(); } TEST_F(ProjectStorageUpdater, UpdateQmldirDocuments) { - QString qmldir{"module Example\nFirstType 1.1 First.qml\nFirstType 2.2 " - "First.2.qml\nSecondType 2.1 OldSecond.qml\nSecondType 2.2 Second.qml\n"}; + QString qmldir{R"(module Example + FirstType 1.1 First.qml + FirstType 2.2 First.2.qml + SecondType 2.2 Second.qml)"}; ON_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/qmldir")))).WillByDefault(Return(qmldir)); ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDocumentSourceId3))) .WillByDefault(Return(FileStatus{qmlDocumentSourceId3, 22, 14})); @@ -505,4 +698,115 @@ TEST_F(ProjectStorageUpdater, UpdateQmldirDocuments) updater.pathsWithIdsChanged({}); } +TEST_F(ProjectStorageUpdater, AddSourceIdForForInvalidQmldirFileStatus) +{ + ON_CALL(projectStorageMock, fetchProjectDatas(Eq(qmlDirPathSourceId))) + .WillByDefault(Return(QmlDesigner::Storage::ProjectDatas{ + {qmlDirPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}})); + ON_CALL(fileSystemMock, fileStatus(Eq(qmlDirPathSourceId))).WillByDefault(Return(FileStatus{})); + + EXPECT_CALL(projectStorageMock, + synchronize(AllOf(Field(&SynchronizationPackage::imports, IsEmpty()), + Field(&SynchronizationPackage::types, IsEmpty()), + Field(&SynchronizationPackage::updatedSourceIds, + UnorderedElementsAre(qmlDirPathSourceId, + qmltypesPathSourceId, + qmltypes2PathSourceId)), + Field(&SynchronizationPackage::fileStatuses, IsEmpty()), + Field(&SynchronizationPackage::updatedFileStatusSourceIds, IsEmpty()), + Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + updater.update(); +} + +TEST_F(ProjectStorageUpdater, SynchronizIfQmldirFileHasNotChanged) +{ + ON_CALL(projectStorageMock, fetchProjectDatas(Eq(qmlDirPathSourceId))) + .WillByDefault(Return(QmlDesigner::Storage::ProjectDatas{ + {qmlDirPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmlDocumentSourceId1, exampleModuleId, FileType::QmlDocument}, + {qmlDirPathSourceId, qmlDocumentSourceId2, exampleModuleId, FileType::QmlDocument}})); + ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDirPathSourceId))) + .WillByDefault(Return(FileStatus{qmlDirPathSourceId, 21, 421})); + + EXPECT_CALL(projectStorageMock, + synchronize( + AllOf(Field(&SynchronizationPackage::imports, + UnorderedElementsAre(import1, import2, import4, import5)), + Field(&SynchronizationPackage::types, + UnorderedElementsAre( + Eq(objectType), + Eq(itemType), + AllOf(IsStorageType("First.qml", + Storage::ImportedType{"Object"}, + TypeAccessSemantics::Reference, + qmlDocumentSourceId1, + Storage::ChangeLevel::ExcludeExportedTypes), + Field(&Storage::Type::exportedTypes, IsEmpty())), + AllOf(IsStorageType("First.2.qml", + Storage::ImportedType{"Object2"}, + TypeAccessSemantics::Reference, + qmlDocumentSourceId2, + Storage::ChangeLevel::ExcludeExportedTypes), + Field(&Storage::Type::exportedTypes, IsEmpty())))), + Field(&SynchronizationPackage::updatedSourceIds, + UnorderedElementsAre(qmltypesPathSourceId, + qmltypes2PathSourceId, + qmlDocumentSourceId1, + qmlDocumentSourceId2)), + Field(&SynchronizationPackage::fileStatuses, + UnorderedElementsAre(IsFileStatus(qmltypesPathSourceId, 21, 421), + IsFileStatus(qmltypes2PathSourceId, 21, 421), + IsFileStatus(qmlDocumentSourceId1, 22, 12), + IsFileStatus(qmlDocumentSourceId2, 22, 13))), + Field(&SynchronizationPackage::updatedFileStatusSourceIds, + UnorderedElementsAre(qmltypesPathSourceId, + qmltypes2PathSourceId, + qmlDocumentSourceId1, + qmlDocumentSourceId2)), + Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + + updater.update(); +} + +TEST_F(ProjectStorageUpdater, SynchronizIfQmldirFileHasNotChangedAndSomeUpdatedFiles) +{ + ON_CALL(projectStorageMock, fetchProjectDatas(Eq(qmlDirPathSourceId))) + .WillByDefault(Return(QmlDesigner::Storage::ProjectDatas{ + {qmlDirPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, + {qmlDirPathSourceId, qmlDocumentSourceId1, exampleModuleId, FileType::QmlDocument}, + {qmlDirPathSourceId, qmlDocumentSourceId2, exampleModuleId, FileType::QmlDocument}})); + ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDirPathSourceId))) + .WillByDefault(Return(FileStatus{qmlDirPathSourceId, 21, 421})); + ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmltypes2PathSourceId))) + .WillByDefault(Return(FileStatus{qmltypes2PathSourceId, 21, 421})); + ON_CALL(projectStorageMock, fetchFileStatus(Eq(qmlDocumentSourceId2))) + .WillByDefault(Return(FileStatus{qmlDocumentSourceId2, 22, 13})); + + EXPECT_CALL( + projectStorageMock, + synchronize( + AllOf(Field(&SynchronizationPackage::imports, UnorderedElementsAre(import1, import4)), + Field(&SynchronizationPackage::types, + UnorderedElementsAre(Eq(objectType), + AllOf(IsStorageType("First.qml", + Storage::ImportedType{"Object"}, + TypeAccessSemantics::Reference, + qmlDocumentSourceId1, + Storage::ChangeLevel::ExcludeExportedTypes), + Field(&Storage::Type::exportedTypes, IsEmpty())))), + Field(&SynchronizationPackage::updatedSourceIds, + UnorderedElementsAre(qmltypesPathSourceId, qmlDocumentSourceId1)), + Field(&SynchronizationPackage::fileStatuses, + UnorderedElementsAre(IsFileStatus(qmltypesPathSourceId, 21, 421), + IsFileStatus(qmlDocumentSourceId1, 22, 12))), + Field(&SynchronizationPackage::updatedFileStatusSourceIds, + UnorderedElementsAre(qmltypesPathSourceId, qmlDocumentSourceId1)), + Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + + updater.update(); +} + } // namespace diff --git a/tests/unit/unittest/qmltypesparser-test.cpp b/tests/unit/unittest/qmltypesparser-test.cpp index 9de60a1807f..46c484accce 100644 --- a/tests/unit/unittest/qmltypesparser-test.cpp +++ b/tests/unit/unittest/qmltypesparser-test.cpp @@ -173,8 +173,10 @@ protected: Storage::Imports imports; Storage::Types types; SourceId qmltypesFileSourceId{sourcePathCache.sourceId("path/to/types.qmltypes")}; - QmlDesigner::Storage::ProjectData projectData{storage.moduleId("QtQml-cppnative"), - qmltypesFileSourceId}; + QmlDesigner::Storage::ProjectData projectData{qmltypesFileSourceId, + qmltypesFileSourceId, + storage.moduleId("QtQml-cppnative"), + Storage::FileType::QmlTypes}; SourceContextId qmltypesFileSourceContextId{sourcePathCache.sourceContextId(qmltypesFileSourceId)}; ModuleId directoryModuleId{storage.moduleId("path/to/")}; }; diff --git a/tests/unit/unittest/sqlitealgorithms-test.cpp b/tests/unit/unittest/sqlitealgorithms-test.cpp index 6c376a2ad8b..462814a67df 100644 --- a/tests/unit/unittest/sqlitealgorithms-test.cpp +++ b/tests/unit/unittest/sqlitealgorithms-test.cpp @@ -36,16 +36,14 @@ namespace { class KeyValueView { public: - KeyValueView(Utils::SmallStringView key, long long value, long long rowid) + KeyValueView(Utils::SmallStringView key, long long value) : key{key} , value{value} - , rowid{rowid} {} public: Utils::SmallStringView key; long long value = 0; - long long rowid = -1; }; std::ostream &operator<<(std::ostream &out, KeyValueView keyValueView) @@ -103,6 +101,7 @@ public: { Sqlite::Table table; table.setName("data"); + table.setUseWithoutRowId(true); table.addColumn("key", Sqlite::ColumnType::None, {Sqlite::PrimaryKey{}}); table.addColumn("value"); @@ -118,22 +117,26 @@ protected: Sqlite::Database database{":memory:", Sqlite::JournalMode::Memory}; Sqlite::ImmediateTransaction transaction{database}; Initializer initializer{database}; - Sqlite::ReadStatement<3> selectViewsStatement{"SELECT key, value, rowid FROM data ORDER BY key", + Sqlite::ReadStatement<2> selectViewsStatement{"SELECT key, value FROM data ORDER BY key", database}; Sqlite::ReadStatement<2> selectValuesStatement{"SELECT key, value FROM data ORDER BY key", database}; Sqlite::WriteStatement insertStatement{"INSERT INTO data(key, value) VALUES (?1, ?2)", database}; - Sqlite::WriteStatement updateStatement{"UPDATE data SET value = ?2 WHERE rowid = ?1", database}; - Sqlite::WriteStatement deleteStatement{"DELETE FROM data WHERE rowid = ?", database}; + Sqlite::WriteStatement updateStatement{"UPDATE data SET value = ?2 WHERE key=?1", database}; + Sqlite::WriteStatement deleteStatement{"DELETE FROM data WHERE key=?", database}; std::function insert{ [&](const KeyValue &keyValue) { insertStatement.write(keyValue.key, keyValue.value); }}; - std::function update{ + std::function update{ [&](KeyValueView keyValueView, const KeyValue &keyValue) { - if (!(keyValueView == keyValue)) - updateStatement.write(keyValueView.rowid, keyValue.value); + if (!(keyValueView == keyValue)) { + updateStatement.write(keyValueView.key, keyValue.value); + return Sqlite::UpdateChange::Update; + } + + return Sqlite::UpdateChange::No; }}; std::function remove{ - [&](KeyValueView keyValueView) { deleteStatement.write(keyValueView.rowid); }}; + [&](KeyValueView keyValueView) { deleteStatement.write(keyValueView.key); }}; }; auto compareKey = [](KeyValueView keyValueView, const KeyValue &keyValue) {