diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a34f1c9183..80ad5f44fd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,10 +107,35 @@ endif() add_subdirectory(doc) -# CMake will include in a cmake_install.cmake at the end the subdirectories -# At this point all the previous install scripts have been included -# Deployment is being done in cmake/CMakeLists.txt -add_subdirectory(cmake) +find_package(PythonInterp) +if (NOT PYTHONINTERP_FOUND) + message("No python interpreter found, skipping \"Dependencies\" install component.") +else() + get_target_property(_qmake_binary Qt5::qmake IMPORTED_LOCATION) + set(_llvm_arg) + if (LLVM_INSTALL_PREFIX) + set(_llvm_arg "--llvm \"${LLVM_INSTALL_PREFIX}\"") + endif() + set(_elfutils_arg) + if (ELFUTILS_INCLUDE_DIR) + get_filename_component(_elfutils_path ${ELFUTILS_INCLUDE_DIR} DIRECTORY) + set(_elfutils_arg "--elfutils \"${_elfutils_path}\"") + endif() + install(CODE " + execute_process(COMMAND + \"${PYTHON_EXECUTABLE}\" + \"${CMAKE_CURRENT_LIST_DIR}/scripts/deployqt.py\" + ${_llvm_arg} + ${_elfutils_arg} + \"\${CMAKE_INSTALL_PREFIX}/${IDE_APP_PATH}/${IDE_APP_TARGET}\" + \"${_qmake_binary}\" + COMMAND_ECHO STDOUT + ) + " + COMPONENT Dependencies + EXCLUDE_FROM_ALL + ) +endif() feature_summary(INCLUDE_QUIET_PACKAGES WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt deleted file mode 100644 index a005ce71e8c..00000000000 --- a/cmake/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -# Deployment of Qt, Clang, C++ Runtime libraries is being done in this script. -# -# It should be included as a subdirectory as last because of CMake's -# cmake_install.cmake script behviour of including subdirectories at the end -# of the script, not respecting the order of install commands from CMakeLists.txt -# -# This way we are sure that all the binaries have been installed before. - -if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) - get_target_property(moc_binary Qt5::moc IMPORTED_LOCATION) - get_filename_component(moc_dir "${moc_binary}" DIRECTORY) - get_filename_component(QT_BASE_DIR "${moc_dir}/../" ABSOLUTE) - - if (MSVC AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - set(exclusion_mask PATTERN "*d.dll" EXCLUDE) - endif() - - foreach(plugin - assetimporters designer iconengines imageformats platforminputcontexts - platforms platformthemes printsupport qmltooling sqldrivers styles - xcbglintegrations) - if(NOT EXISTS "${QT_BASE_DIR}/plugins/${plugin}") - continue() - endif() - install( - DIRECTORY "${QT_BASE_DIR}/plugins/${plugin}" - DESTINATION ${QT_DEST_PLUGIN_PATH} - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ${exclusion_mask} - ) - list(APPEND QT_PLUGIN_DIRECTORIES "${QT_DEST_PLUGIN_PATH}/${plugin}") - endforeach() - - install( - DIRECTORY "${QT_BASE_DIR}/qml/" - DESTINATION ${QT_DEST_QML_PATH} - COMPONENT Dependencies - EXCLUDE_FROM_ALL - PATTERN "qml/*" - ${exclusion_mask} - ) - - # QtCreator's "System Information..." needs qtdiag - set(qtdiag_destination ${IDE_BIN_PATH}) - if (NOT APPLE AND NOT WIN32) - set(qtdiag_destination ${IDE_LIBRARY_BASE_PATH}/Qt/bin) - endif() - install(PROGRAMS - "${QT_BASE_DIR}/bin/qtdiag${CMAKE_EXECUTABLE_SUFFIX}" - DESTINATION ${qtdiag_destination} - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - - # Analyze the binaries and install missing dependencies if they are - # found the CMAKE_PREFIX_PATH e.g. Qt, Clang - configure_file(InstallDependentSharedObjects.cmake.in InstallDependentSharedObjects.cmake @ONLY) - install( - SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/InstallDependentSharedObjects.cmake - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - - if (MSVC) - set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON) - include(InstallRequiredsystemLibraries) - - # For Qt Creator - install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} - DESTINATION ${IDE_APP_PATH} - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - - # For qtcreatorcdbext - set(ArchSuffix 32) - if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(ArchSuffix 64) - endif() - - install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} - DESTINATION lib/qtcreatorcdbext${ArchSuffix} - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - endif() -endif() diff --git a/cmake/FindClang.cmake b/cmake/FindClang.cmake index 0e1f5db36c6..fcc9f241e10 100644 --- a/cmake/FindClang.cmake +++ b/cmake/FindClang.cmake @@ -12,3 +12,15 @@ if (TARGET clangTooling AND NOT CLANGTOOLING_LINK_CLANG_DYLIB) elseif (TARGET clang-cpp) set(CLANG_TOOLING_LIBS libclang clang-cpp) endif() + +SET(QTC_CLANG_BUILDMODE_MATCH ON) +if (WIN32 AND TARGET libclang) + string(TOLOWER ${CMAKE_BUILD_TYPE} _type) + get_target_property(_llvmConfigs libclang IMPORTED_CONFIGURATIONS) + string(TOLOWER ${_llvmConfigs} _llvm_configs) + list(FIND _llvm_configs ${_type} _build_type_found) + if (_build_type_found LESS 0) + set(QTC_CLANG_BUILDMODE_MATCH OFF) + message("Build mode mismatch (debug vs release): limiting clangTooling") + endif() +endif() diff --git a/cmake/InstallDependentSharedObjects.cmake.in b/cmake/InstallDependentSharedObjects.cmake.in deleted file mode 100644 index a54e1fa5427..00000000000 --- a/cmake/InstallDependentSharedObjects.cmake.in +++ /dev/null @@ -1,151 +0,0 @@ -if (MINGW AND @CMAKE_CXX_COMPILER_ID@ MATCHES "Clang") - set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL objdump) -endif() -if (WIN32) - set(filter_regex PRE_EXCLUDE_REGEXES "api-ms-.*|ext-ms-.*") -elseif (APPLE) - set(filter_regex PRE_EXCLUDE_REGEXES "libiodbc.*|libpq.*") -endif() - -get_filename_component(install_prefix "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) - -# Get the dependencies of Qt's plugins -set(qt_plugin_directories "@QT_PLUGIN_DIRECTORIES@") -foreach(plugin IN LISTS qt_plugin_directories) - file(GLOB plugin_files "${install_prefix}/${plugin}/*@CMAKE_SHARED_LIBRARY_SUFFIX@") - list(APPEND qt_plugin_files "${plugin_files}") -endforeach() - -# Get the qml module dependencies -file(GLOB_RECURSE qml_plugin_files "${install_prefix}/@QT_DEST_QML_PATH@/*/*@CMAKE_SHARED_LIBRARY_SUFFIX@") -list(APPEND qt_plugin_files "${qml_plugin_files}") - -set(installed_EXECUTABLES_NOT_PREFIXED "@__QTC_INSTALLED_EXECUTABLES@") -set(installed_LIBRARIES_NOT_PREFIXED "@__QTC_INSTALLED_LIBRARIES@") -set(installed_MODULES_NOT_PREFIXED "@__QTC_INSTALLED_PLUGINS@") - -foreach(binary_type EXECUTABLES LIBRARIES MODULES) - foreach(element IN LISTS installed_${binary_type}_NOT_PREFIXED) - if (EXISTS "${install_prefix}/${element}") - list(APPEND installed_${binary_type} "${install_prefix}/${element}") - endif() - endforeach() -endforeach() - -# Install first the dependencies, and continue to install the dependencies -# of the installed dependencies e.g. libicu for libQt5Core on Linux. - -list(LENGTH installed_LIBRARIES installed_libraries_size) -unset(qt_plugins_installed) - -while(installed_libraries_size GREATER 0) - foreach(binary_type EXECUTABLES LIBRARIES MODULES) - list(LENGTH installed_${binary_type} list_size) - if (NOT list_size EQUAL 0) - set(${binary_type}_TO_ANALYZE ${binary_type} "${installed_${binary_type}}") - else() - set(${binary_type}_TO_ANALYZE "") - endif() - endforeach() - - file(GET_RUNTIME_DEPENDENCIES - UNRESOLVED_DEPENDENCIES_VAR unresolved_deps - RESOLVED_DEPENDENCIES_VAR resolved_deps - CONFLICTING_DEPENDENCIES_PREFIX conflicts - ${EXECUTABLES_TO_ANALYZE} - ${LIBRARIES_TO_ANALYZE} - ${MODULES_TO_ANALYZE} - DIRECTORIES - "${install_prefix}/@IDE_BIN_PATH@" - "${install_prefix}/@IDE_PLUGIN_PATH@" - "${install_prefix}/@IDE_LIBRARY_PATH@" - "${install_prefix}/@IDE_LIBRARY_BASE_PATH@/Qt/lib" - ${filter_regex} - ) - - # Clear for next step - set(installed_EXECUTABLES "") - set(installed_LIBRARIES "") - set(installed_MODULES "") - - if (NOT qt_plugins_installed) - if (WIN32) - # Needed by QmlDesigner, QmlProfiler, but they are not referenced directly. - list(APPEND unresolved_deps libEGL.dll libGLESv2.dll) - endif() - - set(qt_plugins_installed TRUE) - set(installed_MODULES "${qt_plugin_files}") - endif() - - list(REMOVE_DUPLICATES unresolved_deps) - list(REMOVE_DUPLICATES resolved_deps) - - file(TO_CMAKE_PATH "@CMAKE_PREFIX_PATH@" prefix_path) - - # Add parent link directory paths. Needed for e.g. MinGW choco libstdc++-6.dll - if (WIN32) - foreach(path "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@") - get_filename_component(parent_path "${path}" DIRECTORY) - list(APPEND prefix_path "${parent_path}") - endforeach() - endif() - - # On Linux the Qt libraries might exist in the system, and they are passed - # as resolved, therefore scan the resolved dependencies too - if (NOT WIN32 AND NOT APPLE) - list(APPEND unresolved_deps "${resolved_deps}") - endif() - - foreach(so IN LISTS unresolved_deps) - - # Skip the installed dependencies - string(FIND "${so}" "${install_prefix}" found_prefix_path) - if (NOT found_prefix_path EQUAL -1) - continue() - endif() - - # On Linux get the name of the resolved Qt dependency, this would come from ldconfig - # with the full path on the system - if (NOT APPLE AND NOT WIN32) - get_filename_component(so "${so}" NAME) - endif() - - if (APPLE) - string(REPLACE "@rpath/" "" so "${so}") - get_filename_component(so_dir "${so}" DIRECTORY) - endif() - - message(STATUS "Dependency: ${so}") - foreach(p IN LISTS prefix_path) - if (WIN32) - set(so_src "${p}/bin/${so}") - set(so_dest "${install_prefix}/@IDE_BIN_PATH@") - elseif(APPLE) - set(so_src "${p}/lib/${so}") - set(so_dest "${install_prefix}/@IDE_LIBRARY_PATH@/${so_dir}") - else() - set(so_src "${p}/lib/${so}") - if (p STREQUAL "@QT_BASE_DIR@") - set(so_dest "${install_prefix}/@IDE_LIBRARY_BASE_PATH@/Qt/lib") - else() - set(so_dest "${install_prefix}/@IDE_LIBRARY_PATH@") - endif() - endif() - - message(STATUS "Looking at: ${so_src}") - if (EXISTS "${so_src}") - file(INSTALL "${so_src}" DESTINATION "${so_dest}" FOLLOW_SYMLINK_CHAIN) - if (APPLE) - get_filename_component(so "${so}" NAME) - endif() - list(APPEND installed_LIBRARIES "${so_dest}/${so}") - break() - endif() - - endforeach() - endforeach() - - list(LENGTH installed_LIBRARIES installed_libraries_size) - -endwhile() diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 063b0dfdc8e..dbad94e64b8 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -749,61 +749,6 @@ function(add_qtc_executable name) update_cached_list(__QTC_INSTALLED_EXECUTABLES "${_DESTINATION}/${name}${CMAKE_EXECUTABLE_SUFFIX}") - - install(CODE " - function(create_qt_conf location base_dir) - get_filename_component(install_prefix \"\${CMAKE_INSTALL_PREFIX}\" ABSOLUTE) - file(RELATIVE_PATH qt_conf_binaries - \"\${install_prefix}/\${location}\" - \"\${install_prefix}/\${base_dir}\" - ) - if (NOT qt_conf_binaries) - set(qt_conf_binaries .) - endif() - file(RELATIVE_PATH qt_conf_plugins - \"\${install_prefix}/\${base_dir}\" - \"\${install_prefix}/${QT_DEST_PLUGIN_PATH}\" - ) - file(RELATIVE_PATH qt_conf_qml - \"\${install_prefix}/\${base_dir}\" - \"\${install_prefix}/${QT_DEST_QML_PATH}\" - ) - file(WRITE \"\${CMAKE_INSTALL_PREFIX}/\${location}/qt.conf\" - \"[Paths]\n\" - \"Plugins=\${qt_conf_plugins}\n\" - \"Qml2Imports=\${qt_conf_qml}\n\" - ) - # For Apple for Qt Creator do not add a Prefix - if (NOT APPLE OR NOT qt_conf_binaries STREQUAL \"../\") - file(APPEND \"\${CMAKE_INSTALL_PREFIX}/\${location}/qt.conf\" - \"Prefix=\${qt_conf_binaries}\n\" - ) - endif() - if (WIN32 OR APPLE) - file(RELATIVE_PATH qt_binaries - \"\${install_prefix}/\${base_dir}\" - \"\${install_prefix}/${IDE_BIN_PATH}\" - ) - if (NOT qt_binaries) - set(qt_binaries .) - endif() - file(APPEND \"\${CMAKE_INSTALL_PREFIX}/\${location}/qt.conf\" - \"# Needed by QtCreator for qtdiag\n\" - \"Binaries=\${qt_binaries}\n\") - endif() - endfunction() - if(APPLE) - create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_DATA_PATH}/..\") - elseif (WIN32) - create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_APP_PATH}\") - else() - create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_LIBRARY_BASE_PATH}/Qt\") - endif() - " - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - endif() endfunction() diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 6a8dc4c39cf..0aafe289e6f 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -291,6 +291,14 @@ function(enable_pch target) return() endif() + # static libs are maybe used by other projects, so they can not reuse same pch files + if (MSVC) + get_target_property(target_type "${target}" TYPE) + if (target_type MATCHES "STATIC") + return() + endif() + endif() + # Skip PCH for targets that do not have QT_NO_CAST_TO_ASCII get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) if (NOT "QT_NO_CAST_TO_ASCII" IN_LIST target_defines) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 351cd85df6a..8fcd5862e7d 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "4.13.83") # The IDE version. -set(IDE_VERSION_COMPAT "4.13.83") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "4.14.0-beta2") # The IDE display version. +set(IDE_VERSION "4.13.84") # The IDE version. +set(IDE_VERSION_COMPAT "4.13.84") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "4.14.0-rc1") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2020") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/doc/qtcreator/images/anchor-bottom.png b/doc/qtcreator/images/anchor-bottom.png deleted file mode 100644 index 3a96c98107a..00000000000 Binary files a/doc/qtcreator/images/anchor-bottom.png and /dev/null differ diff --git a/doc/qtcreator/images/anchor-fill.png b/doc/qtcreator/images/anchor-fill.png deleted file mode 100644 index a065729bee0..00000000000 Binary files a/doc/qtcreator/images/anchor-fill.png and /dev/null differ diff --git a/doc/qtcreator/images/anchor-horizontal-center.png b/doc/qtcreator/images/anchor-horizontal-center.png deleted file mode 100644 index 984fa0eb680..00000000000 Binary files a/doc/qtcreator/images/anchor-horizontal-center.png and /dev/null differ diff --git a/doc/qtcreator/images/anchor-left.png b/doc/qtcreator/images/anchor-left.png deleted file mode 100644 index 92637502352..00000000000 Binary files a/doc/qtcreator/images/anchor-left.png and /dev/null differ diff --git a/doc/qtcreator/images/anchor-right.png b/doc/qtcreator/images/anchor-right.png deleted file mode 100644 index 7fa48d4f75a..00000000000 Binary files a/doc/qtcreator/images/anchor-right.png and /dev/null differ diff --git a/doc/qtcreator/images/anchor-top.png b/doc/qtcreator/images/anchor-top.png deleted file mode 100644 index 12dd0ff3e16..00000000000 Binary files a/doc/qtcreator/images/anchor-top.png and /dev/null differ diff --git a/doc/qtcreator/images/anchor-vertical-center.png b/doc/qtcreator/images/anchor-vertical-center.png deleted file mode 100644 index a82090c1edb..00000000000 Binary files a/doc/qtcreator/images/anchor-vertical-center.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/action-icon-binding.png b/doc/qtcreator/images/icons/action-icon-binding.png index 34b2c6adda2..8cfd1286391 100644 Binary files a/doc/qtcreator/images/icons/action-icon-binding.png and b/doc/qtcreator/images/icons/action-icon-binding.png differ diff --git a/doc/qtcreator/images/icons/action-icon.png b/doc/qtcreator/images/icons/action-icon.png index 94e95ce8efc..f9a52b2d765 100644 Binary files a/doc/qtcreator/images/icons/action-icon.png and b/doc/qtcreator/images/icons/action-icon.png differ diff --git a/doc/qtcreator/images/icons/anchor-bottom.png b/doc/qtcreator/images/icons/anchor-bottom.png new file mode 100644 index 00000000000..9ef1e5b3646 Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-bottom.png differ diff --git a/doc/qtcreator/images/icons/anchor-center-horizontal.png b/doc/qtcreator/images/icons/anchor-center-horizontal.png new file mode 100644 index 00000000000..bdd51c79d19 Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-center-horizontal.png differ diff --git a/doc/qtcreator/images/icons/anchor-center-vertical.png b/doc/qtcreator/images/icons/anchor-center-vertical.png new file mode 100644 index 00000000000..e8f8f253d91 Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-center-vertical.png differ diff --git a/doc/qtcreator/images/icons/anchor-fill.png b/doc/qtcreator/images/icons/anchor-fill.png new file mode 100644 index 00000000000..da8b6bf92b3 Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-fill.png differ diff --git a/doc/qtcreator/images/icons/anchor-left.png b/doc/qtcreator/images/icons/anchor-left.png new file mode 100644 index 00000000000..78c3c90b250 Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-left.png differ diff --git a/doc/qtcreator/images/icons/anchor-right.png b/doc/qtcreator/images/icons/anchor-right.png new file mode 100644 index 00000000000..042dc830b77 Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-right.png differ diff --git a/doc/qtcreator/images/icons/anchor-top.png b/doc/qtcreator/images/icons/anchor-top.png new file mode 100644 index 00000000000..4136ca624fa Binary files /dev/null and b/doc/qtcreator/images/icons/anchor-top.png differ diff --git a/doc/qtcreator/images/icons/annotation.png b/doc/qtcreator/images/icons/annotation.png index 28072923f7b..59333eeef03 100644 Binary files a/doc/qtcreator/images/icons/annotation.png and b/doc/qtcreator/images/icons/annotation.png differ diff --git a/doc/qtcreator/images/icons/detach-group-icon.png b/doc/qtcreator/images/icons/detach-group-icon.png index 82fc8ddad69..8155f07a8f2 100644 Binary files a/doc/qtcreator/images/icons/detach-group-icon.png and b/doc/qtcreator/images/icons/detach-group-icon.png differ diff --git a/doc/qtcreator/images/icons/distribute-origin-none.png b/doc/qtcreator/images/icons/distribute-origin-none.png new file mode 100644 index 00000000000..349f40ca26a Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-origin-none.png differ diff --git a/doc/qtcreator/images/icons/lockon.png b/doc/qtcreator/images/icons/lockon.png new file mode 100644 index 00000000000..35f98eb7f31 Binary files /dev/null and b/doc/qtcreator/images/icons/lockon.png differ diff --git a/doc/qtcreator/images/icons/rotation-cursor.png b/doc/qtcreator/images/icons/rotation-cursor.png new file mode 100644 index 00000000000..33ff9a73f1d Binary files /dev/null and b/doc/qtcreator/images/icons/rotation-cursor.png differ diff --git a/doc/qtcreator/images/icons/swipeview-icon@2x.png b/doc/qtcreator/images/icons/swipeview-icon@2x.png deleted file mode 100644 index 0ccb978c469..00000000000 Binary files a/doc/qtcreator/images/icons/swipeview-icon@2x.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/visibilityon.png b/doc/qtcreator/images/icons/visibilityon.png new file mode 100644 index 00000000000..a7e0aed963e Binary files /dev/null and b/doc/qtcreator/images/icons/visibilityon.png differ diff --git a/doc/qtcreator/images/qmldesigner-distribute-spacing-x.png b/doc/qtcreator/images/qmldesigner-distribute-spacing-x.png deleted file mode 100644 index bba6c1d7a70..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-distribute-spacing-x.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-element-size.png b/doc/qtcreator/images/qmldesigner-element-size.png index 5c084277dec..550eb01dfa9 100644 Binary files a/doc/qtcreator/images/qmldesigner-element-size.png and b/doc/qtcreator/images/qmldesigner-element-size.png differ diff --git a/doc/qtcreator/images/qmldesigner-form-editor.png b/doc/qtcreator/images/qmldesigner-form-editor.png index 66aaa7229d3..5aa3a6c3fbb 100644 Binary files a/doc/qtcreator/images/qmldesigner-form-editor.png and b/doc/qtcreator/images/qmldesigner-form-editor.png differ diff --git a/doc/qtcreator/images/qmldesigner-implement-signal-handler.png b/doc/qtcreator/images/qmldesigner-implement-signal-handler.png new file mode 100644 index 00000000000..6098f89b9ac Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-implement-signal-handler.png differ diff --git a/doc/qtcreator/images/qmldesigner-merge-with-template.png b/doc/qtcreator/images/qmldesigner-merge-with-template.png new file mode 100644 index 00000000000..ebde3829a05 Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-merge-with-template.png differ diff --git a/doc/qtcreator/images/qmldesigner-navigator-arrows.png b/doc/qtcreator/images/qmldesigner-navigator-arrows.png index 404e5208756..471a2d3def5 100644 Binary files a/doc/qtcreator/images/qmldesigner-navigator-arrows.png and b/doc/qtcreator/images/qmldesigner-navigator-arrows.png differ diff --git a/doc/qtcreator/images/qmldesigner-navigator.png b/doc/qtcreator/images/qmldesigner-navigator.png index 7aae0659cce..c6c9e281b7e 100644 Binary files a/doc/qtcreator/images/qmldesigner-navigator.png and b/doc/qtcreator/images/qmldesigner-navigator.png differ diff --git a/doc/qtcreator/images/qmldesigner-preview-size.png b/doc/qtcreator/images/qmldesigner-preview-size.png index 244ea4913ce..5113bdf3b42 100644 Binary files a/doc/qtcreator/images/qmldesigner-preview-size.png and b/doc/qtcreator/images/qmldesigner-preview-size.png differ diff --git a/doc/qtcreator/images/qmldesigner-snap-margins.png b/doc/qtcreator/images/qmldesigner-snap-margins.png index f1b697b1c06..703ed8cc9a5 100644 Binary files a/doc/qtcreator/images/qmldesigner-snap-margins.png and b/doc/qtcreator/images/qmldesigner-snap-margins.png differ diff --git a/doc/qtcreator/images/qtquick-designer-navigator-arrange.gif b/doc/qtcreator/images/qtquick-designer-navigator-arrange.gif new file mode 100644 index 00000000000..cbe8d377ef2 Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-navigator-arrange.gif differ diff --git a/doc/qtcreator/images/qtquick-designer-navigator-lock.gif b/doc/qtcreator/images/qtquick-designer-navigator-lock.gif new file mode 100644 index 00000000000..981c9a1993a Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-navigator-lock.gif differ diff --git a/doc/qtcreator/images/qtquick-designer-options.png b/doc/qtcreator/images/qtquick-designer-options.png new file mode 100644 index 00000000000..34cd5e7342d Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-options.png differ diff --git a/doc/qtcreator/images/qtquick-designer-rotating-items.png b/doc/qtcreator/images/qtquick-designer-rotating-items.png index 7dc8c84c415..b9b89362405 100644 Binary files a/doc/qtcreator/images/qtquick-designer-rotating-items.png and b/doc/qtcreator/images/qtquick-designer-rotating-items.png differ diff --git a/doc/qtcreator/images/qtquick-designer-scaling-items.png b/doc/qtcreator/images/qtquick-designer-scaling-items.png new file mode 100644 index 00000000000..291b4e9e68c Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-scaling-items.png differ diff --git a/doc/qtcreator/images/qtquick-states-binding-editor-not.png b/doc/qtcreator/images/qtquick-states-binding-editor-not.png new file mode 100644 index 00000000000..334ddec39e6 Binary files /dev/null and b/doc/qtcreator/images/qtquick-states-binding-editor-not.png differ diff --git a/doc/qtcreator/images/qtquick-states-binding-editor.png b/doc/qtcreator/images/qtquick-states-binding-editor.png index 57be12f0ec2..8d57b724e18 100644 Binary files a/doc/qtcreator/images/qtquick-states-binding-editor.png and b/doc/qtcreator/images/qtquick-states-binding-editor.png differ diff --git a/doc/qtcreator/images/studio-curve-editor.png b/doc/qtcreator/images/studio-curve-editor.png index 000c2cd3439..ee44e74cc0a 100644 Binary files a/doc/qtcreator/images/studio-curve-editor.png and b/doc/qtcreator/images/studio-curve-editor.png differ diff --git a/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc b/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc new file mode 100644 index 00000000000..a8bd94c4621 --- /dev/null +++ b/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! +//! [logical operators] + \section2 Summary of Logical Operators + + You can use the following + \l{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators} + {logical operators} in the expressions to combine several conditions in one + expression: + + \table + \header + \li Operator + \li Meaning + \li Evaluates to \c true if + \row + \li ! + \li NOT + \li The condition is not met. + \row + \li && + \li AND + \li Both conditions are met. + \row + \li || + \li OR + \li Either of the conditions is met. + \row + \li < + \li Less than + \li The left operand is less than the right operand. + \row + \li > + \li Greater than + \li The left operand is greater than the right operand. + \row + \li >= + \li Greater than or equal + \li The left operand is greater than or equal to the right operand. + \row + \li <= + \li Less than or equal + \li The left operand is less than or equal to the right operand. + \row + \li == + \li Equal + \li The operands are equal. + \row + \li === + \li Strict equal + \li The operands are equal and of the same type. + \row + \li != + \li Not equal + \li The operands are not equal. + \row + \li !== + \li Strict not equal + \li The operands are of the same type but not equal, or are of + different type. + \endtable + + In addition, you can use arithmetic operators to compare numbers before + checks. However, we recommend that you create separate properties for this + purpose whenever possible. +//! [logical operators] +*/ diff --git a/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc b/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc index 228efa73951..7b2fd1e9d75 100644 --- a/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc @@ -94,7 +94,7 @@ to reference the rectangle from other places. \li Select the \uicontrol Layout tab, and then click - the \inlineimage anchor-fill.png + the \inlineimage icons/anchor-fill.png (\uicontrol {Fill to Parent}) button to anchor the rectangle to the item. 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 06444edf82d..2593803024b 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc @@ -119,8 +119,8 @@ the white background. \li Click \uicontrol {Layout}, and then click the - \inlineimage anchor-top.png - (\uicontrol Top) and \inlineimage anchor-left.png + \inlineimage icons/anchor-top.png + (\uicontrol Top) and \inlineimage icons/anchor-left.png (\uicontrol Left) anchor buttons to anchor the rectangle to the top left corner of the page. @@ -135,7 +135,7 @@ \uicontrol Library to \e topLeftRect in \uicontrol Navigator. \li Click \uicontrol {Layout}, and then click the - \inlineimage anchor-fill.png + \inlineimage icons/anchor-fill.png (\uicontrol {Fill to Parent}) button to anchor the mouse area to the rectangle. @@ -151,9 +151,9 @@ \li In the \uicontrol Id field, enter \e middleRightRect. \li In \uicontrol {Layout}, select the - \inlineimage anchor-vertical-center.png + \inlineimage icons/anchor-center-vertical.png (\uicontrol {Vertical Center} anchor button and then the - \inlineimage anchor-right.png + \inlineimage icons/anchor-right.png (\uicontrol Right) anchor button to anchor the rectangle to the middle right margin of its parent. @@ -169,8 +169,8 @@ \li In the \uicontrol Id field, enter \e bottomLeftRect. \li In \uicontrol {Layout}, select the - \inlineimage anchor-bottom.png - (\uicontrol Bottom) and \inlineimage anchor-left.png + \inlineimage icons/anchor-bottom.png + (\uicontrol Bottom) and \inlineimage icons/anchor-left.png (\uicontrol Left) anchor buttons to anchor the rectangle to the bottom left margin of its parent. diff --git a/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc b/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc index e2180ec073a..8b59984afff 100644 --- a/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc @@ -75,7 +75,7 @@ the rectangle to produce rounded corners for the button. \li Select \uicontrol {Layout}, and then select the - \inlineimage anchor-fill.png + \inlineimage icons/anchor-fill.png (\uicontrol {Fill to Parent}) button to anchor the rectangle to the item. @@ -190,7 +190,7 @@ \li In the \uicontrol Source field, select the image file for the border image. For example, inactive_button.png. \li In the \uicontrol {Layout} tab, select the - \inlineimage anchor-fill.png + \inlineimage icons/anchor-fill.png (\uicontrol {Fill to Parent}) button to always make the image the same size as its parent. This makes the button component scalable, because the image size is bound to the @@ -204,7 +204,7 @@ for the button when it is clicked. For example, active_button.png. \li In the \uicontrol {Layout} tab, select the - \inlineimage anchor-fill.png + \inlineimage icons/anchor-fill.png (\uicontrol {Fill to Parent}) button. \endlist \li Select the text item to specify font size and color in @@ -216,9 +216,9 @@ \li In \uicontrol Font group, \uicontrol Size field, enter the font size. \li In the \uicontrol {Layout} tab, select - \inlineimage anchor-vertical-center.png + \inlineimage icons/anchor-center-vertical.png (\uicontrol {Vertical Center}) and - \inlineimage anchor-horizontal-center.png + \inlineimage icons/anchor-center-horizontal.png (\uicontrol {Horizontal Center}) buttons to inherit the vertical and horizontal centering from the parent. This ensures that the button label is centered when the diff --git a/doc/qtcreator/src/qtquick/qtquick-component-context-menu.qdocinc b/doc/qtcreator/src/qtquick/qtquick-component-context-menu.qdocinc new file mode 100644 index 00000000000..5c73bcf1562 --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-component-context-menu.qdocinc @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! +//! [context-menu] + \section1 Context Menu + + The following table summarizes the \uicontrol Navigator and + \uicontrol {Form Editor} context menu items and provides links + to more information about them. + + \table + \header + \li To Learn About + \li Go To + \row + \li Arrange + \li \l{Arranging Items} + \row + \li Edit + \li \l{Showing and Hiding Items} + \row + \li Anchors + \li \l{Setting Anchors and Margins} + \row + \li Group + \li \l Group + \row + \li Position + \li \l{Using Positioners} + \row + \li Layout + \li \l{Using Layouts} + \row + \li Stacked Container + \li \l{Lists and Other Data Models} + \row + \li Timeline + \li \l{Creating Timelines} + \row + \li Event List + \li \l{Simulating Events} + \row + \li Edit Color + \li \l{Editing Properties Inline} + \row + \li Edit Annotation + \li \l{Annotating Designs} + \row + \li Merge File with Template + \li \l{Merging Files with Templates} + \row + \li Move Component into Separate File + \li \l{Moving Components into Separate Files} + \row + \li Add New Signal Handler + \li \l{Adding Signal Handlers} + \row + \li Go to Implementation + \li \l{Using Qt Quick UI Forms} + \row + \li Go into Component + \li \l{Moving Within Components} + \endtable +//! [context-menu] +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc index a082e23f848..82a90f702e0 100644 --- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc @@ -246,6 +246,25 @@ \include qtdesignstudio-components.qdocinc creating studio components \endif + \section1 Moving Components into Separate Files + + An alternative way of creating reusable components is to move them into + separate QML files. Right-click a component in the \uicontrol Navigator + or \uicontrol {Form Editor} view and select + \uicontrol {Move Component into Separate File} in the context menu. + + \image qtcreator-move-component-into-separate-file.png + + Give the new component a name and select whether properties are set for + the new component or for the original one. + + For an example of creating a reusable custom component, see + \if defined(qtcreator) + \l{Creating a Mobile Application}. + \else + \l{Progress Bar}. + \endif + \section1 Moving Within Components Components can consist of several other components. To view the component @@ -256,4 +275,17 @@ component. \image qmldesigner-breadcrumbs.png "Go into Component command" + + \section1 Merging Files with Templates + + You can merge the current QML file against an existing second QML file and + using the second QML file in a way similar to using a CSS stylesheet. + + To use this experimental feature, right-click a component in the + \uicontrol Navigator or \uicontrol {Form Editor} view and select + \uicontrol {Merge File with Template} in the context menu. + + \image qmldesigner-merge-with-template.png "Merge with Template dialog" + + In the \uicontrol Template field, select the file to use as a template. */ diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc index d3139ce23b9..b0d2751b08f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc @@ -71,4 +71,7 @@ \uicontrol {Binding Editor}. For more information, see \l{Setting Bindings}. \image qmldesigner-binding-editor.png "Binding Editor" + + \include creator-logical-operators.qdocinc logical operators + */ diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc index a9b04c79373..43679007285 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc @@ -44,7 +44,7 @@ A signal is automatically emitted when the value of a QML property changes. This type of signal is a \e{property change signal} and signal handlers - for these signals are written in the form \c onChanged, where + for these signals are written in the form \c onChanged, where \e is the name of the property, with the first letter capitalized. @@ -84,6 +84,25 @@ in the context menu to specify the connection in \uicontrol {Connection Editor}. + \section1 Adding Signal Handlers + + If a signal handler that you need is not listed in the + \uicontrol {Signal Handler} column, you can add it: + + \list 1 + \li Right-click a component in the \uicontrol Navigator or + \uicontrol {Form Editor} view and select + \uicontrol {Add New Signal Handler} in the context menu. + \li In the \uicontrol Signal field, select the signal to handle. + \image qmldesigner-implement-signal-handler.png "Implement Signal Handler dialog" + \li Select the radio buttons to filter the list to only display + frequently used signals or property changes. + \li Select \uicontrol OK. + \endlist + + The added signal handler is automatically \l{Using Qt Quick UI Forms} + {exported as a property}. + \if defined(qtdesignstudio) \section1 Adding Actions and Assignments diff --git a/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc index 3349ec15c30..c7efa1ef8ef 100644 --- a/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc @@ -30,16 +30,22 @@ \title Editing 2D Content - You design applications in the \uicontrol {Form Editor} by placing items - into it. + You design applications in the \uicontrol {Form Editor} view by placing + 2D components and assets into it. + + When you select items in \uicontrol {Form Editor}, markers + appear around their edges and in their corners. Depending on the shape of + the cursor, you can move, resize, or rotate the item by dragging it. + The following image shows the move cursor. \image qmldesigner-form-editor.png "Form Editor view" - \section1 Resizing Items + \section1 Resizing 2D Items - When you select items in the \uicontrol {Form Editor}, selection handles - appear around their edges and in their corners. You can drag the selection - handles to resize items. + When the resize cursor is displayed, you can drag the selection handles + to resize items. + + \image qtquick-designer-scaling-items.png "Form Editor view" \if defined(qtdesignstudio) To have the resizing done from the center of the selected item instead from @@ -53,12 +59,12 @@ press \key Alt+Shift. \endif - \section1 Rotating Items + \section1 Rotating 2D Items - You can use a rotation tool \inlineimage rotate_on.png - in one of the corners of an item to freely rotate - items around their origin in \uicontrol {Form Editor}. - Drag clockwise or counter-clockwise to rotate the item. + When the rotation cursor \inlineimage icons/rotation-cursor.png + is displayed in one of the corners of an item, you can drag + clockwise or counter-clockwise to freely rotate the item around + its origin in \uicontrol {Form Editor}. \image qtquick-designer-rotating-items.png "2D rotation tool" @@ -73,11 +79,13 @@ \section1 Snapping to Parent and Sibling Items When you are working on a design, you can use snapping to align - items in the \uicontrol {Form Editor}. Click the \inlineimage snapping.png + items in \uicontrol {Form Editor}. Click the \inlineimage snapping.png button to have the items snap to their parent or sibling items. Snapping lines automatically appear to help you position the items. Click the \inlineimage snapping_and_anchoring.png button to anchor the item to the items that you snap to. + Only one snapping button can be selected at the time. Selecting + one snapping button automatically deselects the others. Choose \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} > \uicontrol {Qt Quick Designer} to specify settings for snapping. In the @@ -86,6 +94,8 @@ \uicontrol {Sibling item spacing} field, specify the distance in pixels between sibling items and the snapping lines. + \image qtquick-designer-options.png "Qt Quick Designer options" + The following image shows the snapping lines (1) when \uicontrol {Parent item padding} is set to 5 pixels. @@ -93,7 +103,7 @@ \section1 Hiding Item Boundaries - The \uicontrol {Form Editor} displays the boundaries of items. + \uicontrol {Form Editor} displays the boundaries of items. To hide them, select the \inlineimage boundingrect.png button. @@ -109,7 +119,7 @@ To experiment with different component sizes, enter values in the \uicontrol {Override Width} and \uicontrol {Override Height} fields (1) on the canvas toolbar. The changes are displayed in the \uicontrol {Form Editor} - (2) and in the \uicontrol States view (3), but the property + view (2) and in the \uicontrol States view (3), but the property values are not changed permanently in the QML file. You can permanently change the property values in the \uicontrol Properties view (4). @@ -129,13 +139,14 @@ \section1 Refreshing the Form Editor Contents When you open QML files in the Design mode, the items in the file are drawn - in the \uicontrol {Form Editor}. When you edit the item properties, the QML + in \uicontrol {Form Editor}. When you edit the item properties, the QML file and the contents of the editor might get out of sync. For example, when you change the position of an item within a column or a row, the new - position might not be displayed correctly in the \uicontrol {Form Editor}. + position might not be displayed correctly in \uicontrol {Form Editor}. - To refresh the contents of the \uicontrol {Form Editor}, press \key R or + To refresh the contents of \uicontrol {Form Editor}, press \key R or select the \inlineimage reset.png (\uicontrol {Reset View}) button. + \include qtquick-component-context-menu.qdocinc context-menu */ diff --git a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc index 57bdaf64d31..6665902d3e9 100644 --- a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc @@ -45,9 +45,13 @@ {devices} \endlist - You can use a Qt Creator wizard to create a Qt Quick application that is - built using the qmake build system and then copy the source files from the - Qt UI Quick project to the application project. + For more information about integrating QML and C++, see + \l{https://doc.qt.io/qt-5/qtqml-cppintegration-overview.html} + {Overview - QML and C++ Integration}. + + You can use a Qt Creator wizard template to create a Qt Quick application + that is built using the qmake build system and then copy the source files + from the Qt UI Quick project to the application project. You can use the \c RESOURCES option in the project configuration file to automatically add all the QML files and related assets to a Qt resource @@ -62,6 +66,10 @@ Then you can use the \l QQuickView class in the main C++ source file to show the main QML file when the application starts. + The \e {Qt Quick Designer Components} module is delivered with \QDS. If you + use Studio Components or Effects in your project, you have to build the + module and install it to your Qt to be able to build your project. + The \l{Qt Quick Timeline} module is delivered with \QDS and with Qt 5.14, and later. If you use a timeline in a \QDS project that you import to \QC, and your Qt is older than 5.14, you must build the Qt Quick Timeline module @@ -124,6 +132,30 @@ call the QFontDatabase::addApplicationFont() function from the \e {main.cpp} file. + \section1 Adding Qt Quick Designer Components to Qt Installations + + If you use Studio Components or Effects in your project, you have to + check out and install the \e {Qt Quick Designer Components} module from + \l{https://codereview.qt-project.org/admin/repos/qt-labs/qtquickdesigner-components} + {Qt Code Review}. + + For example: + \badcode + git clone "ssh://user@codereview.qt-project.org:29418/qt-labs/qtquickdesigner-components" + \endcode + + Then use qmake from your Qt installation to build the module and to add it + to your Qt. Switch to the directory that contains the sources (usually, + qtquickdesigner-components), and enter the following commands: + + \badcode + \qmake -r + make + make install + \endcode + + On Windows, use the \c nmake and \c {nmake install} commands instead. + \section1 Adding Qt Quick Timeline Module to Qt Installations \note You only need to do this if your Qt version is older than 5.14. @@ -137,15 +169,6 @@ git clone ssh://user@codereview.qt-project.org:29418/qt/qtquicktimeline \endcode - Then use qmake from your Qt installation to build the module and to add it - to your Qt. Switch to the directory that contains the sources (usually, - \c qtquicktimeline), and enter the following commands: - - \badcode - \qmake -r - make - make install - \endcode - - On Windows, use the \c nmake and \c {nmake install} commands instead. + Then build the module and add it to your Qt as described in the previous + section. */ diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc b/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc similarity index 74% rename from doc/qtcreator/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc rename to doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc index abb3dec1082..dc9448d095e 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -30,9 +30,14 @@ // ********************************************************************** /*! - \previouspage creator-quick-ui-forms.html \page creator-qml-modules-with-plugins.html + \if defined(qtdesignstudio) + \previouspage studio-simulink.html + \nextpage studio-debugging.html + \else + \previouspage qtquick-iso-icon-browser.html \nextpage quick-converting-ui-projects.html + \endif \title Using QML Modules with Plugins @@ -41,16 +46,23 @@ the contained components, and therefore, the modules must provide extra type information for code completion and the semantic checks to work correctly. - To create a QML module and make it appear in the \uicontrol Library in + To create a QML module and make it appear in the \uicontrol Library view in the Design mode: \list 1 \li Create custom QML controls and place all the \c .qml files in a - directory dedicated to your module. + directory dedicated to your module. For example: + \c {imports\asset_imports}. - \li Create a \c qmldir file for your module and place it in the module - directory. For more information, see + \li For Qt Quick UI projects (.qmlproject), specify the path to + the directory that contains the module in the .qmlproject file + of the application where you want to use the module + as a value of the \c importPaths variable. For example + \c{importPaths: [ "imports", "asset_imports" ]}. + + \li Create a \c qmldir file for your module and place it + in the module directory. For more information, see \l {Module Definition qmldir Files}. \li Create a \c qmltypes file, preferably using \c qmlplugindump. @@ -60,39 +72,45 @@ \li Create a \c .metainfo file for your module and place it in the \c designer directory. Meta information is needed to display the - components in the \uicontrol {QML Types} tab in the \uicontrol + components in the \uicontrol {QML Types} tab in \uicontrol Library. Use a metainfo file delivered with Qt, such as \c qtquickcontrols2.metainfo, as an example. - \li Import your module into a project using \c QML_IMPORT_PATH in the - .pro file: \c {QML_IMPORT_PATH += path/to/module}. - For more information, see \l {Importing QML Modules}. + \if defined(qtcreator) + \li Import the module into the project, as instructed in + \l {Importing QML Modules}. \li Make sure that the QML emulation layer used in the Design mode is built with the same Qt version as your QML modules. For more information, see \l {Running QML Modules in Design Mode}. You can also try skipping this step and take it later, if necessary. + \else + \li Build your module using the same Qt version and compiler as \QDS. + For more information, see \l {Running QML Modules in Design Mode}. + \endif \endlist - Your module should now appear in the \uicontrol {QML Imports} tab in the + Your module should now appear in the \uicontrol {QML Imports} tab in \uicontrol Library in the Design mode. Your components should appear in the \uicontrol {QML Types} tab if a valid \c .metainfo file is in place. + \if defined(qtcreator) \section1 Registering QML Types - When you write a QML module or use QML from a C++ application, you typically - register new types with the qmlRegisterType() function or expose some - class instances with \l{QQmlContext::setContextProperty()}. The \QC C++ - code model now scans for these calls and - tells the QML code model about them. This means that properties are - displayed during code completion and the JavaScript code checker does not + When you write a QML module or use QML from a C++ application, and the C++ + is a part of your qmake project, you typically register new types with the + \c qmlRegisterType() function or expose some class instances with + \l{QQmlContext::setContextProperty()}. The \QC C++ code model now scans for + these calls and tells the QML code model about them. This means that properties + are displayed during code completion and the JavaScript code checker does not complain about unknown types. However, this works only when the source code is available, and therefore, you must explicitly generate type information for QML modules with plugins before distributing them. Classes registered with \c qmlRegisterType() can be used as backend objects in the Design mode. For more information, see \l {Adding Connections}. + \endif \section1 Generating qmltypes Files @@ -122,9 +140,11 @@ You can safely ignore the debug output. + \if defined(qtcreator) For Qt 4.7.x, you can compile a version of the tool called \c qmldump from the sources in \c{/share/qtcreator/qml/qmldump} if the Qt version contains private headers. + \endif \section2 Dumping Plugins Automatically @@ -133,12 +153,14 @@ However, this automatic dumping is a fallback mechanism with many points of failure and you cannot rely upon it. + \if defined(qtcreator) \section1 Importing QML Modules By default, \QC will look in the QML import path of Qt for QML modules. - If your applications adds additional import paths that \QC should use, - then you can specify those using \c{QML_IMPORT_PATH} in the \c{.pro} file of your - application. + + If you use qmake and your application adds additional import paths that + \QC should use, specify them using \c{QML_IMPORT_PATH} in the \c{.pro} + file of your application: \c {QML_IMPORT_PATH += path/to/module}. If you use CMake, add the following command to the CMakeLists.txt file to set the QML import path: @@ -148,14 +170,16 @@ \endcode The import path affects all the targets built by the CMake project. + \endif \section1 Running QML Modules in Design Mode A QML emulation layer (also called QML Puppet) is used in the Design mode to render and preview images and to collect data. To be able to render custom types correctly from QML modules, the emulation layer must be built with the same - Qt version as the QML modules. + Qt version and compiler as the QML modules. + \if defined(qtcreator) By default, a fallback emulation layer is provided by \QC and built with the same Qt version as \QC. Therefore, your QML modules will mostly not work out of the box. @@ -165,17 +189,27 @@ \uicontrol Options > \uicontrol {Qt Quick} > \uicontrol {Qt Quick Designer} > \uicontrol {Use QML emulation layer which is built by the selected Qt} radio button. \QC builds the emulation layer when you select the Design mode. + \else + On Windows, select \uicontrol Help > \uicontrol {About Qt Design Studio} to + check the Qt version and compiler that you need to use to build your plugin. + For example: \c {Based on Qt 5.15.2 (MSVC 2019, 64 bit)}. + + On macOS, select \uicontrol {Qt Design Studio} > + \uicontrol {About Qt Design Studio} to see something like: + \c {Based on Qt 5.15.2 (Clang 10.0 (Apple), 64 bit)}. + \endif + A plugin should behave differently depending on whether it is run by the emulation layer or an application. For example, animations should not be run - in the Design mode. You can use the value of the QML_PUPPET_MODE + in the Design mode. You can use the value of the \c QML_PUPPET_MODE environment variable to check whether the plugin is currently being run by an application or edited in the Design mode. If you want to use a different module in the Design mode than in your actual application for example to mockup C++ items, then you can use \c{QML_DESIGNER_IMPORT_PATH} in the \c{.pro} file (for qmake projects), or declare and set the property - qmlDesignerImportPaths in your product (for Qbs projects). + \c qmlDesignerImportPaths in your product (for Qbs projects). Modules in the import paths defined in \c{QML_DESIGNER_IMPORT_PATH} will be used only in the Design mode. For an example, see \l {Qt Quick Controls - Contact List}. diff --git a/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc b/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc index 43eb353ace0..fc9e959d066 100644 --- a/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc @@ -30,37 +30,38 @@ \title Managing Item Hierarchy - The \uicontrol Navigator displays the items in the current QML file and + The \uicontrol Navigator view displays the items in the current QML file and their relationships. Items (1) are listed in a tree structure, below their - parent (2). + parent (2). You can preview items by hovering the mouse over them (3). - \image qmldesigner-navigator.png "Navigator" + \image qmldesigner-navigator.png "Navigator with item preview" - You can select items in the \uicontrol Navigator to edit their properties - in the \uicontrol Properties view. Items can access the properties of their - parent item. To select items in the \uicontrol {Form Editor}, right-click - an item, and select another type in the context menu. + You can select items in the \uicontrol Navigator view to edit their + properties in the \uicontrol Properties view. Items can access the + properties of their parent item. To select items in the + \uicontrol {Form Editor} view, right-click an item, and select another + item in the \uicontrol Selection submenu. - Typically, child items are located within the parent item in the + Typically, child items are located within the parent item in \uicontrol {Form Editor}. However, they do not necessarily have to fit inside the parent item. For example, you might want to make a - mouse area larger than the rectangle or image beneath it (1). + mouse area larger than the rectangle or image beneath it. \image qmldesigner-element-size.png "Mouse area for a button" When you copy an item, all its child items are also copied. When you remove an item, the child items are also removed. - Select context menu commands to reset item size, position, or anchors, - and to edit items colors or the annotations attached to it. To change - the source of an Image type, select \uicontrol {Change Source URL} in + Select context menu commands to apply commands to items. The availability + of the commands depends on the item type. For example, you can change + the source of an Image type by selecting \uicontrol {Change Source URL} in the context menu. \section1 Showing and Hiding Items - To show and hide items in the \uicontrol {Form Editor} when focusing on - specific parts of the application, click \inlineimage eye_open.png - in the \uicontrol Navigator. + To show and hide items in \uicontrol {Form Editor} when focusing on + specific parts of the application, click \inlineimage icons/visibilityon.png + in \uicontrol Navigator. To change the visibility of an item in the application code, select the \uicontrol Visibility check box in the \uicontrol Properties view or select @@ -72,32 +73,68 @@ As all properties, visibility and opacity are inherited from the parent item. To hide or show child items, edit the properties of the parent item. - To hide invisible items in the \uicontrol Navigator, click + To hide invisible items in \uicontrol Navigator, click \inlineimage filtericon.png (\uicontrol {Filter Tree}) and select \uicontrol {Show only visible items}. - \section1 Setting the Stacking Order + \section1 Locking Items - The \c z property of an \l Item determines its position in relation to its - sibling items in the type hierarchy. By default, items with a higher - stacking value are drawn on top of siblings with a lower stacking value. - Items with the same stacking value are drawn in the order they are listed, - from the last item up. + When designing complex applications, it is easy to accidentally modify + the properties of an item in one of the \QC views in ways that lead to + surprising results. For example, \uicontrol {Form Editor} can become + crowded and other items can get in the way when you are trying to select + or transform a particular item, so that you end up transforming more + items than you wanted to. - To move an item to the front or back of all its siblings, right-click it in - the \uicontrol Navigator or \uicontrol {Form Editor} and select - \uicontrol {Stack (z)} > \uicontrol {To Front} or \uicontrol {To Back}. - To raise or lower the stack value of an item, select \uicontrol Raise - or \uicontrol Lower. To remove the \c z property, select - \uicontrol {Reset z Property}. + To lock items that you are not currently editing and their children, + click \inlineimage icons/lockon.png + in \uicontrol Navigator. Locked items cannot be handled in any \QC views. + You can unlock the items when you want to edit them again. - You can also use a \uicontrol StackLayout item (Qt Quick Controls) to - create a stacked view. For more information, see \l {Using Layouts}. + \image qtquick-designer-navigator-lock.gif "Locking items in Navigator" - \section1 Switching Parent Items + You cannot select locked items in \uicontrol {Form Editor} or + \uicontrol {3D Editor} nor access their properties in + \uicontrol Properties. - When you drag and drop instances of QML types to the - \uicontrol {Form Editor}, the new item is added as a child of the item + If you attempt to \l{Adding States}{remove a state} that changes the + properties of a locked item, you are prompted to confirm the removal. + + If you have \l{Editing Animation Curves}{added easing curves} to keyframe + animations, you can lock and unlock them in the \uicontrol {Curve Editor} + view. If you lock the items that contain the easing curves, the lock status + is synchronized between \uicontrol Navigator and \uicontrol {Curve Editor}. + + \section1 Arranging Items + + You can view the order of items in a QML file in \uicontrol Navigator + and \uicontrol {Text Editor}. The order of items in the file also + determines the order in which they are drawn in \uicontrol {Form Editor}. + By default, items that are located at the top of the file are listed at + the bottom of the \uicontrol Navigator tree and behind overlapping items + in \uicontrol {Form Editor}. To list the items in the order in which they + appear in the file, as some other tools do, click \inlineimage filtericon.png + (\uicontrol {Filter Tree}), and select \uicontrol {Reverse item order}. + + To move an item to the top or bottom of the tree within its parent, + right-click it in \uicontrol Navigator or \uicontrol {Form Editor} + and select \uicontrol Arrange > \uicontrol {Bring to Front} or + \uicontrol {Send to Back}. To move an item up or down, select + \uicontrol {Bring Forward} or \uicontrol {Send Backward}. + + To reverse the order of the selected items in \uicontrol Navigator and + \uicontrol {Text Editor}, select \uicontrol Arrange > \uicontrol Reverse. + + \image qtquick-designer-navigator-arrange.gif "Reversing item order" + + You can also drag and drop the item to another position in the tree or use + the arrow buttons to move the item in the tree. You can use the left and + right arrow buttons to change the parent of the item. + + \image qmldesigner-navigator-arrows.png "Navigator buttons" + + When you drag and drop instances of QML types to \uicontrol {Form Editor}, + the new item is added as a child of the item beneath it. When you move the items, it is not possible to determine whether you want to adjust their position or attach them to a new parent item. Therefore, the parent item is not automatically changed. To change the @@ -105,9 +142,5 @@ the item into a new position. The topmost item under the cursor becomes the new parent of the item. - You can change the parent of an item also in the \uicontrol Navigator. - Drag and drop the item to another position in the tree or use the arrow - buttons (1) to move the item in the tree. - - \image qmldesigner-navigator-arrows.png "Navigator arrow buttons" + \include qtquick-component-context-menu.qdocinc context-menu */ diff --git a/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc b/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc index 0f88acbae91..757d03d4e67 100644 --- a/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc @@ -111,7 +111,7 @@ \image qmldesigner-anchor-buttons.png "Anchor buttons" - For convenience, you can click the \inlineimage anchor-fill.png + For convenience, you can click the \inlineimage icons/anchor-fill.png (\uicontrol {Fill to Parent}) toolbar button to apply fill anchors to an item and the \inlineimage qtcreator-anchors-reset-icon.png (\uicontrol {Reset Anchors}) button to reset the anchors to their saved @@ -205,7 +205,7 @@ You can set the space between objects in pixels. You can disable the distribution of spacing in pixels by clicking - the \inlineimage qmldesigner-distribute-spacing-x.png + the \inlineimage icons/distribute-origin-none.png button. \section2 Using Positioners diff --git a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc index 5b69fc310ec..38e05fa4619 100644 --- a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc @@ -303,14 +303,13 @@ The z position of an item determines its position in relation to its sibling items in the type hierarchy. You can set it in the \uicontrol Z - field in the \uicontrol Advanced tab. However, you would typically set - it in \uicontrol Navigator by \l{Setting the Stacking Order} - {setting the stacking order} of items. + field in the \uicontrol Advanced tab. In the \uicontrol Size group, you can set the width and height of - an item. You can also use selection handles to \l{Resizing Items} - {resize items} in \uicontrol {Form Editor}. The values in the - \uicontrol X and \uicontrol Y fields change accordingly. + an item. You can also use the resize cursor to \l{Resizing 2D Items} + {resize 2D items} in \uicontrol {Form Editor} or the scaling gizmo + to \l{Scaling Items}{scale 3D items} in \uicontrol {3D Editor}. The + values in the \uicontrol X and \uicontrol Y fields change accordingly. The item size and position can also be managed automatically when \l{Using Layouts}{using layouts}. diff --git a/doc/qtcreator/src/qtquick/qtquick-states.qdoc b/doc/qtcreator/src/qtquick/qtquick-states.qdoc index 099adb72e20..5e17e6f7083 100644 --- a/doc/qtcreator/src/qtquick/qtquick-states.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-states.qdoc @@ -83,6 +83,10 @@ \image qmldesigner-states.png "States and Properties views" + \note If you have \l{Locking Items}{locked an item} in \uicontrol Navigator, + and you attempt to remove states where you change the values of its + properties, you are prompted to confirm the removal. + \section1 Setting the Default State To determine the startup state of the application, @@ -121,68 +125,7 @@ \l{Completing Code}{code completion} feature lists the components and their properties you can use in the expressions. - \section2 Summary of Logical Operators - - You can use the following - \l{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators} - {logical operators} in the expressions to combine several conditions in one - expression: - - \table - \header - \li Operator - \li Meaning - \li Evaluates to \c true if - \row - \li ! - \li NOT - \li The condition is not met. - \row - \li && - \li AND - \li Both conditions are met. - \row - \li || - \li OR - \li Either of the conditions is met. - \row - \li < - \li Less than - \li The left operand is less than the right operand. - \row - \li > - \li Greater than - \li The left operand is greater than the right operand. - \row - \li >= - \li Greater than or equal - \li The left operand is greater than or equal to the right operand. - \row - \li <= - \li Less than or equal - \li The left operand is less than or equal to the right operand. - \row - \li == - \li Equal - \li The operands are equal. - \row - \li === - \li Strict equal - \li The operands are equal and of the same type. - \row - \li != - \li Not equal - \li The operands are not equal. - \row - \li !== - \li Strict not equal - \li The operands are of the same type but not equal, or are of - different type. - \endtable - - In addition, you can use arithmetic operators to compare numbers before - checks. However, we recommend that you create separate properties for this - purpose whenever possible. + \include creator-logical-operators.qdocinc logical operators \section2 Examples of when Conditions @@ -193,6 +136,11 @@ when: control.pressed \endcode + To apply a state when the button is not pressed, select the \uicontrol NOT + check box. + + \image qtquick-states-binding-editor-not.png "NOT check box in Binding Editor" + To apply a state when the button is not pressed, selected, nor hovered on, you could combine conditions, as follows: diff --git a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc index 15b18fe49cf..01450455aa3 100644 --- a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc @@ -244,7 +244,7 @@ timeline are \e linear, which means that they move from the beginning to the end at a constant speed. You can use the \uicontrol {Easing Curve Editor} to edit the easing curve between two keyframes. You can also use the more - advanced \uicontrol {Animation Curve Editor} to edit the curves for the whole + advanced \uicontrol {Curve Editor} to edit the curves for the whole animation. \section2 Attaching Easing Curves to Keyframes @@ -284,7 +284,7 @@ To customize easing curves: \list 1 - \li In the \uicontrol {Easing Curve Editor}, select an easing curve in + \li In \uicontrol {Easing Curve Editor}, select an easing curve in the \uicontrol Presets tab. \li Drag the curve handlers to modify the curve. \li Right-click in the editor, and select \uicontrol {Add Point} to add @@ -298,28 +298,30 @@ \uicontrol Custom tab. \endlist - To paste easing curve definitions to the easing curve editor as text, select - the \uicontrol Text tab. + To paste easing curve definitions to \uicontrol {Easing Curve Editor} as + text, select the \uicontrol Text tab. \section1 Editing Animation Curves - In the animation curve editor, you can view and modify the whole animation - curve. You - can insert keyframes to the curve and drag them and the point handlers to - modify the curve. You can modify the appearance of the curve in the style - editor. + In \uicontrol {Curve Editor}, you can view and modify the whole animation + curve. You can insert keyframes to the curve and drag them and the point + handlers to modify the curve. You can modify the appearance of the curve + in the style editor. - You can also edit easing curves that you added with the easing curve editor. + You can also edit easing curves that you added in + \uicontrol {Easing Curve Editor}. If the item that + contains the easing curves has been locked in + \uicontrol Navigator, you can select \inlineimage icons/lockon.png + to unlock it. You can also lock individual easing curves for editing. - \image studio-curve-editor.png "Animation Curve Editor" + \image studio-curve-editor.png "Curve Editor" To edit animation curves: \list 1 \li In the \uicontrol Timeline view, insert at least one keyframe. - \li Select \inlineimage curveGraphIcon.png - (\uicontrol {Animation Curve Editor}) on the toolbar or press \key C - to open the animation curve editor. + \li Select \uicontrol View > \uicontrol Views > + \uicontrol {Curve Editor} to open the animation curve editor. \li Right-click in the animation curve editor, and select \uicontrol {Insert Keyframe} to add a keyframe. \li Select keyframes to display the easing curves attached to them. @@ -330,7 +332,7 @@ list, and then select the pin icon. \endlist - Your changes are automatically saved when you close the editor. + Your changes are automatically saved when you close the view. \section1 Rotating Items diff --git a/doc/qtdesignstudio/examples/doc/loginui2.qdoc b/doc/qtdesignstudio/examples/doc/loginui2.qdoc index 153c45d4c1f..58bb5d2cbd6 100644 --- a/doc/qtdesignstudio/examples/doc/loginui2.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui2.qdoc @@ -72,12 +72,12 @@ \li Open \e {Screen01.ui.qml} for editing in the \uicontrol {Form Editor} view. \li Select \e logo in \uicontrol Navigator. - \li Select the \inlineimage anchor-top.png - (\uicontrol Top) and \inlineimage anchor-left.png + \li Select the \inlineimage icons/anchor-top.png + (\uicontrol Top) and \inlineimage icons/anchor-left.png (\uicontrol Left) anchor buttons to anchor \e logo to the top left corner of its parent with 10-pixel margins. \li Select \e pageTitle in \uicontrol Navigator. - \li Deselect the \inlineimage anchor-vertical-center.png + \li Deselect the \inlineimage icons/anchor-center-vertical.png (\uicontrol {Vertical Center}) button to remove the anchor, and then select the \uicontrol Top button to anchor the title to the top of the page with a 70-pixel margin. @@ -167,12 +167,12 @@ \li In \uicontrol Properties > \uicontrol Layout, select the \uicontrol Top button to anchor the top of the button column to the top of its parent with a 200-pixel margin. - \li Select the \inlineimage anchor-horizontal-center.png + \li Select the \inlineimage icons/anchor-center-horizontal.png (\uicontrol {Horizontal Center}) button to center the field column horizontally on the page. \li Select \e buttonColumn in \uicontrol Navigator. \li In \uicontrol Properties > \uicontrol Layout, select the - \inlineimage anchor-bottom.png + \inlineimage icons/anchor-bottom.png (\uicontrol Bottom) button to anchor the bottom of the button column to the bottom of its parent with a 50-pixel margin. \li Select the \uicontrol {Horizontal Center} button to center diff --git a/doc/qtdesignstudio/examples/doc/loginui3.qdoc b/doc/qtdesignstudio/examples/doc/loginui3.qdoc index 3eea3b672e5..a0bc1d2294f 100644 --- a/doc/qtdesignstudio/examples/doc/loginui3.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui3.qdoc @@ -92,8 +92,8 @@ \li In the \uicontrol Text field, enter \e <. \li In the \uicontrol Font group, \uicontrol Size field, set the font size to \e 24 pixels. - \li Under \uicontrol Layout, select the \inlineimage anchor-top.png - (\uicontrol Top) and \inlineimage anchor-right.png + \li Under \uicontrol Layout, select the \inlineimage icons/anchor-top.png + (\uicontrol Top) and \inlineimage icons/anchor-right.png (\uicontrol Right) anchor buttons to anchor \e backButton to the top right corner of its parent with 20- and 10-pixel margins, respectively. diff --git a/doc/qtdesignstudio/examples/doc/loginui4.qdoc b/doc/qtdesignstudio/examples/doc/loginui4.qdoc index ba79c6c7a54..280def1382c 100644 --- a/doc/qtdesignstudio/examples/doc/loginui4.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui4.qdoc @@ -92,11 +92,11 @@ \key Delete to delete it. \li Select \e usernameField in \uicontrol Navigator. \li In \uicontrol Properties > \uicontrol Layout, select the - \inlineimage anchor-top.png + \inlineimage icons/anchor-top.png (\uicontrol Top) button to anchor the top of the field to the top of its parent. \QDS will suggest an appropriate margin based on the current position of the field on the y axis, 200 pixels. - \li Select the \inlineimage anchor-horizontal-center.png + \li Select the \inlineimage icons/anchor-center-horizontal.png (\uicontrol {Horizontal Center}) button to anchor the horizontal center of the field to that of its parent. \li Select \e passwordField, and then select the \uicontrol Top diff --git a/doc/qtdesignstudio/images/icon-event-list.png b/doc/qtdesignstudio/images/icon-event-list.png deleted file mode 100644 index b4d2849460d..00000000000 Binary files a/doc/qtdesignstudio/images/icon-event-list.png and /dev/null differ diff --git a/doc/qtdesignstudio/images/icons/edit.png b/doc/qtdesignstudio/images/icons/edit.png new file mode 100644 index 00000000000..ea56a63155b Binary files /dev/null and b/doc/qtdesignstudio/images/icons/edit.png differ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-app-flows.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-app-flows.qdoc index 4cb8664dc3c..19898c24902 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-app-flows.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-app-flows.qdoc @@ -204,7 +204,7 @@ \li In \uicontrol Navigator, select the \uicontrol EventListSimulator type, and then select the \uicontrol Active check box in \uicontrol Properties to activate the event simulator. - \li Select the \inlineimage icon-event-list.png + \li Select the \inlineimage icons/edit.png (\uicontrol {Show Event List}) button on the Design mode toolbar, or press \key {Alt+E}. \image studio-flow-event-list.png "Event List Dialog" diff --git a/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc index ae1c7147a12..ac9da974358 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc @@ -43,6 +43,10 @@ \li Windows 10 \endlist + \note For a good user experience on Windows 10, we recommend the following + minimum hardware and software: Intel Core i7 with 8GB of RAM and integrated + Intel Graphics. + \section1 Design Tools \QB is available for the following design tools: diff --git a/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc index 109b40d37e8..c32d5baaa52 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc @@ -52,5 +52,9 @@ Use the Simulink connector to connect a Simulink Simulation Model to your UI. Simulink is a MATLAB-based graphical programming environment for modeling, simulating, and analyzing multi-domain dynamic systems. + + \li \l{Using QML Modules with Plugins} + + You can load C++ plugins for QML to simulate data. \endlist */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc index 4bed1e63cb5..6e059278b7d 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc @@ -26,7 +26,7 @@ /*! \previouspage studio-javascript.html \page studio-simulink.html - \nextpage studio-debugging.html + \nextpage creator-qml-modules-with-plugins.html \title Simulating Dynamic Systems diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index fbfdb038294..52ad03e04d1 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -170,6 +170,7 @@ \li \l{Loading Placeholder Data} \li \l{Simulating Application Logic} \li \l{Simulating Dynamic Systems} + \li \l{Using QML Modules with Plugins} \endlist \li \l{Debugging and Profiling} \list diff --git a/qbs/modules/libclang/functions.js b/qbs/modules/libclang/functions.js index dd9dc1bb096..77690ab47a9 100644 --- a/qbs/modules/libclang/functions.js +++ b/qbs/modules/libclang/functions.js @@ -38,7 +38,7 @@ function llvmConfig(hostOS, qtcFunctions) var llvmInstallDirFromEnv = Environment.getEnv("LLVM_INSTALL_DIR") var llvmConfigVariants = [ // CLANG-UPGRADE-CHECK: Adapt once we require a new minimum version. - "llvm-config", "llvm-config-8", "llvm-config-9", "llvm-config-10", "llvm-config-11", "llvm-config-12" + "llvm-config", "llvm-config-11", "llvm-config-10", "llvm-config-9" ]; // Prefer llvm-config* from LLVM_INSTALL_DIR diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 9a3cb062a8e..395258316aa 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,16 +4,16 @@ import qbs.FileInfo import "qtc.js" as HelperFunctions Module { - property string qtcreator_display_version: '4.14.0-beta2' + property string qtcreator_display_version: '4.14.0-rc1' property string ide_version_major: '4' property string ide_version_minor: '13' - property string ide_version_release: '83' + property string ide_version_release: '84' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '4' property string ide_compat_version_minor: '13' - property string ide_compat_version_release: '83' + property string ide_compat_version_release: '84' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release diff --git a/qtcreator_ide_branding.pri b/qtcreator_ide_branding.pri index 0ee14a4c17a..adcd8adf219 100644 --- a/qtcreator_ide_branding.pri +++ b/qtcreator_ide_branding.pri @@ -1,6 +1,6 @@ -QTCREATOR_VERSION = 4.13.83 -QTCREATOR_COMPAT_VERSION = 4.13.83 -QTCREATOR_DISPLAY_VERSION = 4.14.0-beta2 +QTCREATOR_VERSION = 4.13.84 +QTCREATOR_COMPAT_VERSION = 4.13.84 +QTCREATOR_DISPLAY_VERSION = 4.14.0-rc1 QTCREATOR_COPYRIGHT_YEAR = 2020 IDE_DISPLAY_NAME = Qt Creator diff --git a/scripts/build.py b/scripts/build.py index 5a0ad996078..c4b2e36cc7e 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -174,6 +174,9 @@ def build_qtcreator(args, paths): common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--strip'], paths.build) + common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, + '--component', 'Dependencies'], + paths.build) common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install, '--component', 'Devel'], paths.build) @@ -215,32 +218,6 @@ def build_qtcreatorcdbext(args, paths): '--component', 'qtcreatorcdbext'], paths.build) -def deploy_qt(args, paths): - if common.is_mac_platform(): - script = os.path.join(paths.src, 'scripts', 'deployqtHelper_mac.sh') - app = os.path.join(paths.install, args.app_target) - # TODO this is wrong if Qt is set up non-standard - # TODO integrate deployqtHelper_mac.sh into deployqt.py, finally - qt_bins = os.path.join(paths.qt, 'bin') - qt_translations = os.path.join(paths.qt, 'translations') - qt_plugins = os.path.join(paths.qt, 'plugins') - qt_qml = os.path.join(paths.qt, 'qml') - env = dict(os.environ) - if paths.llvm: - env['LLVM_INSTALL_DIR'] = paths.llvm - common.check_print_call([script, app, qt_bins, qt_translations, qt_plugins, qt_qml], - paths.build, - env=env) - else: - cmd_args = ['python', '-u', os.path.join(paths.src, 'scripts', 'deployqt.py'), '-i'] - if paths.elfutils: - cmd_args.extend(['--elfutils-path', paths.elfutils]) - if paths.llvm: - cmd_args.extend(['--llvm-path', paths.llvm]) - exe = os.path.join(paths.install, 'bin', args.app_target) - common.check_print_call(cmd_args + [exe, os.path.join(paths.qt, 'bin', 'qmake')], - paths.build) - def package_qtcreator(args, paths): if not args.no_zip: common.check_print_call(['7z', 'a', '-mmt2', @@ -306,7 +283,6 @@ def main(): build_qtcreator(args, paths) build_wininterrupt(args, paths) build_qtcreatorcdbext(args, paths) - deploy_qt(args, paths) package_qtcreator(args, paths) if __name__ == '__main__': diff --git a/scripts/common.py b/scripts/common.py index df025cf839e..7b7936a8add 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -30,6 +30,8 @@ import subprocess import sys encoding = locale.getdefaultlocale()[1] +if not encoding: + encoding = 'UTF-8' def is_windows_platform(): return sys.platform.startswith('win') @@ -46,11 +48,11 @@ def to_posix_path(path): return path.replace('\\', '/') return path -def check_print_call(command, workdir, env=None): +def check_print_call(command, workdir=None, env=None): print('------------------------------------------') print('COMMAND:') print(' '.join(['"' + c.replace('"', '\\"') + '"' for c in command])) - print('PWD: "' + workdir + '"') + print('PWD: "' + (workdir if workdir else os.getcwd()) + '"') print('------------------------------------------') subprocess.check_call(command, cwd=workdir, env=env) diff --git a/scripts/deployqt.py b/scripts/deployqt.py index e0c8c7cdf52..45bacd674e1 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -28,6 +28,7 @@ ################################################################################ import argparse +import collections import os import locale import sys @@ -51,15 +52,22 @@ def get_args(): parser.add_argument('--llvm-path', help='Path to LLVM installation', default=os.environ.get('LLVM_INSTALL_DIR')) - parser.add_argument('qtcreator_binary', help='Path to Qt Creator binary') + parser.add_argument('qtcreator_binary', help='Path to Qt Creator binary (or the app bundle on macOS)') parser.add_argument('qmake_binary', help='Path to qmake binary') args = parser.parse_args() args.qtcreator_binary = os.path.abspath(args.qtcreator_binary) - if common.is_windows_platform() and not args.qtcreator_binary.lower().endswith(".exe"): - args.qtcreator_binary = args.qtcreator_binary + ".exe" - if not os.path.isfile(args.qtcreator_binary): + if common.is_mac_platform(): + if not args.qtcreator_binary.lower().endswith(".app"): + args.qtcreator_binary = args.qtcreator_binary + ".app" + check = os.path.isdir + else: + check = os.path.isfile + if common.is_windows_platform() and not args.qtcreator_binary.lower().endswith(".exe"): + args.qtcreator_binary = args.qtcreator_binary + ".exe" + + if not check(args.qtcreator_binary): print('Cannot find Qt Creator binary.') sys.exit(1) @@ -333,8 +341,37 @@ def deploy_elfutils(qtc_install_dir, chrpath_bin, args): print(file, '->', backends_install_path) shutil.copy(file, backends_install_path) +def deploy_mac(args): + (_, qt_install) = get_qt_install_info(args.qmake_binary) + + env = dict(os.environ) + if args.llvm_path: + env['LLVM_INSTALL_DIR'] = args.llvm_path + + script_path = os.path.dirname(os.path.realpath(__file__)) + deployqtHelper_mac = os.path.join(script_path, 'deployqtHelper_mac.sh') + common.check_print_call([deployqtHelper_mac, args.qtcreator_binary, qt_install.bin, + qt_install.translations, qt_install.plugins, qt_install.qml], + env=env) + +def get_qt_install_info(qmake_binary): + qt_install_info = common.get_qt_install_info(qmake_binary) + QtInstallInfo = collections.namedtuple('QtInstallInfo', ['bin', 'lib', 'plugins', + 'qml', 'translations']) + return (qt_install_info, + QtInstallInfo(bin=qt_install_info['QT_INSTALL_BINS'], + lib=qt_install_info['QT_INSTALL_LIBS'], + plugins=qt_install_info['QT_INSTALL_PLUGINS'], + qml=qt_install_info['QT_INSTALL_QML'], + translations=qt_install_info['QT_INSTALL_TRANSLATIONS'])) + def main(): args = get_args() + if common.is_mac_platform(): + deploy_mac(args) + return + + (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary) qtcreator_binary_path = os.path.dirname(args.qtcreator_binary) install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) @@ -350,13 +387,6 @@ def main(): print("Cannot find required binary 'chrpath'.") sys.exit(2) - qt_install_info = common.get_qt_install_info(args.qmake_binary) - QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] - QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] - QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] - QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML'] - QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS'] - plugins = ['assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', 'xcbglintegrations', @@ -370,10 +400,10 @@ def main(): debug_build = is_debug(args.qtcreator_binary) if common.is_windows_platform(): - copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_QML, plugins) + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin, qt_install.plugins, qt_install.qml, plugins) else: - copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_QML, plugins) - copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib, qt_install.plugins, qt_install.qml, plugins) + copy_translations(install_dir, qt_install.translations) if args.llvm_path: deploy_libclang(install_dir, args.llvm_path, chrpath_bin) @@ -387,8 +417,4 @@ def main(): add_qt_conf(os.path.join(install_dir, 'bin'), qt_deploy_prefix) if __name__ == "__main__": - if common.is_mac_platform(): - print("macOS is not supported by this script, please use macqtdeploy!") - sys.exit(2) - else: - main() + main() diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 9b31a542899..7bde6b5b56f 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -682,8 +682,16 @@ class DumperBase(): self.putValue(data, 'latin1', elided=elided) def encodeString(self, value, limit=0): - elided, data = self.encodeStringHelper(self.extractPointer(value), limit) - return data + if self.qtVersion() >= 0x60000: + dd, ptr, size = self.split('ppi', value) + if not dd: + return "" + elided, shown = self.computeLimit(2 * size, 2 * self.displayStringLimit) + data = self.readMemory(ptr, shown) + return data + else: + elided, data = self.encodeStringHelper(self.extractPointer(value), limit) + return data def encodedUtf16ToUtf8(self, s): return ''.join([chr(int(s[i:i + 2], 16)) for i in range(0, len(s), 4)]) @@ -691,8 +699,16 @@ class DumperBase(): def encodeStringUtf8(self, value, limit=0): return self.encodedUtf16ToUtf8(self.encodeString(value, limit)) - def stringData(self, value): - return self.byteArrayDataHelper(self.extractPointer(value)) + def stringData(self, value): # -> (data, size, alloc) + if self.qtVersion() >= 0x60000: + dd, data, size = value.split('ppi') + if dd: + alloc, i, i = self.split('Pii', dd) + else: # fromRawData + alloc = size + return data, size, alloc + else: + return self.byteArrayDataHelper(self.extractPointer(value)) def extractTemplateArgument(self, typename, position): level = 0 @@ -728,9 +744,15 @@ class DumperBase(): return inner def putStringValue(self, value): - addr = self.extractPointer(value) - elided, data = self.encodeStringHelper(addr, self.displayStringLimit) - self.putValue(data, 'utf16', elided=elided) + if self.qtVersion() >= 0x60000: + dd, ptr, size = self.split('ppi', value) + elided, shown = self.computeLimit(2 * size, 2 * self.displayStringLimit) + data = self.readMemory(ptr, shown) + self.putValue(data, 'utf16', elided=elided) + else: + addr = self.extractPointer(value) + elided, data = self.encodeStringHelper(addr, self.displayStringLimit) + self.putValue(data, 'utf16', elided=elided) def putPtrItem(self, name, value): with SubItem(self, name): diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index d45721bd9e1..20f51a831b2 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -815,6 +815,12 @@ def qdump__QVariantHash(d, value): def qdumpHelper_QHash(d, value, keyType, valueType): + if d.qtVersion() >= 0x60000: + qdumpHelper_QHash_6(d, value, keyType, valueType) + else: + qdumpHelper_QHash_5(d, value, keyType, valueType) + +def qdumpHelper_QHash_5(d, value, keyType, valueType): def hashDataFirstNode(): b = buckets n = numBuckets @@ -865,6 +871,45 @@ def qdumpHelper_QHash(d, value, keyType, valueType): node = hashDataNextNode(node) +def qdumpHelper_QHash_6(d, value, keyType, valueType): + dptr = d.extractPointer(value) + ref, _, size, buckets, seed, spans = d.split('i@qqqp', dptr) + + d.check(0 <= size and size <= 100 * 1000 * 1000) + d.check(-1 <= ref and ref < 100000) + #d.putValue("%d 0x%x 0x%x 0x%x" % (ref, size, buckets, seed)); + d.putItemCount(size) + + if d.isExpanded(): + type_code = '{%s}@{%s}' % (keyType.name, valueType.name) + _, entry_size, _ = d.describeStruct(type_code) + with Children(d, size): + span_size = 128 + 2 * d.ptrSize() # Including tail padding. + nspans = int((buckets + 127) / 128) + count = 0 + for b in range(nspans): + span = spans + b * span_size + offsets, entries, allocated, next_free = d.split('128spbb', span) + #with SubItem(d, 'span %d' % b): + # d.putValue('span: 0x%x %s alloc: %s next: %s' + # % (span, d.hexencode(offsets), allocated, next_free)) + entry_pos = 0 + for i in range(128): + offset = offsets[i] + #with SubItem(d, 'offset %i' % i): + # d.putValue('i: %s off: %s' % (i, offset)) + if offset != 255: # Entry is used + entry = entries + offset * entry_size + key, _, val = d.split(type_code, entry) + #with SubItem(d, 'count %d entry %d' % (count, i)): + # d.putValue('i: %s entry: 0x%x' % (i, entry)) + d.putPairItem(count, (key, val), 'key', 'value') + count += 1 + entry_pos += 1 + #with SubItem(d, 'total'): + # d.putValue('total: %s item size: %s' % (count, entry_size)) + + def qform__QHashNode(): return [DisplayFormat.CompactMap] @@ -1044,21 +1089,24 @@ def qform__QImage(): def qdump__QImage(d, value): - if d.qtVersion() < 0x050000: - (vtbl, painters, imageData) = value.split('ppp') + if d.qtVersion() >= 0x060000: + vtbl, painters, image_data = value.split('ppp') + elif d.qtVersion() >= 0x050000: + vtbl, painters, reserved, image_data = value.split('pppp') else: - (vtbl, painters, reserved, imageData) = value.split('pppp') + vtbl, painters, image_data = value.split('ppp') - if imageData == 0: + if image_data == 0: d.putValue('(invalid)') return - (ref, width, height, depth, nbytes, padding, devicePixelRatio, colorTable, - bits, iformat) = d.split('iiiii@dppi', imageData) - + ref, width, height = d.split('iii', image_data) d.putValue('(%dx%d)' % (width, height)) + d.putExpandable() if d.isExpanded(): + (ref, width, height, depth, nbytes, pad, devicePixelRatio, colorTable, + bits, iformat) = d.split('iiiii@dppi', image_data) with Children(d): d.putIntItem('width', width) d.putIntItem('height', height) @@ -1320,15 +1368,19 @@ def qdump__QProcEnvKey(d, value): def qdump__QPixmap(d, value): - if d.qtVersion() < 0x050000: - (vtbl, painters, dataPtr) = value.split('ppp') + if d.qtVersion() >= 0x060000: + vtbl, painters, data = value.split('ppp') + elif d.qtVersion() >= 0x050000: + vtbl, painters, reserved, data = s = d.split('pppp', value) else: - (vtbl, painters, reserved, dataPtr) = s = d.split('pppp', value) - if dataPtr == 0: + vtbl, painters, data = value.split('ppp') + + if data == 0: d.putValue('(invalid)') else: - (dummy, width, height) = d.split('pii', dataPtr) + _, width, height = d.split('pii', data) d.putValue('(%dx%d)' % (width, height)) + d.putPlainChildren(value) @@ -1381,28 +1433,32 @@ def qdump__QRegExp(d, value): def qdump__QRegion(d, value): - regionDataPtr = d.extractPointer(value) - if regionDataPtr == 0: + d_ptr = d.extractPointer(value) + if d_ptr == 0: d.putSpecialValue('empty') else: - if d.qtVersion() >= 0x050400: # Padding removed in ee324e4ed - (ref, pad, rgn) = d.split('i@p', regionDataPtr) - (numRects, innerArea, rects, extents, innerRect) = \ - d.split('iiP{QRect}{QRect}', rgn) + if d.qtVersion() >= 0x060000: + ref, _, rgn = d.split('i@p', d_ptr) + numRects, innerArea, rects, extents, innerRect = \ + d.split('ii{QList}{QRect}{QRect}', rgn) + elif d.qtVersion() >= 0x050400: # Padding removed in ee324e4ed + ref, _, rgn = d.split('i@p', d_ptr) + numRects, innerArea, rects, extents, innerRect = \ + d.split('ii{QVector}{QRect}{QRect}', rgn) elif d.qtVersion() >= 0x050000: - (ref, pad, rgn) = d.split('i@p', regionDataPtr) - (numRects, pad, rects, extents, innerRect, innerArea) = \ - d.split('i@P{QRect}{QRect}i', rgn) + ref, _, rgn = d.split('i@p', d_ptr) + numRects, _, rects, extents, innerRect, innerArea = \ + d.split('i@{QVector}{QRect}{QRect}i', rgn) else: if d.isWindowsTarget(): - (ref, pad, rgn) = d.split('i@p', regionDataPtr) + ref, _, rgn = d.split('i@p', d_ptr) else: - (ref, pad, xrgn, xrectangles, rgn) = d.split('i@ppp', regionDataPtr) + ref, _, xrgn, xrectangles, rgn = d.split('i@ppp', d_ptr) if rgn == 0: numRects = 0 else: - (numRects, pad, rects, extents, innerRect, innerArea) = \ - d.split('i@P{QRect}{QRect}i', rgn) + numRects, _, rects, extents, innerRect, innerArea = \ + d.split('i@{QVector}{QRect}{QRect}i', rgn) d.putItemCount(numRects) if d.isExpanded(): @@ -1411,7 +1467,7 @@ def qdump__QRegion(d, value): d.putIntItem('innerArea', innerArea) d.putSubItem('extents', extents) d.putSubItem('innerRect', innerRect) - d.putSubItem('rects', d.createVectorItem(rects, d.qtNamespace() + 'QRect')) + d.putSubItem('rects', rects) def qdump__QScopedPointer(d, value): @@ -1585,18 +1641,8 @@ def qform__QString(): def qdump__QString(d, value): - if d.qtVersion() >= 0x60000: - dd, data, size = value.split('ppi') - if dd: - _, _, alloc = d.split('iii', dd) - else: # fromRawData - alloc = size - elided, shown = d.computeLimit(2 * size, 2 * d.displayStringLimit) - p = d.readMemory(data, shown) - d.putValue(p, 'utf16', elided=elided) - else: - d.putStringValue(value) - (data, size, alloc) = d.stringData(value) + d.putStringValue(value) + data, size, _ = d.stringData(value) displayFormat = d.currentItemFormat() if displayFormat == DisplayFormat.Separate: d.putDisplay('utf16:separate', d.encodeString(value, limit=100000)) @@ -2075,7 +2121,10 @@ if False: def qdump__QVarLengthArray(d, value): - (cap, size, data) = value.split('iip') + if d.qtVersion() >= 0x060000: + cap, size, data = value.split('QQp') + else: + cap, size, data = value.split('iip') d.check(0 <= size) d.putItemCount(size) d.putPlotData(data, size, value.type[0]) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index b400d8c2d25..e9e6328ce9e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -412,6 +412,8 @@ QImage QuickItemNodeInstance::renderImage() const QSize size = renderBoundingRect.size().toSize(); static double devicePixelRatio = qgetenv("FORMEDITOR_DEVICE_PIXEL_RATIO").toDouble(); + if (size.width() * size.height() > 4000 * 4000) + size = QSize(0,0); size *= devicePixelRatio; QImage renderImage; diff --git a/src/libs/clangsupport/CMakeLists.txt b/src/libs/clangsupport/CMakeLists.txt index 7117066ac17..dcaa4647101 100644 --- a/src/libs/clangsupport/CMakeLists.txt +++ b/src/libs/clangsupport/CMakeLists.txt @@ -159,28 +159,5 @@ foreach(executable clang clang-cl clangd clang-tidy clazy-standalone) FILES "${LLVM_TOOLS_BINARY_DIR}/${executable}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "${IDE_LIBEXEC_PATH}/clang/bin/" ) - # For the install directory - install(PROGRAMS - "${LLVM_TOOLS_BINARY_DIR}/${executable}${CMAKE_EXECUTABLE_SUFFIX}" - DESTINATION "${IDE_LIBEXEC_PATH}/clang/bin" - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - if (IS_SYMLINK "${LLVM_TOOLS_BINARY_DIR}/${executable}${CMAKE_EXECUTABLE_SUFFIX}") - file(READ_SYMLINK - "${LLVM_TOOLS_BINARY_DIR}/${executable}${CMAKE_EXECUTABLE_SUFFIX}" real_executable) - install(PROGRAMS - "${LLVM_TOOLS_BINARY_DIR}/${real_executable}${CMAKE_EXECUTABLE_SUFFIX}" - DESTINATION "${IDE_LIBEXEC_PATH}/clang/bin" - COMPONENT Dependencies - EXCLUDE_FROM_ALL - ) - endif() endif() endforeach() - -install(DIRECTORY ${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}/include - DESTINATION "${IDE_LIBEXEC_PATH}/clang/lib/clang/${CLANG_VERSION}" - COMPONENT Dependencies - EXCLUDE_FROM_ALL -) diff --git a/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp index f7fd97106eb..141175515e1 100644 --- a/src/libs/qtcreatorcdbext/pytype.cpp +++ b/src/libs/qtcreatorcdbext/pytype.cpp @@ -426,6 +426,8 @@ PyType PyType::lookupType(const std::string &typeNameIn, ULONG64 module) typeName.erase(typeName.length() - 6); if (typeName == "__int64" || typeName == "unsigned __int64") typeName.erase(typeName.find("__"), 2); + if (typeName == "signed char") + typeName.erase(0, 7); const static std::regex typeNameRE("^[a-zA-Z_][a-zA-Z0-9_]*!?[a-zA-Z0-9_<>:, \\*\\&\\[\\]]*$"); if (!std::regex_match(typeName, typeNameRE)) diff --git a/src/libs/utils/process_stub_win.c b/src/libs/utils/process_stub_win.c index ba731e74065..128f3028dad 100644 --- a/src/libs/utils/process_stub_win.c +++ b/src/libs/utils/process_stub_win.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 4c33d6b5679..400d2b9bca4 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -895,13 +895,15 @@ void AndroidBuildApkStep::setBuildTargetSdk(const QString &sdk) void AndroidBuildApkStep::stdError(const QString &output) { AbstractProcessStep::stdError(output); - if (output == "\n") - return; - if (output.startsWith("warning", Qt::CaseInsensitive) || output.startsWith("note", Qt::CaseInsensitive)) - TaskHub::addTask(BuildSystemTask(Task::Warning, output)); + QString newOutput = output; + newOutput.remove(QRegularExpression("^(\\n)+")); + + if (newOutput.startsWith("warning", Qt::CaseInsensitive) + || newOutput.startsWith("note", Qt::CaseInsensitive)) + TaskHub::addTask(BuildSystemTask(Task::Warning, newOutput)); else - TaskHub::addTask(BuildSystemTask(Task::Error, output)); + TaskHub::addTask(BuildSystemTask(Task::Error, newOutput)); } QVariant AndroidBuildApkStep::data(Utils::Id id) const diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 3f23838e7ec..19990e149ee 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -552,13 +552,15 @@ void AndroidDeployQtStep::processReadyReadStdError(DeployErrorCode &errorCode) void AndroidDeployQtStep::stdError(const QString &line) { emit addOutput(line, BuildStep::OutputFormat::Stderr, BuildStep::DontAppendNewline); - if (line == "\n") - return; - if (line.startsWith("warning", Qt::CaseInsensitive) || line.startsWith("note", Qt::CaseInsensitive)) - TaskHub::addTask(DeploymentTask(Task::Warning, line)); + QString newOutput = line; + newOutput.remove(QRegularExpression("^(\\n)+")); + + if (newOutput.startsWith("warning", Qt::CaseInsensitive) + || newOutput.startsWith("note", Qt::CaseInsensitive)) + TaskHub::addTask(DeploymentTask(Task::Warning, newOutput)); else - TaskHub::addTask(DeploymentTask(Task::Error, line)); + TaskHub::addTask(DeploymentTask(Task::Error, newOutput)); } AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::parseDeployErrors(QString &deployOutputLine) const diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index db9b3408b2e..159fd00f9e6 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -855,8 +855,6 @@ void AndroidManifestEditorWidget::syncToWidgets(const QDomDocument &doc) setApiLevel(m_androidTargetSdkVersion, usesSdkElement, QLatin1String("android:targetSdkVersion")); } - QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath(); - QDomElement applicationElement = manifest.firstChildElement(QLatin1String("application")); m_appNameLineEdit->setText(applicationElement.attribute(QLatin1String("android:label"))); diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index cd3d07362ee..ac27b3b14c6 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -498,22 +499,45 @@ void AndroidRunnerWorker::setAndroidDeviceInfo(const AndroidDeviceInfo &info) << m_deviceSerialNumber << m_apiLevel; } -void AndroidRunnerWorker::asyncStartHelper() +void Android::Internal::AndroidRunnerWorker::asyncStartLogcat() { - forceStop(); - // Its assumed that the device or avd returned by selector() is online. // Start the logcat process before app starts. QTC_ASSERT(!m_adbLogcatProcess, /**/); - m_adbLogcatProcess.reset(AndroidManager::runAdbCommandDetached(selector() << "logcat")); - if (m_adbLogcatProcess) { - m_adbLogcatProcess->setObjectName("AdbLogcatProcess"); - connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardOutput, - this, &AndroidRunnerWorker::logcatReadStandardOutput); - connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardError, - this, &AndroidRunnerWorker::logcatReadStandardError); + + // Ideally AndroidManager::runAdbCommandDetached() should be used, but here + // we need to connect the readyRead signals from logcat otherwise we might + // lost some output between the process start and connecting those signals. + m_adbLogcatProcess.reset(new QProcess()); + + connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardOutput, + this, &AndroidRunnerWorker::logcatReadStandardOutput); + connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardError, + this, &AndroidRunnerWorker::logcatReadStandardError); + + // Get target current time to fetch only recent logs + QString dateInSeconds; + QStringList timeArg; + if (runAdb({"shell", "date", "+%s"}, &dateInSeconds)) { + timeArg << "-T"; + timeArg << QDateTime::fromSecsSinceEpoch(dateInSeconds.toInt()) + .toString("MM-dd hh:mm:ss.mmm"); } + const QStringList logcatArgs = selector() << "logcat" << timeArg; + const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString(); + qCDebug(androidRunWorkerLog) << "Running logcat command (async):" + << CommandLine(adb, logcatArgs).toUserOutput(); + m_adbLogcatProcess->start(adb, logcatArgs); + if (m_adbLogcatProcess->waitForStarted(500) && m_adbLogcatProcess->state() == QProcess::Running) + m_adbLogcatProcess->setObjectName("AdbLogcatProcess"); +} + +void AndroidRunnerWorker::asyncStartHelper() +{ + forceStop(); + asyncStartLogcat(); + for (const QString &entry : m_beforeStartAdbCommands) runAdb(entry.split(' ', Qt::SkipEmptyParts)); diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index 3a72a21b73b..68b9ca9c0ec 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -78,6 +78,7 @@ private: bool deviceFileExists(const QString &filePath); bool packageFileExists(const QString& filePath); bool uploadDebugServer(const QString &debugServerFileName); + void asyncStartLogcat(); enum class JDBState { Idle, diff --git a/src/plugins/android/avddialog.cpp b/src/plugins/android/avddialog.cpp index 3f8e687d449..42498b64675 100644 --- a/src/plugins/android/avddialog.cpp +++ b/src/plugins/android/avddialog.cpp @@ -146,7 +146,6 @@ void AvdDialog::parseDeviceDefinitionsList() if (line.startsWith("---------") || line.isEmpty()) { DeviceDefinitionStruct deviceDefinition; for (const QString &line : avdDeviceInfo) { - QString value; if (line.contains("id:")) { deviceDefinition.name_id = line.split("or").at(1); deviceDefinition.name_id = deviceDefinition.name_id.remove(0, 1).remove('"'); diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp index ddb7690bc04..bc8a3ec9ef5 100644 --- a/src/plugins/android/createandroidmanifestwizard.cpp +++ b/src/plugins/android/createandroidmanifestwizard.cpp @@ -182,8 +182,8 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard) if (wizard->copyGradle()) { auto checkBox = new QCheckBox(this); - checkBox->setChecked(false); connect(checkBox, &QCheckBox::toggled, wizard, &CreateAndroidManifestWizard::setCopyGradle); + checkBox->setChecked(false); checkBox->setText(tr("Copy the Gradle files to Android directory")); checkBox->setToolTip(tr("It is highly recommended if you are planning to extend the Java part of your Qt application.")); m_layout->addRow(checkBox); diff --git a/src/plugins/boot2qt/qdbmakedefaultappservice.cpp b/src/plugins/boot2qt/qdbmakedefaultappservice.cpp index 9512ac8f7d1..20192d6aad6 100644 --- a/src/plugins/boot2qt/qdbmakedefaultappservice.cpp +++ b/src/plugins/boot2qt/qdbmakedefaultappservice.cpp @@ -74,6 +74,7 @@ void QdbMakeDefaultAppService::handleProcessFinished(const QString &error) return; } + // FIXME: Check that ignoring is fine QByteArray processOutput = d->processRunner->readAllStandardOutput(); if (d->makeDefault) diff --git a/src/plugins/clangformat/CMakeLists.txt b/src/plugins/clangformat/CMakeLists.txt index 9e91349a3c3..83593064265 100644 --- a/src/plugins/clangformat/CMakeLists.txt +++ b/src/plugins/clangformat/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(ClangFormat - CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 + CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH DEPENDS Utils Qt5::Widgets clangFormat INCLUDES "${CLANG_INCLUDE_DIRS}" PLUGIN_DEPENDS Core TextEditor CppEditor CppTools ProjectExplorer diff --git a/src/plugins/clangpchmanager/CMakeLists.txt b/src/plugins/clangpchmanager/CMakeLists.txt index c1c9b29f93c..bc637b5640a 100644 --- a/src/plugins/clangpchmanager/CMakeLists.txt +++ b/src/plugins/clangpchmanager/CMakeLists.txt @@ -1,6 +1,6 @@ add_qtc_plugin(ClangPchManager BUILD_DEFAULT OFF - CONDITION TARGET libclang + CONDITION TARGET libclang AND QTC_CLANG_BUILDMODE_MATCH DEPENDS ClangSupport CPlusPlus DEFINES CLANGPCHMANAGER_LIB PLUGIN_DEPENDS Core CppTools diff --git a/src/plugins/clangrefactoring/CMakeLists.txt b/src/plugins/clangrefactoring/CMakeLists.txt index 95c926dc2d0..37b3221e451 100644 --- a/src/plugins/clangrefactoring/CMakeLists.txt +++ b/src/plugins/clangrefactoring/CMakeLists.txt @@ -1,6 +1,6 @@ add_qtc_plugin(ClangRefactoring BUILD_DEFAULT OFF - CONDITION TARGET libclang + CONDITION TARGET libclang AND QTC_CLANG_BUILDMODE_MATCH DEPENDS ClangSupport CPlusPlus PLUGIN_DEPENDS Core CppTools TextEditor ClangPchManager SOURCES ${TEST_SOURCES} diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index afc202f33ab..7f07b720c90 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -825,7 +825,7 @@ void ClangTool::loadDiagnosticsFromFiles() // Show imported reset(); - onNewDiagnosticsAvailable(diagnostics); + onNewDiagnosticsAvailable(diagnostics, /*generateMarks =*/ true); setState(State::ImportFinished); } @@ -1129,10 +1129,10 @@ QSet ClangTool::diagnostics() const }); } -void ClangTool::onNewDiagnosticsAvailable(const Diagnostics &diagnostics) +void ClangTool::onNewDiagnosticsAvailable(const Diagnostics &diagnostics, bool generateMarks) { QTC_ASSERT(m_diagnosticModel, return); - m_diagnosticModel->addDiagnostics(diagnostics); + m_diagnosticModel->addDiagnostics(diagnostics, generateMarks); } void ClangTool::updateForCurrentState() diff --git a/src/plugins/clangtools/clangtool.h b/src/plugins/clangtools/clangtool.h index 7882245e917..a50a068e66c 100644 --- a/src/plugins/clangtools/clangtool.h +++ b/src/plugins/clangtools/clangtool.h @@ -107,7 +107,7 @@ public: const QString &name() const; - void onNewDiagnosticsAvailable(const Diagnostics &diagnostics); + void onNewDiagnosticsAvailable(const Diagnostics &diagnostics, bool generateMarks); QAction *startAction() const { return m_startAction; } QAction *startOnCurrentFileAction() const { return m_startOnCurrentFileAction; } diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index fda0b596ee2..4e9c9e2fee9 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -364,8 +364,12 @@ void ClangToolRunWorker::onRunnerFinishedWithSuccess(const QString &filePath) } else { if (!m_filesNotAnalyzed.contains(filePath)) m_filesAnalyzed.insert(filePath); - if (!diagnostics.isEmpty()) - tool()->onNewDiagnosticsAvailable(diagnostics); + if (!diagnostics.isEmpty()) { + // do not generate marks when we always analyze open files since marks from that + // analysis should be more up to date + const bool generateMarks = !m_runSettings.analyzeOpenFiles(); + tool()->onNewDiagnosticsAvailable(diagnostics, generateMarks); + } } handleFinished(); @@ -381,7 +385,6 @@ void ClangToolRunWorker::onRunnerFinishedWithFailure(const QString &errorMessage auto *toolRunner = qobject_cast(sender()); const QString fileToAnalyze = toolRunner->fileToAnalyze(); - const QString outputFilePath = toolRunner->outputFilePath(); m_filesAnalyzed.remove(fileToAnalyze); m_filesNotAnalyzed.insert(fileToAnalyze); diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp index 4d3acb80a4d..28a63e836ba 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp @@ -58,7 +58,7 @@ QVariant FilePathItem::data(int column, int role) const case Qt::DisplayRole: return m_filePath; case Qt::DecorationRole: - return Core::FileIconProvider::icon(m_filePath); + return Core::FileIconProvider::icon(QFileInfo(m_filePath)); case Debugger::DetailedErrorView::FullTextRole: return m_filePath; default: @@ -102,7 +102,7 @@ QDebug operator<<(QDebug debug, const Diagnostic &d) ; } -void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics) +void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics, bool generateMarks) { const auto onFixitStatusChanged = [this](const QModelIndex &index, FixitStatus oldStatus, FixitStatus newStatus) { @@ -129,7 +129,7 @@ void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics) // Add to file path item qCDebug(LOG) << "Adding diagnostic:" << d; - filePathItem->appendChild(new DiagnosticItem(d, onFixitStatusChanged, this)); + filePathItem->appendChild(new DiagnosticItem(d, onFixitStatusChanged, generateMarks, this)); } } @@ -284,11 +284,12 @@ static QString fullText(const Diagnostic &diagnostic) DiagnosticItem::DiagnosticItem(const Diagnostic &diag, const OnFixitStatusChanged &onFixitStatusChanged, + bool generateMark, ClangToolsDiagnosticModel *parent) : m_diagnostic(diag) , m_onFixitStatusChanged(onFixitStatusChanged) , m_parentModel(parent) - , m_mark(new DiagnosticMark(diag)) + , m_mark(generateMark ? new DiagnosticMark(diag) : nullptr) { if (diag.hasFixits) m_fixitStatus = FixitStatus::NotScheduled; diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.h b/src/plugins/clangtools/clangtoolsdiagnosticmodel.h index 39bd84dcb65..095d8938353 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.h +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.h @@ -70,6 +70,7 @@ public: = std::function; DiagnosticItem(const Diagnostic &diag, const OnFixitStatusChanged &onFixitStatusChanged, + bool generateMark, ClangToolsDiagnosticModel *parent); ~DiagnosticItem() override; @@ -112,7 +113,7 @@ class ClangToolsDiagnosticModel : public ClangToolsDiagnosticModelBase public: ClangToolsDiagnosticModel(QObject *parent = nullptr); - void addDiagnostics(const Diagnostics &diagnostics); + void addDiagnostics(const Diagnostics &diagnostics, bool generateMarks); QSet diagnostics() const; enum ItemRole { diff --git a/src/plugins/clangtools/virtualfilesystemoverlay.cpp b/src/plugins/clangtools/virtualfilesystemoverlay.cpp index 1ddcf770790..450f03682f9 100644 --- a/src/plugins/clangtools/virtualfilesystemoverlay.cpp +++ b/src/plugins/clangtools/virtualfilesystemoverlay.cpp @@ -61,6 +61,8 @@ void VirtualFileSystemOverlay::update() documentRoots[doc->filePath().absolutePath()] << doc; AutoSavedPath saved = m_saved.take(document); if (saved.revision != document->document()->revision()) { + if (saved.path.exists()) + Utils::FileUtils::removeRecursively(saved.path); saved.revision = document->document()->revision(); QString error; saved.path = Utils::FilePath::fromString(m_root.path()) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index ec0422e2b87..82223eae363 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -466,7 +466,6 @@ void addCompileGroups(ProjectNode *targetRoot, QSet &knownHeaderNodes) { const bool inSourceBuild = (sourceDirectory == buildDirectory); - const QDir currentSourceDir(sourceDirectory.toString()); std::vector> toList; QSet alreadyListed; diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp index 30abcb3d38f..dd49e0bdb7b 100644 --- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp +++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp @@ -422,7 +422,7 @@ void ReadOnlyFilesDialogPrivate::initDialog(const FilePaths &filePaths) auto item = new QTreeWidgetItem(ui.treeWidget); item->setText(FileName, visibleName); item->setIcon(FileName, FileIconProvider::icon(info)); - item->setText(Folder, Utils::FilePath::fromFileInfo(directory).shortNativePath()); + item->setText(Folder, Utils::FilePath::fromString(directory).shortNativePath()); auto radioButtonGroup = new QButtonGroup; // Add a button for opening the file with a version control system diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp index efeca722731..b533182a995 100644 --- a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp @@ -79,7 +79,7 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent, QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.treeWidget, QStringList() << visibleName << QDir::toNativeSeparators(directory)); if (!fileName.isEmpty()) - item->setIcon(0, FileIconProvider::icon(fileName)); + item->setIcon(0, FileIconProvider::icon(QFileInfo(fileName))); item->setData(0, Qt::UserRole, QVariant::fromValue(document)); } diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index f7a0f828d78..dc87cbe16a5 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -204,7 +204,7 @@ QVariant LocatorModel::data(const QModelIndex &index, int role) const if (index.column() == DisplayNameColumn) { LocatorFilterEntry &entry = mEntries[index.row()]; if (!entry.displayIcon && !entry.fileName.isEmpty()) - entry.displayIcon = FileIconProvider::icon(entry.fileName); + entry.displayIcon = FileIconProvider::icon(QFileInfo(entry.fileName)); return entry.displayIcon ? entry.displayIcon.value() : QIcon(); } break; diff --git a/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp b/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp index e9121793e30..a4c4000cb76 100644 --- a/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp +++ b/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp @@ -47,7 +47,7 @@ QVariant FilePathItem::data(int column, int role) const case Qt::DisplayRole: return m_filePath; case Qt::DecorationRole: - return Core::FileIconProvider::icon(m_filePath); + return Core::FileIconProvider::icon(QFileInfo(m_filePath)); case Debugger::DetailedErrorView::FullTextRole: return m_filePath; default: diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index d9762fcefb5..6dc8c6acdb0 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -171,6 +171,18 @@ void DebuggerItem::reinitializeFromFile() return; } + // Prevent calling lldb on Windows because the lldb from the llvm package is linked against + // python but does not contain a python dll. + if (HostOsInfo::isWindowsHost() && m_command.fileName().startsWith("lldb")) { + QString errorMessage; + m_version = winGetDLLVersion(WinDLLFileVersion, + fileInfo.absoluteFilePath(), + &errorMessage); + m_engineType = LldbEngineType; + m_abis = Abi::abisOfBinary(m_command); + return; + } + SynchronousProcess proc; SynchronousProcessResponse response = proc.runBlocking({m_command, {version}}); if (response.result != SynchronousProcessResponse::Finished) { diff --git a/src/plugins/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index 66956b99a76..99023a51852 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.cpp +++ b/src/plugins/designer/cpp/formclasswizarddialog.cpp @@ -62,11 +62,6 @@ void FormClassWizardDialog::setPath(const QString &p) m_classPage->setPath(p); } -bool FormClassWizardDialog::validateCurrentPage() -{ - return QWizard::validateCurrentPage(); -} - void FormClassWizardDialog::initializePage(int id) { Core::BaseFileWizard::initializePage(id); diff --git a/src/plugins/designer/cpp/formclasswizarddialog.h b/src/plugins/designer/cpp/formclasswizarddialog.h index 93dcb8e6037..cc5f83b8188 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.h +++ b/src/plugins/designer/cpp/formclasswizarddialog.h @@ -50,8 +50,6 @@ public: Designer::FormClassWizardParameters parameters() const; - bool validateCurrentPage() final; - protected: void initializePage(int id) final; diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 1b0eba8d2bb..bcfd220e88f 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -442,7 +442,7 @@ void GenericBuildSystem::parse(RefreshOptions options) FilePath GenericBuildSystem::findCommonSourceRoot() { if (m_files.isEmpty()) - return FilePath::fromFileInfo(QFileInfo(m_filesFileName).absolutePath()); + return FilePath::fromFileInfo(QFileInfo(m_filesFileName)); QString root = m_files.front(); for (const QString &item : qAsConst(m_files)) { diff --git a/src/plugins/ios/iosrunner.h b/src/plugins/ios/iosrunner.h index 6fa5dc2d4bf..d4cbb03f013 100644 --- a/src/plugins/ios/iosrunner.h +++ b/src/plugins/ios/iosrunner.h @@ -60,7 +60,7 @@ public: QmlDebug::QmlDebugServicesPreset qmlDebugServices() const; void start() override; - void stop() override final; + void stop() final; virtual void appOutput(const QString &/*output*/) {} virtual void errorMsg(const QString &/*msg*/) {} diff --git a/src/plugins/mcusupport/CMakeLists.txt b/src/plugins/mcusupport/CMakeLists.txt index 2af652f2602..38630ca9b1d 100644 --- a/src/plugins/mcusupport/CMakeLists.txt +++ b/src/plugins/mcusupport/CMakeLists.txt @@ -1,6 +1,6 @@ add_qtc_plugin(McuSupport DEPENDS Qt5::Core - PLUGIN_DEPENDS Core ProjectExplorer Debugger CMakeProjectManager QtSupport + PLUGIN_DEPENDS Core BareMetal ProjectExplorer Debugger CMakeProjectManager QtSupport SOURCES mcusupport.qrc mcusupport_global.h diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index f3200d49b1c..f194ea1b2ad 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -8,6 +8,7 @@ QtcPlugin { Depends { name: "Utils" } Depends { name: "Core" } + Depends { name: "BareMetal" } Depends { name: "ProjectExplorer" } Depends { name: "Debugger" } Depends { name: "CMakeProjectManager" } diff --git a/src/plugins/mcusupport/mcusupport_dependencies.pri b/src/plugins/mcusupport/mcusupport_dependencies.pri index f68cd308a95..b3f464be984 100644 --- a/src/plugins/mcusupport/mcusupport_dependencies.pri +++ b/src/plugins/mcusupport/mcusupport_dependencies.pri @@ -6,6 +6,7 @@ QTC_LIB_DEPENDS += \ QTC_PLUGIN_DEPENDS += \ coreplugin \ + baremetal \ projectexplorer \ debugger \ cmakeprojectmanager \ diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index b5f9151db8f..295e0dfea2d 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -27,6 +27,7 @@ #include "mcusupportoptions.h" #include "mcusupportsdk.h" +#include #include #include #include @@ -74,7 +75,7 @@ static QString packagePathFromSettings(const QString &settingsKey, const QString key = QLatin1String(Constants::SETTINGS_GROUP) + '/' + QLatin1String(Constants::SETTINGS_KEY_PACKAGE_PREFIX) + settingsKey; const QString path = settings->value(key, defaultPath).toString(); - return FilePath::fromFileInfo(path).toString(); + return FilePath::fromUserInput(path).toString(); } static bool automaticKitCreationFromSettings(QSettings::Scope scope = QSettings::UserScope) @@ -330,6 +331,33 @@ static ToolChain *armGccToolChain(const FilePath &path, Id language) return toolChain; } +static ToolChain *iarToolChain(Id language) +{ + ToolChain *toolChain = ToolChainManager::toolChain([language](const ToolChain *t){ + return t->typeId() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID + && t->language() == language; + }); + if (!toolChain) { + ToolChainFactory *iarFactory = + Utils::findOrDefault(ToolChainFactory::allToolChainFactories(), [](ToolChainFactory *f){ + return f->supportedToolChainType() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID; + }); + if (iarFactory) { + const QList detected = iarFactory->autoDetect(QList()); + for (auto tc: detected) { + if (tc->language() == language) { + toolChain = tc; + toolChain->setDetection(ToolChain::ManualDetection); + toolChain->setDisplayName("IAREW"); + ToolChainManager::registerToolChain(toolChain); + } + } + } + } + + return toolChain; +} + ToolChain *McuToolChainPackage::toolChain(Id language) const { ToolChain *tc = nullptr; @@ -337,6 +365,9 @@ ToolChain *McuToolChainPackage::toolChain(Id language) const tc = msvcToolChain(language); else if (m_type == TypeGCC) tc = gccToolChain(language); + else if (m_type == TypeIAR) { + tc = iarToolChain(language); + } else { const QLatin1String compilerName( language == ProjectExplorer::Constants::C_LANGUAGE_ID ? "gcc" : "g++"); @@ -344,20 +375,25 @@ ToolChain *McuToolChainPackage::toolChain(Id language) const HostOsInfo::withExecutableSuffix( path() + ( m_type == TypeArmGcc - ? "/bin/arm-none-eabi-%1" : m_type == TypeIAR - ? "/foo/bar-iar-%1" : "/bar/foo-keil-%1")).arg(compilerName)); + ? "/bin/arm-none-eabi-%1" : "/bar/foo-keil-%1")).arg(compilerName)); tc = armGccToolChain(compiler, language); } return tc; } -QString McuToolChainPackage::cmakeToolChainFileName() const +QString McuToolChainPackage::toolChainName() const { return QLatin1String(m_type == TypeArmGcc ? "armgcc" : m_type == McuToolChainPackage::TypeIAR ? "iar" : m_type == McuToolChainPackage::TypeKEIL - ? "keil" : "ghs") + QLatin1String(".cmake"); + ? "keil" : m_type == McuToolChainPackage::TypeGHS + ? "ghs" : "unsupported"); +} + +QString McuToolChainPackage::cmakeToolChainFileName() const +{ + return toolChainName() + QLatin1String(".cmake"); } QVariant McuToolChainPackage::debuggerId() const @@ -368,7 +404,7 @@ QVariant McuToolChainPackage::debuggerId() const HostOsInfo::withExecutableSuffix(path() + ( m_type == TypeArmGcc ? "/bin/arm-none-eabi-gdb-py" : m_type == TypeIAR - ? "/foo/bar-iar-gdb" : "/bar/foo-keil-gdb"))); + ? "../common/bin/CSpyBat" : "/bar/foo-keil-gdb"))); const DebuggerItem *debugger = DebuggerItemManager::findByCommand(command); QVariant debuggerId; if (!debugger) { @@ -376,7 +412,7 @@ QVariant McuToolChainPackage::debuggerId() const newDebugger.setCommand(command); const QString displayName = m_type == TypeArmGcc ? McuPackage::tr("Arm GDB at %1") - : m_type == TypeIAR ? QLatin1String("/foo/bar-iar-gdb") + : m_type == TypeIAR ? QLatin1String("CSpy") : QLatin1String("/bar/foo-keil-gdb"); newDebugger.setUnexpandedDisplayName(displayName.arg(command.toUserOutput())); debuggerId = DebuggerItemManager::registerDebugger(newDebugger); @@ -561,7 +597,8 @@ static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mc static void setKitToolchains(Kit *k, const McuToolChainPackage *tcPackage) { // No Green Hills toolchain, because support for it is missing. - if (tcPackage->type() == McuToolChainPackage::TypeGHS) + if (tcPackage->type() == McuToolChainPackage::TypeUnsupported + || tcPackage->type() == McuToolChainPackage::TypeGHS) return; ToolChainKitAspect::setToolChain(k, tcPackage->toolChain( @@ -575,8 +612,10 @@ static void setKitDebugger(Kit *k, const McuToolChainPackage *tcPackage) // Qt Creator seems to be smart enough to deduce the right Kit debugger from the ToolChain // We rely on that at least in the Desktop case. if (tcPackage->isDesktopToolchain() - // No Green Hills debugger, because support for it is missing. - || tcPackage->type() == McuToolChainPackage::TypeGHS) + // No Green Hills and IAR debugger, because support for it is missing. + || tcPackage->type() == McuToolChainPackage::TypeUnsupported + || tcPackage->type() == McuToolChainPackage::TypeGHS + || tcPackage->type() == McuToolChainPackage::TypeIAR) return; Debugger::DebuggerKitAspect::setDebugger(k, tcPackage->debuggerId()); @@ -676,18 +715,23 @@ QString McuSupportOptions::kitName(const McuTarget *mcuTarget) // Starting from Qul 1.4 each OS is a separate platform os = QLatin1String(" FreeRTOS"); + const McuToolChainPackage *tcPkg = mcuTarget->toolChainPackage(); + const QString compilerName = tcPkg && !tcPkg->isDesktopToolchain() + ? QString::fromLatin1(" (%1)").arg(tcPkg->toolChainName().toUpper()) + : ""; const QString colorDepth = mcuTarget->colorDepth() > 0 ? QString::fromLatin1(" %1bpp").arg(mcuTarget->colorDepth()) : ""; const QString targetName = mcuTarget->platform().displayName.isEmpty() ? mcuTarget->platform().name : mcuTarget->platform().displayName; - return QString::fromLatin1("Qt for MCUs %1.%2 - %3%4%5") + return QString::fromLatin1("Qt for MCUs %1.%2 - %3%4%5%6") .arg(QString::number(mcuTarget->qulVersion().majorVersion()), QString::number(mcuTarget->qulVersion().minorVersion()), targetName, os, - colorDepth); + colorDepth, + compilerName); } QList McuSupportOptions::existingKits(const McuTarget *mcuTarget) diff --git a/src/plugins/mcusupport/mcusupportoptions.h b/src/plugins/mcusupport/mcusupportoptions.h index 113b653e4ca..28671d0127e 100644 --- a/src/plugins/mcusupport/mcusupportoptions.h +++ b/src/plugins/mcusupport/mcusupportoptions.h @@ -116,7 +116,8 @@ public: TypeKEIL, TypeGHS, TypeMSVC, - TypeGCC + TypeGCC, + TypeUnsupported }; McuToolChainPackage(const QString &label, @@ -128,6 +129,7 @@ public: Type type() const; bool isDesktopToolchain() const; ProjectExplorer::ToolChain *toolChain(Utils::Id language) const; + QString toolChainName() const; QString cmakeToolChainFileName() const; QVariant debuggerId() const; diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp index 7f61a24728f..d871ca6a8fc 100644 --- a/src/plugins/mcusupport/mcusupportsdk.cpp +++ b/src/plugins/mcusupport/mcusupportsdk.cpp @@ -27,6 +27,9 @@ #include "mcusupportoptions.h" #include "mcusupportsdk.h" +#include +#include +#include #include #include #include @@ -78,6 +81,11 @@ static McuToolChainPackage *createGccToolChainPackage() return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::TypeGCC); } +static McuToolChainPackage *createUnsupportedToolChainPackage() +{ + return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::TypeUnsupported); +} + static McuToolChainPackage *createArmGccPackage() { const char envVar[] = "ARMGCC_DIR"; @@ -126,6 +134,36 @@ static McuToolChainPackage *createGhsToolchainPackage() return result; } +static McuToolChainPackage *createIarToolChainPackage() +{ + const char envVar[] = "IAR_ARM_COMPILER_DIR"; + + QString defaultPath; + if (qEnvironmentVariableIsSet(envVar)) + defaultPath = qEnvironmentVariable(envVar); + else { + const ProjectExplorer::ToolChain *tc = + ProjectExplorer::ToolChainManager::toolChain([](const ProjectExplorer::ToolChain *t) { + return t->typeId() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID; + }); + if (tc) { + const Utils::FilePath compilerExecPath = tc->compilerCommand(); + defaultPath = compilerExecPath.parentDir().parentDir().toString(); + } + else + defaultPath = QDir::homePath(); + } + + auto result = new McuToolChainPackage( + "IAR ARM Compiler", + defaultPath, + Utils::HostOsInfo::withExecutableSuffix("bin/iccarm"), + "IARToolchain", + McuToolChainPackage::TypeIAR); + result->setEnvironmentVariableName(envVar); + return result; +} + static McuPackage *createRGLPackage() { const char envVar[] = "RGL_DIR"; @@ -321,6 +359,8 @@ protected: { QVector mcuTargets; McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchainId); + if (!tcPkg) + tcPkg = createUnsupportedToolChainPackage(); for (auto os : {McuTarget::OS::BareMetal, McuTarget::OS::FreeRTOS}) { for (int colorDepth : desc.colorDepths) { QVector required3rdPartyPkgs = { tcPkg }; @@ -366,6 +406,8 @@ protected: QVector createDesktopTargetsLegacy(const McuTargetDescription& desc) { McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchainId); + if (!tcPkg) + tcPkg = createUnsupportedToolChainPackage(); const auto platform = McuTarget::Platform{ desc.platform, desc.platformName, desc.platformVendor }; auto desktopTarget = new McuTarget(QVersionNumber::fromString(desc.qulVersion), platform, McuTarget::OS::Desktop, {}, tcPkg); @@ -385,10 +427,14 @@ protected: QVector mcuTargets; McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchainId); + if (!tcPkg) + tcPkg = createUnsupportedToolChainPackage(); for (int colorDepth : desc.colorDepths) { QVector required3rdPartyPkgs; // Desktop toolchains don't need any additional settings - if (tcPkg && !tcPkg->isDesktopToolchain()) + if (tcPkg + && !tcPkg->isDesktopToolchain() + && tcPkg->type() != McuToolChainPackage::TypeUnsupported) required3rdPartyPkgs.append(tcPkg); // Add setting specific to platform IDE @@ -440,6 +486,7 @@ static QVector targetsFromDescriptions(const QList tcPkgs = { {{"armgcc"}, createArmGccPackage()}, {{"greenhills"}, createGhsToolchainPackage()}, + {{"iar"}, createIarToolChainPackage()}, {{"msvc"}, createMsvcToolChainPackage()}, {{"gcc"}, createGccToolChainPackage()}, }; diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index e6ac9f7f796..db5391b6742 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -661,7 +661,7 @@ void MercurialPluginPrivate::showCommitWidget(const QListdocument()->setPreferredDisplayName(msg); const QString branch = vcsTopic(m_submitRepository); - commitEditor->setFields(m_submitRepository, branch, + commitEditor->setFields(QFileInfo(m_submitRepository), branch, m_settings.stringValue(MercurialSettings::userNameKey), m_settings.stringValue(MercurialSettings::userEmailKey), status); } diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index 6c25bbf7f04..f1d43c2b295 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -99,7 +99,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const case Qt::CheckStateRole: return SessionManager::hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked; case Qt::DecorationRole: - return Core::FileIconProvider::icon(p->projectFilePath().toString()); + return Core::FileIconProvider::icon(p->projectFilePath().toFileInfo()); default: return QVariant(); } diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index a569db8fa16..d9afd854621 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1029,7 +1029,6 @@ QList GccToolChainFactory::autoDetect(const QList &alr if (HostOsInfo::isMacHost()) return {}; QList tcs; - QList known = alreadyKnown; static const auto tcChecker = [](const ToolChain *tc) { return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor && tc->compilerCommand().fileName() != "c89-gcc" diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index 9cfb13feac7..0985dd80715 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -636,7 +636,6 @@ void LineEditField::setupCompletion(FancyLineEdit *lineEdit) const auto handleResults = [this, lineEdit, watcher](int firstIndex, int endIndex) { QSet namespaces; QStringList classes; - QString projectBaseDir; Project * const project = ProjectTree::currentProject(); for (int i = firstIndex; i < endIndex; ++i) { static const auto isReservedName = [](const QString &name) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index bf878346805..b1d690b8a41 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -542,7 +542,6 @@ JsonWizardJsExtension::JsonWizardJsExtension(JsonWizard *wizard) QVariant JsonWizardJsExtension::value(const QString &name) const { - const QVariant value = m_wizard->value(name); return m_wizard->expander()->expandVariant(m_wizard->value(name)); } diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index d65b80041cf..b846c2cd320 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -145,7 +145,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const } case Qt::DecorationRole: { if (!folderNode) - return Core::FileIconProvider::icon(node->filePath().toString()); + return Core::FileIconProvider::icon(node->filePath().toFileInfo()); if (!project) return folderNode->icon(); static QIcon warnIcon = Utils::Icons::WARNING.icon(); diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index f34ada1628f..dbd999ecf7b 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -396,7 +396,6 @@ public: { Kit *kit = KitManager::kit(m_kitId); QTC_ASSERT(kit, return); - const QString kitName = kit->displayName(); const QString projectName = m_project->displayName(); QAction *enableAction = menu->addAction(tr("Enable Kit for Project \"%1\"").arg(projectName)); diff --git a/src/plugins/qmldesigner/assetexporterplugin/filepathmodel.cpp b/src/plugins/qmldesigner/assetexporterplugin/filepathmodel.cpp index c0cfeacb972..718a11f7d99 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/filepathmodel.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/filepathmodel.cpp @@ -45,7 +45,7 @@ void findQmlFiles(QFutureInterface &f, const Project *project) return; int index = 0; - Utils::FilePaths qmlFiles = project->files([&f, &index](const Node* node) ->bool { + project->files([&f, &index](const Node* node) ->bool { if (f.isCanceled()) return false; Utils::FilePath path = node->filePath(); diff --git a/src/plugins/qmldesigner/assetexporterplugin/parsers/assetnodeparser.cpp b/src/plugins/qmldesigner/assetexporterplugin/parsers/assetnodeparser.cpp index adc46678aed..85b8f11c1ef 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/parsers/assetnodeparser.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/parsers/assetnodeparser.cpp @@ -54,7 +54,6 @@ QJsonObject AssetNodeParser::json(Component &component) const { QJsonObject jsonObject = ItemNodeParser::json(component); - QPixmap asset = objectNode().toQmlItemNode().instanceRenderPixmap(); Utils::FilePath assetPath = component.exporter().exportAsset(objectNode(), uuid()); QJsonObject assetData; assetData.insert(AssetPathTag, assetPath.toString()); diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp index 8085691354a..efdc727d754 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp @@ -64,7 +64,7 @@ void AnnotationEditor::showWidget() m_modelNode.customId(), m_modelNode.annotation()); - QObject::connect(m_dialog, &AnnotationEditorDialog::accepted, + QObject::connect(m_dialog, &AnnotationEditorDialog::acceptedDialog, this, &AnnotationEditor::acceptedClicked); QObject::connect(m_dialog, &AnnotationEditorDialog::rejected, this, &AnnotationEditor::cancelClicked); diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp index 65093e1eb1a..29b1dc5a8b8 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp @@ -149,7 +149,7 @@ void AnnotationEditorDialog::acceptedClicked() m_annotation = annotation; - emit AnnotationEditorDialog::accepted(); + emit AnnotationEditorDialog::acceptedDialog(); } void AnnotationEditorDialog::commentTitleChanged(const QString &text, QWidget *tab) diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.h b/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.h index d420d963d43..bc304c9ddd3 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.h +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.h @@ -49,6 +49,9 @@ public: void setCustomId(const QString &customId); QString customId() const; +signals: + void acceptedDialog(); //use instead of QDialog::accepted + private slots: void acceptedClicked(); void tabChanged(int index); diff --git a/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditor.cpp b/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditor.cpp index 201b30142fd..f17833b0c7e 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditor.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditor.cpp @@ -53,7 +53,7 @@ void GlobalAnnotationEditor::showWidget() modelNode().globalAnnotation(), modelNode().globalStatus()); - QObject::connect(m_dialog, &GlobalAnnotationEditorDialog::accepted, + QObject::connect(m_dialog, &GlobalAnnotationEditorDialog::acceptedDialog, this, &GlobalAnnotationEditor::acceptedClicked); QObject::connect(m_dialog, &GlobalAnnotationEditorDialog::rejected, this, &GlobalAnnotationEditor::cancelClicked); diff --git a/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.cpp b/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.cpp index 4db4cce925b..ecfa00baab4 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.cpp @@ -164,7 +164,7 @@ void GlobalAnnotationEditorDialog::acceptedClicked() m_globalStatus.setStatus(ui->statusComboBox->currentIndex()); } - emit GlobalAnnotationEditorDialog::accepted(); + emit GlobalAnnotationEditorDialog::acceptedDialog(); } void GlobalAnnotationEditorDialog::commentTitleChanged(const QString &text, QWidget *tab) diff --git a/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.h b/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.h index 2858dbed6c4..5688c54ecfa 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.h +++ b/src/plugins/qmldesigner/components/annotationeditor/globalannotationeditordialog.h @@ -49,6 +49,9 @@ public: void setStatus(GlobalAnnotationStatus status); GlobalAnnotationStatus globalStatus() const; +signals: + void acceptedDialog(); //use instead of QDialog::accepted + private slots: void acceptedClicked(); void tabChanged(int index); diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index 0a8f567c54d..46c23449d1e 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -925,7 +925,7 @@ void DesignerActionManager::createDefaultDesignerActions() QKeySequence(), 200, &toFront, - &singleSelection)); + &raiseAvailable)); addDesignerAction(new ModelNodeContextMenuAction( raiseCommandId, @@ -955,7 +955,7 @@ void DesignerActionManager::createDefaultDesignerActions() QKeySequence(), 140, &toBack, - &singleSelection)); + &lowerAvailable)); addDesignerAction(new ModelNodeContextMenuAction( reverseCommandId, diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp index 8ea93278299..643f7462210 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp @@ -523,7 +523,6 @@ QStringList ConnectionModel::getPossibleSignalsForConnection(const ModelNode &co const BindingProperty bp = connection.bindingProperty("target"); if (bp.isValid()) { - const QString bindExpression = bp.expression(); QStringList expression = bp.expression().split("."); if (expression.size() > 1) { const QString itemId = expression.constFirst(); diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp index e94b1605707..769b33e31de 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp @@ -535,7 +535,6 @@ void ConnectionViewWidget::editorForDynamic() VariantProperty property = abProp.toVariantProperty(); PropertyName name = property.name(); TypeName type = property.dynamicTypeName(); - QVariant value = newValue; BindingProperty newProperty = propertiesModel ->replaceVariantWithBinding(name); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp index fe1cc7ef9e0..997c712af6d 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp @@ -429,7 +429,7 @@ void FormEditorAnnotationIcon::createAnnotationEditor() m_modelNode.customId(), m_modelNode.annotation()); - connect(m_annotationEditor, &AnnotationEditorDialog::accepted, + connect(m_annotationEditor, &AnnotationEditorDialog::acceptedDialog, this, &FormEditorAnnotationIcon::annotationDialogAccepted); connect(m_annotationEditor, &QDialog::rejected, this, &FormEditorAnnotationIcon::annotationDialogRejected); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index e5f43c9e783..10eff821136 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -605,8 +605,14 @@ void FormEditorFlowItem::updateGeometry() { FormEditorItem::updateGeometry(); const QPointF pos = qmlItemNode().flowPosition(); + setTransform(QTransform::fromTranslate(pos.x(), pos.y())); + if (pos == m_oldPos) + return; + + m_oldPos = pos; + // Call updateGeometry() on all related transitions QmlFlowTargetNode flowItem(qmlItemNode()); if (flowItem.isValid() && flowItem.flowView().isValid()) { @@ -652,16 +658,6 @@ void FormEditorFlowActionItem::updateGeometry() FormEditorItem::updateGeometry(); //const QPointF pos = qmlItemNode().flowPosition(); //setTransform(QTransform::fromTranslate(pos.x(), pos.y())); - - // Call updateGeometry() on all related transitions - QmlFlowItemNode flowItem = QmlFlowActionAreaNode(qmlItemNode()).flowItemParent(); - if (flowItem.isValid() && flowItem.flowView().isValid()) { - const auto nodes = flowItem.flowView().transitions(); - for (const ModelNode &node : nodes) { - if (FormEditorItem *item = scene()->itemForQmlItemNode(node)) - item->updateGeometry(); - } - } } void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) @@ -1748,16 +1744,6 @@ void FormEditorFlowDecisionItem::updateGeometry() setTransform(qmlItemNode().instanceTransformWithContentTransform()); const QPointF pos = qmlItemNode().flowPosition(); setTransform(QTransform::fromTranslate(pos.x(), pos.y())); - - // Call updateGeometry() on all related transitions - QmlFlowTargetNode flowItem(qmlItemNode()); - if (flowItem.isValid() && flowItem.flowView().isValid()) { - const auto nodes = flowItem.flowView().transitions(); - for (const ModelNode &node : nodes) { - if (FormEditorItem *item = scene()->itemForQmlItemNode(node)) - item->updateGeometry(); - } - } } void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.h b/src/plugins/qmldesigner/components/formeditor/formeditoritem.h index 9551f1eb88d..b5eddd1407b 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.h @@ -163,6 +163,8 @@ protected: FormEditorFlowItem(const QmlItemNode &qmlItemNode, FormEditorScene *scene) : FormEditorItem(qmlItemNode, scene) {} +private: + QPointF m_oldPos; }; class FormEditorFlowActionItem : public FormEditorItem @@ -180,6 +182,8 @@ protected: FormEditorFlowActionItem(const QmlItemNode &qmlItemNode, FormEditorScene *scene) : FormEditorItem(qmlItemNode, scene) {} +private: + QPointF m_oldPos; }; class FormEditorTransitionItem : public FormEditorItem diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 19a3b1c647b..e2ef632928d 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -118,7 +118,7 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode) setupFormEditorItemTree(nextNode.toQmlItemNode()); } } else if (qmlItemNode.isFlowView() && qmlItemNode.isRootNode()) { - m_scene->addFormEditorItem(qmlItemNode, FormEditorScene::Flow); + FormEditorItem *rootItem = m_scene->addFormEditorItem(qmlItemNode, FormEditorScene::Flow); ModelNode node = qmlItemNode.modelNode(); if (!node.hasAuxiliaryData("width") && !node.hasAuxiliaryData("height")) { @@ -126,6 +126,9 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode) node.setAuxiliaryData("height", 10000); } + m_scene->synchronizeTransformation(rootItem); + formEditorWidget()->setRootItemRect(qmlItemNode.instanceBoundingRect()); + for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) { if (QmlItemNode::isValidQmlItemNode(nextNode) && nextNode.toQmlItemNode().isFlowItem()) { setupFormEditorItemTree(nextNode.toQmlItemNode()); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp index e244db93814..8489c0d63a2 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp @@ -238,7 +238,6 @@ void ItemLibraryAssetImporter::parseFiles(const QStringList &filePaths, if (isCancelled()) return; if (isQuick3DAsset(file)) { - QVariantMap varOpts; int index = extToImportOptionsMap.value(QFileInfo(file).suffix()); parseQuick3DAsset(file, options[index].toVariantMap()); } @@ -383,7 +382,6 @@ void ItemLibraryAssetImporter::parseQuick3DAsset(const QString &file, const QVar out << "canBeDroppedInView3D: true" << Qt::endl; file.close(); } - QString outIconSource = QString::fromUtf8(content); if (generateComponentIcon(24, iconFileName, qmlIt.filePath())) { // Since icon is generated by external process, the file won't be // ready for asset gathering below, so assume its generation succeeds diff --git a/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp b/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp index 50fe089859a..a8e693876e0 100644 --- a/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp +++ b/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp @@ -658,7 +658,7 @@ void RichTextEditor::setupTableActions() m_actionSplitRow->setCheckable(false); const QIcon splitColumnIcon(getIcon(Theme::Icon::splitColumns)); - m_actionSplitColumn = ui->tableBar->addAction(splitRowIcon, tr("Split Column"), [this]() { + m_actionSplitColumn = ui->tableBar->addAction(splitColumnIcon, tr("Split Column"), [this]() { QTextCursor cursor = ui->textEdit->textCursor(); if (QTextTable *currentTable = cursor.currentTable()) { cursorEditBlock(cursor, [&] () { diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp index 37252f6358b..a3a9806f7e6 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp @@ -99,33 +99,50 @@ bool Exception::warnAboutException() #endif } -/*! - Constructs an exception. \a line uses the __LINE__ macro, \a function uses - the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses - the __FILE__ macro. -*/ -Exception::Exception(int line, - const QByteArray &_function, - const QByteArray &_file) - : m_line(line), - m_function(QString::fromUtf8(_function)), - m_file(QString::fromUtf8(_file)) -{ #ifdef Q_OS_LINUX +static QString getBackTrace() +{ + QString backTrace; void * array[50]; int nSize = backtrace(array, 50); char ** symbols = backtrace_symbols(array, nSize); for (int i = 0; i < nSize; i++) - { - m_backTrace.append(QString("%1\n").arg(QLatin1String(symbols[i]))); - } + backTrace.append(QString("%1\n").arg(QLatin1String(symbols[i]))); free(symbols); + + return backTrace; +} #endif +QString Exception::defaultDescription(int line, const QByteArray &function, const QByteArray &file) +{ + return QString(QStringLiteral("file: %1, function: %2, line: %3")) + .arg(QString::fromUtf8(file), QString::fromUtf8(function), QString::number(line)); +} + +/*! + Constructs an exception. \a line uses the __LINE__ macro, \a function uses + the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses + the __FILE__ macro. +*/ +Exception::Exception(int line, const QByteArray &function, const QByteArray &file) + : Exception(line, function, file, Exception::defaultDescription(line, function, file)) +{ } + +Exception::Exception(int line, const QByteArray &function, + const QByteArray &file, const QString &description) + : m_line(line) + , m_function(QString::fromUtf8(function)) + , m_file(QString::fromUtf8(file)) + , m_description(description) + #ifdef Q_OS_LINUX + , m_backTrace(getBackTrace()) + #endif +{ if (s_shouldAssert) { - qDebug() << description(); + qDebug() << Exception::description(); QTC_ASSERT(false, ;); Q_ASSERT(false); } @@ -152,7 +169,7 @@ void Exception::createWarning() const */ QString Exception::description() const { - return QString(QStringLiteral("file: %1, function: %2, line: %3")).arg(m_file, m_function, QString::number(m_line)); + return m_description; } /*! diff --git a/src/plugins/qmldesigner/designercore/exceptions/invalidargumentexception.cpp b/src/plugins/qmldesigner/designercore/exceptions/invalidargumentexception.cpp index 86ffd4bea72..d4182eeca27 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/invalidargumentexception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/invalidargumentexception.cpp @@ -35,6 +35,19 @@ argument. */ namespace QmlDesigner { +QString InvalidArgumentException::invalidArgumentDescription(int line, + const QByteArray &function, + const QByteArray &file, + const QByteArray &argument) +{ + if (QString::fromUtf8(function) == QLatin1String("createNode")) { + return QCoreApplication::translate("QmlDesigner::InvalidArgumentException", + "Failed to create item of type %1").arg(QString::fromUtf8(argument)); + } + + return Exception::defaultDescription(line, function, file); +} + /*! Constructs the exception for \a argument. \a line uses the __LINE__ macro, \a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses @@ -44,17 +57,21 @@ InvalidArgumentException::InvalidArgumentException(int line, const QByteArray &function, const QByteArray &file, const QByteArray &argument) - : Exception(line, function, file), m_argument(QString::fromUtf8(argument)) + : InvalidArgumentException(line, function, file, argument, + invalidArgumentDescription(line, function, file, argument)) { createWarning(); } -QString InvalidArgumentException::description() const +InvalidArgumentException::InvalidArgumentException(int line, + const QByteArray &function, + const QByteArray &file, + const QByteArray &argument, + const QString &description) + : Exception(line, function, file, description) + , m_argument(QString::fromUtf8(argument)) { - if (function() == QLatin1String("createNode")) - return QCoreApplication::translate("QmlDesigner::InvalidArgumentException", "Failed to create item of type %1").arg(m_argument); - - return Exception::description(); + createWarning(); } /*! diff --git a/src/plugins/qmldesigner/designercore/exceptions/invalididexception.cpp b/src/plugins/qmldesigner/designercore/exceptions/invalididexception.cpp index 5e4e87712c0..92c75717e53 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/invalididexception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/invalididexception.cpp @@ -29,28 +29,40 @@ namespace QmlDesigner { -InvalidIdException::InvalidIdException(int line, - const QByteArray &function, - const QByteArray &file, - const QByteArray &id, - Reason reason) : - InvalidArgumentException(line, function, file, "id"), - m_id(QString::fromUtf8(id)) +static QString descriptionBasedOnReason(InvalidIdException::Reason reason) { - if (reason == InvalidCharacters) - m_description = QCoreApplication::translate("InvalidIdException", "Only alphanumeric characters and underscore allowed.\nIds must begin with a lowercase letter."); - else - m_description = QCoreApplication::translate("InvalidIdException", "Ids have to be unique."); + if (reason == InvalidIdException::InvalidCharacters) + return QCoreApplication::translate("InvalidIdException", + "Only alphanumeric characters and underscore allowed.\n" + "Ids must begin with a lowercase letter."); + + return QCoreApplication::translate("InvalidIdException", "Ids have to be unique."); +} + +static QString decorateDescriptionWithId(const QString &id, const QString &description) +{ + return QCoreApplication::translate("InvalidIdException", "Invalid Id: %1\n%2") + .arg(id, description); } InvalidIdException::InvalidIdException(int line, const QByteArray &function, const QByteArray &file, const QByteArray &id, - const QByteArray &description) : - InvalidArgumentException(line, function, file, "id"), - m_id(QString::fromUtf8(id)), - m_description(QString::fromUtf8(description)) + Reason reason) + : InvalidArgumentException(line, function, file, "id", + decorateDescriptionWithId(QString::fromUtf8(id), + descriptionBasedOnReason(reason))) +{ } + +InvalidIdException::InvalidIdException(int line, + const QByteArray &function, + const QByteArray &file, + const QByteArray &id, + const QByteArray &description) + : InvalidArgumentException(line, function, file, "id", + decorateDescriptionWithId(QString::fromUtf8(id), + QString::fromUtf8(description))) { createWarning(); } @@ -60,9 +72,4 @@ QString InvalidIdException::type() const return QLatin1String("InvalidIdException"); } -QString InvalidIdException::description() const -{ - return QCoreApplication::translate("InvalidIdException", "Invalid Id: %1\n%2").arg(m_id, m_description); -} - } diff --git a/src/plugins/qmldesigner/designercore/exceptions/invalidqmlsourceexception.cpp b/src/plugins/qmldesigner/designercore/exceptions/invalidqmlsourceexception.cpp index 398aade16a0..b063a71b89d 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/invalidqmlsourceexception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/invalidqmlsourceexception.cpp @@ -42,8 +42,7 @@ InvalidQmlSourceException::InvalidQmlSourceException(int line, const QByteArray &function, const QByteArray &file, const QByteArray &qmlSource) - : Exception(line, function, file), - m_qmlSource(QString::fromUtf8(qmlSource)) + : Exception(line, function, file, QString::fromUtf8(qmlSource)) { createWarning(); } @@ -56,9 +55,4 @@ QString InvalidQmlSourceException::type() const return QLatin1String("InvalidQmlSourceException"); } -QString InvalidQmlSourceException::description() const -{ - return m_qmlSource; -} - } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp b/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp index a4c326acccd..3ed058e1868 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp @@ -31,8 +31,9 @@ RewritingException::RewritingException(int line, const QByteArray &function, const QByteArray &file, const QByteArray &description, - const QString &documentTextContent): - Exception(line, function, file), m_description(QString::fromUtf8(description)), m_documentTextContent(documentTextContent) + const QString &documentTextContent) + : Exception(line, function, file, QString::fromUtf8(description)) + , m_documentTextContent(documentTextContent) { createWarning(); } @@ -42,11 +43,6 @@ QString RewritingException::type() const return QLatin1String("RewritingException"); } -QString RewritingException::description() const -{ - return m_description; -} - QString RewritingException::documentTextContent() const { return m_documentTextContent; diff --git a/src/plugins/qmldesigner/designercore/include/exception.h b/src/plugins/qmldesigner/designercore/include/exception.h index ea9a5ac8768..d716b45b597 100644 --- a/src/plugins/qmldesigner/designercore/include/exception.h +++ b/src/plugins/qmldesigner/designercore/include/exception.h @@ -41,8 +41,8 @@ public: virtual ~Exception(); virtual QString type() const = 0; - virtual QString description() const; - virtual void showException(const QString &title = QString()) const; + QString description() const; + void showException(const QString &title = QString()) const; int line() const; QString function() const; @@ -55,11 +55,20 @@ public: static bool shouldAssert(); static bool warnAboutException(); +protected: + Exception(int line, + const QByteArray &function, + const QByteArray &file, + const QString &description); + static QString defaultDescription(int line, const QByteArray &function, const QByteArray &file); + QString defaultDescription(); + private: - int m_line; - QString m_function; - QString m_file; - QString m_backTrace; + const int m_line; + const QString m_function; + const QString m_file; + const QString m_description; + const QString m_backTrace; static bool s_shouldAssert; }; diff --git a/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h b/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h index ab85eea9bb4..2d1719fcdb0 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h @@ -40,8 +40,17 @@ public: QString type() const override; QString argument() const; - QString description() const override; +protected: + InvalidArgumentException(int line, + const QByteArray &function, + const QByteArray &file, + const QByteArray &argument, + const QString &description); + static QString invalidArgumentDescription(int line, + const QByteArray &function, + const QByteArray &file, + const QByteArray &argument); private: const QString m_argument; }; diff --git a/src/plugins/qmldesigner/designercore/include/invalididexception.h b/src/plugins/qmldesigner/designercore/include/invalididexception.h index c44ed1f4c74..25acc992bda 100644 --- a/src/plugins/qmldesigner/designercore/include/invalididexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalididexception.h @@ -47,11 +47,6 @@ public: const QByteArray &description); QString type() const override; - QString description() const override; - -private: - QString m_id; - QString m_description; }; } diff --git a/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h b/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h index 8a207dfdeca..c3bc1e5460a 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h @@ -38,10 +38,6 @@ public: const QByteArray &qmlSource = QByteArray()); QString type() const override; - QString description() const override; - -private: - QString m_qmlSource; }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/include/rewritingexception.h b/src/plugins/qmldesigner/designercore/include/rewritingexception.h index 95b034b32ea..4342bd337fb 100644 --- a/src/plugins/qmldesigner/designercore/include/rewritingexception.h +++ b/src/plugins/qmldesigner/designercore/include/rewritingexception.h @@ -39,11 +39,10 @@ public: const QString &documentTextContent); QString type() const override; - QString description() const override; QString documentTextContent() const; + private: - QString m_description; - QString m_documentTextContent; + const QString m_documentTextContent; }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index f9515242683..cf2ce9ecc3c 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -277,11 +277,12 @@ void SubComponentManager::parseFile(const QString &canonicalFilePath, bool addTo if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; - QString dir = QFileInfo(canonicalFilePath).path(); + const QFileInfo fi(canonicalFilePath); + const QString dir = fi.path(); foreach (const QString &qualifier, m_dirToQualifier.values(dir)) { - registerQmlFile(canonicalFilePath, qualifier, addToLibrary); + registerQmlFile(fi, qualifier, addToLibrary); } - registerQmlFile(canonicalFilePath, qualification, addToLibrary); + registerQmlFile(fi, qualification, addToLibrary); } void SubComponentManager::parseFile(const QString &canonicalFilePath) diff --git a/src/plugins/qmldesigner/designersettings.cpp b/src/plugins/qmldesigner/designersettings.cpp index 8762667fdaf..ed12230ff93 100644 --- a/src/plugins/qmldesigner/designersettings.cpp +++ b/src/plugins/qmldesigner/designersettings.cpp @@ -50,8 +50,8 @@ void DesignerSettings::fromSettings(QSettings *settings) restoreValue(settings, DesignerSettingsKey::ITEMSPACING, 6); restoreValue(settings, DesignerSettingsKey::CONTAINERPADDING, 8); - restoreValue(settings, DesignerSettingsKey::CANVASWIDTH, 100000); - restoreValue(settings, DesignerSettingsKey::CANVASHEIGHT, 100000); + restoreValue(settings, DesignerSettingsKey::CANVASWIDTH, 40000); + restoreValue(settings, DesignerSettingsKey::CANVASHEIGHT, 40000); restoreValue(settings, DesignerSettingsKey::ROOT_ELEMENT_INIT_WIDTH, 640); restoreValue(settings, DesignerSettingsKey::ROOT_ELEMENT_INIT_HEIGHT, 480); restoreValue(settings, DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER, true); diff --git a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp index e0d55eb21a1..95440ae077f 100644 --- a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp +++ b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewplugin.cpp @@ -166,15 +166,13 @@ void QmlPreviewPlugin::setLanguageLocale(const QString &locale) QObject *QmlPreviewPlugin::getPreviewPlugin() { - const QVector specs = ExtensionSystem::PluginManager::plugins(); - - auto pluginIt = std::find_if(specs.begin(), - specs.end(), + const QVector &specs = ExtensionSystem::PluginManager::plugins(); + const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(), [](const ExtensionSystem::PluginSpec *p) { return p->name() == "QmlPreview"; }); - if (pluginIt != specs.end()) + if (pluginIt != specs.cend()) return (*pluginIt)->plugin(); return nullptr; diff --git a/src/plugins/qmlpreview/qmldebugtranslationwidget.cpp b/src/plugins/qmlpreview/qmldebugtranslationwidget.cpp index 2b5f7512c9c..7a25c6f75fe 100644 --- a/src/plugins/qmlpreview/qmldebugtranslationwidget.cpp +++ b/src/plugins/qmlpreview/qmldebugtranslationwidget.cpp @@ -76,13 +76,13 @@ namespace { QObject *getPreviewPlugin() { - auto pluginIt = std::find_if(ExtensionSystem::PluginManager::plugins().begin(), - ExtensionSystem::PluginManager::plugins().end(), + const QVector &specs = ExtensionSystem::PluginManager::plugins(); + const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(), [](const ExtensionSystem::PluginSpec *p) { return p->name() == "QmlPreview"; }); - if (pluginIt != ExtensionSystem::PluginManager::plugins().constEnd()) + if (pluginIt != specs.cend()) return (*pluginIt)->plugin(); return nullptr; @@ -413,8 +413,6 @@ QString QmlDebugTranslationWidget::currentDir() const void QmlDebugTranslationWidget::setCurrentDir(const QString &path) { m_lastDir = path; - const QString currentDir = m_lastDir.isEmpty() ? - ProjectExplorer::ProjectTree::currentFilePath().parentDir().toString() : m_lastDir; } void QmlDebugTranslationWidget::loadLogFile() diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index a1b667b78b2..f04f7525277 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -142,9 +142,6 @@ LocalQmlPreviewSupport::LocalQmlPreviewSupport(ProjectExplorer::RunControl *runC const QString mainScriptFromProject = qmlBuildSystem->targetFile( Utils::FilePath::fromString(mainScript)).toString(); - const QString currentFileFromProject = qmlBuildSystem->targetFile( - Utils::FilePath::fromString(currentFile)).toString(); - if (!currentFile.isEmpty() && qmlProjectRunConfigurationArguments.last().contains(mainScriptFromProject)) { qmlProjectRunConfigurationArguments.removeLast(); auto commandLine = Utils::CommandLine(runnable.commandLine().executable(), qmlProjectRunConfigurationArguments); diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp index 997850f1529..79058932713 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp @@ -35,13 +35,12 @@ static bool isMultilanguagePresent() { - const QVector specs = ExtensionSystem::PluginManager::plugins(); - return std::find_if(specs.begin(), - specs.end(), + const QVector &specs = ExtensionSystem::PluginManager::plugins(); + return std::find_if(specs.cbegin(), specs.cend(), [](ExtensionSystem::PluginSpec *spec) { return spec->name() == "MultiLanguage"; }) - != specs.end(); + != specs.cend(); } static Utils::FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target *target) @@ -57,13 +56,13 @@ static Utils::FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target static QObject *getPreviewPlugin() { - auto pluginIt = std::find_if(ExtensionSystem::PluginManager::plugins().begin(), - ExtensionSystem::PluginManager::plugins().end(), + const QVector &specs = ExtensionSystem::PluginManager::plugins(); + const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(), [](const ExtensionSystem::PluginSpec *p) { return p->name() == "QmlPreview"; }); - if (pluginIt != ExtensionSystem::PluginManager::plugins().constEnd()) + if (pluginIt != specs.cend()) return (*pluginIt)->plugin(); return nullptr; diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index cff7443c7fd..85d9741e784 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -793,7 +793,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const if (iconFileExtension(path)) file->icon = QIcon(path); else - file->icon = Core::FileIconProvider::icon(path); + file->icon = Core::FileIconProvider::icon(QFileInfo(path)); } if (!file->icon.isNull()) result = file->icon; diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 5a9e2aef6af..0792e84d4e6 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -244,7 +244,7 @@ ResourceTopLevelNode::ResourceTopLevelNode(const FilePath &filePath, const QString &contents) : FolderNode(filePath) { - setIcon(FileIconProvider::icon(filePath.toString())); + setIcon(FileIconProvider::icon(filePath.toFileInfo())); setPriority(Node::DefaultFilePriority); setListInProject(true); setAddFileFilter("*.png; *.jpg; *.gif; *.svg; *.ico; *.qml; *.qml.ui"); diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index 1ca096b07f8..814e0559f6e 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -130,7 +130,7 @@ void UpdateInfoPlugin::startCheckForUpdates() d->m_checkUpdatesCommand->setDisplayName(tr("Checking for Updates")); connect(d->m_checkUpdatesCommand, &ShellCommand::stdOutText, this, &UpdateInfoPlugin::collectCheckForUpdatesOutput); connect(d->m_checkUpdatesCommand, &ShellCommand::finished, this, &UpdateInfoPlugin::checkForUpdatesFinished); - d->m_checkUpdatesCommand->addJob({Utils::FilePath::fromFileInfo(d->m_maintenanceTool), {"--checkupdates"}}, + d->m_checkUpdatesCommand->addJob({Utils::FilePath::fromString(d->m_maintenanceTool), {"--checkupdates"}}, 60 * 3, // 3 minutes timeout /*workingDirectory=*/QString(), [](int /*exitCode*/) { return Utils::SynchronousProcessResponse::Finished; }); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index b6b518e311f..3dd39d6188c 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -824,6 +824,7 @@ void MemcheckToolPrivate::heobAction() if (!commandLineArguments.isEmpty()) arguments += ' ' + commandLineArguments; QByteArray argumentsCopy(reinterpret_cast(arguments.utf16()), arguments.size() * 2 + 2); + Q_UNUSED(argumentsCopy) // process environment QByteArray env; diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri index 2ef2cb425cb..2d412c48d2b 100644 --- a/src/shared/clang/clang_installation.pri +++ b/src/shared/clang/clang_installation.pri @@ -141,15 +141,14 @@ win32: BIN_EXTENSION = .exe isEmpty(LLVM_INSTALL_DIR) { unix { - llvm_config = $$system(which llvm-config-8) - } - - isEmpty(llvm_config) { - llvm_config = llvm-config + llvm_config = $$system(which llvm-config-11) + isEmpty(llvm_config): llvm_config = $$system(which llvm-config-10) + isEmpty(llvm_config): llvm_config = $$system(which llvm-config-9) } + isEmpty(llvm_config): llvm_config = llvm-config } else { - exists($$LLVM_INSTALL_DIR/bin/llvm-config-8$$BIN_EXTENSION) { - llvm_config = $$system_quote($$LLVM_INSTALL_DIR/bin/llvm-config-8) + exists($$LLVM_INSTALL_DIR/bin/llvm-config-11$$BIN_EXTENSION) { + llvm_config = $$system_quote($$LLVM_INSTALL_DIR/bin/llvm-config-11) } else { llvm_config = $$system_quote($$LLVM_INSTALL_DIR/bin/llvm-config) requires(exists($$llvm_config$$BIN_EXTENSION)) @@ -163,10 +162,10 @@ isEmpty(LLVM_VERSION) { $$llvmWarningOrError(\ "Cannot determine clang version. Set LLVM_INSTALL_DIR to build the Clang Code Model",\ "LLVM_INSTALL_DIR does not contain a valid llvm-config, candidate: $$llvm_config") -} else:!versionIsAtLeast($$LLVM_VERSION, 8, 0, 0): { +} else:!versionIsAtLeast($$LLVM_VERSION, 9, 0, 0): { # CLANG-UPGRADE-CHECK: Adapt minimum version numbers. $$llvmWarningOrError(\ - "LLVM/Clang version >= 8.0.0 required, version provided: $$LLVM_VERSION") + "LLVM/Clang version >= 9.0.0 required, version provided: $$LLVM_VERSION") LLVM_VERSION = } else { # CLANG-UPGRADE-CHECK: Remove suppression if this warning is resolved. diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index dd89c25448a..3e0686fe136 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -421,11 +421,12 @@ public: ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); } ProFunctionDef(ProFunctionDef &&other) Q_DECL_NOTHROW : m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; } - ~ProFunctionDef() { m_pro->deref(); } + ~ProFunctionDef() { if (m_pro) m_pro->deref(); } ProFunctionDef &operator=(const ProFunctionDef &o) { if (this != &o) { - m_pro->deref(); + if (m_pro) + m_pro->deref(); m_pro = o.m_pro; m_pro->ref(); m_offset = o.m_offset; diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index 9288d9e8876..724bd9624b1 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -1143,6 +1143,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( for (const ProString &val : vals) { QString rstr = val.toQString(m_tmp1); QString copy = rstr; // Force a detach on modify + Q_UNUSED(copy) rstr.replace(before, after); ret << (rstr.isSharedWith(m_tmp1) ? val diff --git a/src/shared/qbs b/src/shared/qbs index 6383cac9275..f89169ccb86 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 6383cac9275369220f7e547ed6ccd26e8f81dc31 +Subproject commit f89169ccb8651613e5c97bd7db62a0d10e969e97 diff --git a/src/shared/qtsingleapplication/qtlocalpeer.cpp b/src/shared/qtsingleapplication/qtlocalpeer.cpp index 2b3b8745ef6..df66d5d7112 100644 --- a/src/shared/qtsingleapplication/qtlocalpeer.cpp +++ b/src/shared/qtsingleapplication/qtlocalpeer.cpp @@ -48,7 +48,12 @@ static const char ack[] = "ack"; QString QtLocalPeer::appSessionId(const QString &appId) { QByteArray idc = appId.toUtf8(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + quint16 idNum = qChecksum(idc); +#else quint16 idNum = qChecksum(idc.constData(), idc.size()); +#endif + //### could do: two 16bit checksums over separate halves of id, for a 32bit result - improved uniqeness probability. Every-other-char split would be best. QString res = QLatin1String("qtsingleapplication-") diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 80febccf1f7..5c0f56e288b 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2440,8 +2440,10 @@ void tst_Dumpers::dumper_data() + Check("h2", "<3 items>", "@QHash") + Check("h2.0", "[0] 0", FloatValue("33"), "") - + Check("h2.1", "[1] 22", FloatValue("22"), "") - + Check("h2.2", "[2] 11", FloatValue("11"), "") + + Check5("h2.1", "[1] 22", FloatValue("22"), "") + + Check5("h2.2", "[2] 11", FloatValue("11"), "") + + Check6("h2.1", "[1] 11", FloatValue("11"), "") + + Check6("h2.2", "[2] 22", FloatValue("22"), "") + Check("h3", "<1 items>", "@QHash<@QString, int>") + Check("h3.0.key", "key", "\"22.0\"", "@QString") @@ -2470,11 +2472,14 @@ void tst_Dumpers::dumper_data() + CheckType("h7.2.value", "@QPointer<@QObject>") + Check("h8", "<3 items>", TypeDef("@QHash", "Hash")) - + Check("h8.0", "[0] 22", FloatValue("22"), "") - + Check("it1.key", "22", "int") - + Check("it1.value", FloatValue("22"), "float") - + Check("it3.key", "33", "int") - + Check("it3.value", FloatValue("33"), "float"); + + Check5("h8.0", "[0] 22", FloatValue("22"), "") + + Check6("h8.0", "[0] 33", FloatValue("33"), "") + + // FIXME: Qt6 QHash::iterator broken. + + Check5("it1.key", "22", "int") + + Check5("it1.value", FloatValue("22"), "float") + + Check5("it3.key", "33", "int") + + Check5("it3.value", FloatValue("33"), "float"); QTest::newRow("QHostAddress") @@ -3319,10 +3324,14 @@ void tst_Dumpers::dumper_data() "region0 = region;\n" "region += QRect(100, 100, 200, 200);\n" "region1 = region;\n" + "#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)\n" "QVector rects = region1.rects(); // Warm up internal cache.\n" + "(void) rects;\n" + "#endif\n" + "QRect b = region1.boundingRect(); // Warm up internal cache.\n" "region += QRect(300, 300, 400, 500);\n" "region2 = region;", - "®ion0, ®ion1, ®ion2, &rects") + "®ion0, ®ion1, ®ion2, &b") + GuiProfile() @@ -3339,7 +3348,8 @@ void tst_Dumpers::dumper_data() + Check("region2.innerArea", "200000", "int") + Check("region2.innerRect", "400x500+300+300", "@QRect") + Check("region2.numRects", "2", "int") - + Check("region2.rects", "<2 items>", "@QVector<@QRect>"); + + Check5("region2.rects", "<2 items>", "@QVector<@QRect>") + + Check6("region2.rects", "<2 items>", "@QList<@QRect>"); QTest::newRow("QSettings") @@ -3583,7 +3593,8 @@ void tst_Dumpers::dumper_data() + QmlPrivateProfile() - + Check("l", "\"Hi\"", "@QLazilyAllocated<@QString>"); + // Qt 6 has QLazilyAllocated here. + + Check("l", "\"Hi\"", TypePattern("@QLazilyAllocated<@QString.*>")); QTest::newRow("QFiniteStack") @@ -3800,7 +3811,7 @@ void tst_Dumpers::dumper_data() expected1.append(QChar(1)); expected1.append("BBB\""); - QChar oUmlaut = 0xf6; + QChar oUmlaut = QChar(0xf6); QTest::newRow("QString") << Data("#include \n" @@ -5957,7 +5968,7 @@ void tst_Dumpers::dumper_data() + Check("a1.0.2", "[2]", FloatValue("20"), "double") + Check("a1.2", "[2]", Pointer(), "double[4]") - + Check("a2", Value("\"abcd" + QString(16, 0) + '"'), "char [20]") + + Check("a2", Value("\"abcd" + QString(16, QChar(0)) + '"'), "char [20]") + Check("a2.0", "[0]", "97", "char") + Check("a2.3", "[3]", "100", "char"); diff --git a/tests/unit/unittest/CMakeLists.txt b/tests/unit/unittest/CMakeLists.txt index e28079d40b8..f4b1c274ec4 100644 --- a/tests/unit/unittest/CMakeLists.txt +++ b/tests/unit/unittest/CMakeLists.txt @@ -1,3 +1,8 @@ +if (NOT QTC_CLANG_BUILDMODE_MATCH) + message(STATUS "Skipping unittest due to build mode mismatch") + return() +endif() + find_package(Googletest MODULE) find_package(GoogleBenchmark MODULE) @@ -193,6 +198,10 @@ function(extend_qtc_test_with_target_sources target) cmake_parse_arguments(_arg "" "" "DEFINES;INCLUDES" ${ARGN}) get_target_property(${target}Sources ${target} SOURCES) + # work around issue with CMake < 3.14 where target sources can contain + # $ + list(FILTER ${target}Sources EXCLUDE REGEX "^\\$