diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cf66c74aa7..926cd34165c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(FeatureSummary) include(QtCreatorIDEBranding) +include(QtCreatorTranslations) set(IDE_REVISION FALSE CACHE BOOL "Marks the presence of IDE revision string.") set(IDE_REVISION_STR "" CACHE STRING "The IDE revision string.") diff --git a/cmake/QtCreatorTranslations.cmake b/cmake/QtCreatorTranslations.cmake new file mode 100644 index 00000000000..dd0dae68758 --- /dev/null +++ b/cmake/QtCreatorTranslations.cmake @@ -0,0 +1,167 @@ +# Defines function add_translation_targets + +function(_extract_ts_data_from_targets outprefix) + set(_sources "") + set(_includes "") + + set(_targets "${ARGN}") + list(REMOVE_DUPLICATES _targets) + + foreach(t IN ITEMS ${_targets}) + if (TARGET "${t}") + get_target_property(_skip_translation "${t}" QT_SKIP_TRANSLATION) + get_target_property(_source_dir "${t}" SOURCE_DIR) + get_target_property(_interface_include_dirs "${t}" INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(_include_dirs "${t}" INCLUDE_DIRECTORIES) + get_target_property(_source_files "${t}" SOURCES) + get_target_property(_extra_translations "${t}" QT_EXTRA_TRANSLATIONS) + + if (NOT _skip_translation) + if(_include_dirs) + list(APPEND _includes ${_include_dirs}) + endif() + + if(_interface_include_dirs) + list(APPEND _interface_includes ${_include_dirs}) + endif() + + set(_target_sources "") + if(_source_files) + list(APPEND _target_sources ${_source_files}) + endif() + if(_extra_translations) + list(APPEND _target_sources ${_extra_translations}) + endif() + foreach(s IN ITEMS ${_target_sources}) + get_filename_component(_abs_source "${s}" ABSOLUTE BASE_DIR "${_source_dir}") + list(APPEND _sources "${_abs_source}") + endforeach() + endif() + endif() + endforeach() + + set("${outprefix}_sources" "${_sources}" PARENT_SCOPE) + set("${outprefix}_includes" "${_includes}" PARENT_SCOPE) +endfunction() + +function(_create_ts_custom_target name) + cmake_parse_arguments(_arg "" "FILE_PREFIX;TS_TARGET_PREFIX" "LANGUAGES;SOURCES;INCLUDES" ${ARGN}) + if (_arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Invalid parameters to _create_ts_custom_target: ${_arg_UNPARSED_ARGUMENTS}.") + endif() + + if (NOT _arg_TS_TARGET_PREFIX) + set(_arg_TS_TARGET_PREFIX "ts_") + endif() + + set(ts_languages ${_arg_LANGUAGES}) + if (NOT ts_languages) + set(ts_languages "${name}") + endif() + + foreach(l IN ITEMS ${ts_languages}) + list(APPEND ts_files "${CMAKE_CURRENT_SOURCE_DIR}/${_arg_FILE_PREFIX}_${l}.ts") + endforeach() + + set(_sources "${_arg_SOURCES}") + list(SORT _sources) + + set(_includes "${_arg_INCLUDES}") + + list(REMOVE_DUPLICATES _sources) + list(REMOVE_DUPLICATES _includes) + + list(REMOVE_ITEM _sources "") + list(REMOVE_ITEM _includes "") + + set(_prepended_includes) + foreach(include IN LISTS _includes) + list(APPEND _prepended_includes "-I${include}") + endforeach() + set(_includes "${_prepended_includes}") + + string(REPLACE ";" "\n" _sources_str "${_sources}") + string(REPLACE ";" "\n" _includes_str "${_includes}") + + set(ts_file_list "${CMAKE_CURRENT_BINARY_DIR}/ts_${name}.lst") + file(WRITE "${ts_file_list}" "${_sources_str}\n${_includes_str}\n") + + add_custom_target("${_arg_TS_TARGET_PREFIX}${name}" + COMMAND Qt5::lupdate -locations relative -no-ui-lines -no-sort "@${ts_file_list}" -ts ${ts_files} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generate .ts files" + DEPENDS ${_sources} + VERBATIM) +endfunction() + +function(add_translation_targets file_prefix) + if (NOT TARGET Qt5::lrelease) + # No Qt translation tools were found: Skip this directory + message(WARNING "No Qt translation tools found, skipping translation targets. Add find_package(Qt5 COMPONENTS LinguistTools) to CMake to enable.") + return() + endif() + + cmake_parse_arguments(_arg "" + "OUTPUT_DIRECTORY;INSTALL_DESTINATION;TS_TARGET_PREFIX;QM_TARGET_PREFIX;ALL_QM_TARGET" + "LANGUAGES;TARGETS;SOURCES;INCLUDES" ${ARGN}) + if (_arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Invalid parameters to add_translation_targets: ${_arg_UNPARSED_ARGUMENTS}.") + endif() + + if (NOT _arg_TS_TARGET_PREFIX) + set(_arg_TS_TARGET_PREFIX "ts_") + endif() + + if (NOT _arg_QM_TARGET_PREFIX) + set(_arg_QM_TARGET_PREFIX "generate_qm_file_") + endif() + + if (NOT _arg_ALL_QM_TARGET) + set(_arg_ALL_QM_TARGET "generate_qm_files") + endif() + + if (NOT _arg_OUTPUT_DIRECTORY) + set(_arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + endif() + + if (NOT _arg_INSTALL_DESTINATION) + message(FATAL_ERROR "Please provide a INSTALL_DESTINATION to add_translation_targets") + endif() + + _extract_ts_data_from_targets(_to_process "${_arg_TARGETS}") + + _create_ts_custom_target(untranslated + FILE_PREFIX "${file_prefix}" TS_TARGET_PREFIX "${_arg_TS_TARGET_PREFIX}" + SOURCES ${_to_process_sources} ${_arg_SOURCES} INCLUDES ${_to_process_includes} ${_arg_INCLUDES}) + + if (NOT TARGET "${_arg_ALL_QM_TARGET}") + add_custom_target("${_arg_ALL_QM_TARGET}" ALL COMMENT "Generate .qm-files") + endif() + + foreach(l IN ITEMS ${_arg_LANGUAGES}) + set(_ts_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}_${l}.ts") + set(_qm_file "${_arg_OUTPUT_DIRECTORY}/${file_prefix}_${l}.qm") + + _create_ts_custom_target("${l}" FILE_PREFIX "${file_prefix}" TS_TARGET_PREFIX "${_arg_TS_TARGET_PREFIX}" + SOURCES ${_to_process_sources} ${_arg_SOURCES} INCLUDES ${_to_process_includes} ${_arg_INCLUDES}) + + add_custom_command(OUTPUT "${_qm_file}" + COMMAND Qt5::lrelease "${_ts_file}" -qm "${_qm_file}" + MAIN_DEPENDENCY "${_ts_file}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generate .qm file" + VERBATIM) + add_custom_target("${_arg_QM_TARGET_PREFIX}${l}" DEPENDS "${_qm_file}") + install(FILES "${_qm_file}" DESTINATION ${_arg_INSTALL_DESTINATION}) + + add_dependencies("${_arg_ALL_QM_TARGET}" "${_arg_QM_TARGET_PREFIX}${l}") + endforeach() + + _create_ts_custom_target(all + LANGUAGES ${_arg_LANGUAGES} + TS_TARGET_PREFIX "${_arg_TS_TARGET_PREFIX}" + FILE_PREFIX "${file_prefix}" + SOURCES ${_to_process_sources} ${_arg_SOURCES} + INCLUDES ${_to_process_includes} ${_arg_INCLUDES} + ) +endfunction() diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc index 3892672a1d7..89a6b7742d9 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc @@ -45,25 +45,16 @@ scene did not contain them, you can add the corresponding Qt Quick 3D types from the \uicontrol Library. - You can use the manipulator mode toolbar buttons (2) to show the move, rotate, - or scale manipulator in the rendered scene when an item is selected and - to determine what happens when you drag the selected item. Select the - \uicontrol {Toggle Local/Global Orientation} button (3) to determine whether - the manipulators affect only the local transforms of the item or whether - they transform with respect to the global space. + You can use the toolbar buttons (2) to show the \e transformation + gizmo in the \uicontrol {3D Editor} when an item is selected + and to determine what happens when you drag the selected item. + Transformation refers to moving, rotating, or scaling of an object. + Select the \uicontrol {Toggle Local/Global Orientation} button (3) to + determine whether the gizmos affect only the local transformations of the + item or whether they transform with respect to the global space. \image studio-3d-editor.png "3D Editor" - For example, in local orientation mode, selecting an unrotated cube inside - a rotated group in the move mode shows rotated axes. Dragging on the red - arrow of the move manipulator affects only the x position of the item. - - In global mode, the manipulators always transform with respect to the global - space. In the example above, switching to global mode will show the red - arrow for the move manipulator aligned with the screen (assuming an - unrotated camera). Dragging on the red arrow may affect two or three of the - position values for the selected item in order to move it in global space. - The \e pivot of the component is used as the origin for position, scale, and rotation operations. You can set a \l{Setting Transform Properties} {local pivot offset} for an item in the \uicontrol Properties view to @@ -153,6 +144,23 @@ To freely rotate the item, select the gray circle. + \section1 Using Global and Local Orientation + + To switch between global and local orientation, select \uicontrol + {Toggle Local/Global Orientation}. + + In global orientation mode, transformation of a selected object is presented + with respect to the global space. For example, while the move tool is + selected, selecting a cube will show its move gizmo aligned with the axes + of global space. Dragging on the red arrow of the gizmo moves the object in + the global x direction. + + In local orientation mode, the position of a selected object is shown + according to local axes specific to the selected object. For example, + selecting a rotated cube will show its axes rotated, and not aligned with + the axes of global space. Dragging on the red arrow of the gizmo + moves the object in the local x direction in relation to the object. + \section1 Scaling Items \image studio-3d-editor-scale.png "3D editor in scale mode" diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs index 0af5c7e9001..38ac963183e 100644 --- a/qbs/imports/QtcProduct.qbs +++ b/qbs/imports/QtcProduct.qbs @@ -36,6 +36,11 @@ Product { cpp.cxxFlags: { var flags = []; + if (qbs.toolchain.contains("clang") + && Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) { + // Triggers a lot in Qt. + flags.push("-Wno-deprecated-copy", "-Wno-constant-logical-operand"); + } if (qbs.toolchain.contains("gcc") && !qbs.toolchain.contains("clang")) { flags.push("-Wno-noexcept-type"); if (Utilities.versionCompare(cpp.compilerVersion, "9") >= 0) diff --git a/qbs/modules/libclang/functions.js b/qbs/modules/libclang/functions.js index d1bd2dd2ea8..0c15a2a6283 100644 --- a/qbs/modules/libclang/functions.js +++ b/qbs/modules/libclang/functions.js @@ -3,6 +3,7 @@ var File = require("qbs.File") var FileInfo = require("qbs.FileInfo") var MinimumLLVMVersion = "8.0.0" // CLANG-UPGRADE-CHECK: Adapt minimum version numbers. var Process = require("qbs.Process") +var Utilities = require("qbs.Utilities") function readOutput(executable, args) { @@ -108,6 +109,8 @@ function formattingLibs(llvmConfig, qtcFunctions, targetOS) return []; var clangVersion = version(llvmConfig) + if (Utilities.versionCompare(clangVersion, "10") >= 0) + return []; var libs = [] if (qtcFunctions.versionIsAtLeast(clangVersion, MinimumLLVMVersion)) { if (qtcFunctions.versionIsAtLeast(clangVersion, "8.0.0")) { diff --git a/qbs/modules/libclang/libclang.qbs b/qbs/modules/libclang/libclang.qbs index 9c2cfae23d1..bb2878f1980 100644 --- a/qbs/modules/libclang/libclang.qbs +++ b/qbs/modules/libclang/libclang.qbs @@ -64,7 +64,8 @@ Module { return incl != llvmIncludeDir; }) property stringList llvmToolingCxxFlags: clangProbe.llvmToolingCxxFlags - property bool toolingEnabled: !Environment.getEnv("QTC_DISABLE_CLANG_REFACTORING") + property bool toolingEnabled: Utilities.versionCompare(llvmVersion, "10") < 0 + && !Environment.getEnv("QTC_DISABLE_CLANG_REFACTORING") validate: { if (!clangProbe.found) { diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py index 45c16765d3d..97c4829745e 100755 --- a/scripts/build_plugin.py +++ b/scripts/build_plugin.py @@ -48,6 +48,9 @@ def get_arguments(): parser.add_argument('--output-path', help='Output path for resulting 7zip files') parser.add_argument('--add-path', help='Adds a CMAKE_PREFIX_PATH to the build', action='append', dest='prefix_paths', default=[]) + parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. ' + 'Use "--add-config=-DSOMEVAR=SOMEVALUE" if the argument begins with a dash.'), + action='append', dest='config_args', default=[]) parser.add_argument('--deploy', help='Installs the "Dependencies" component of the plugin.', action='store_true', default=False) parser.add_argument('--debug', help='Enable debug builds', action='store_true', default=False) @@ -82,6 +85,7 @@ def build(args, paths): with open(os.path.join(paths.result, args.name + '.7z.git_sha'), 'w') as f: f.write(ide_revision) + cmake_args += args.config_args common.check_print_call(cmake_args + [paths.src], paths.build) common.check_print_call(['cmake', '--build', '.'], paths.build) common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--strip'], diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index cc8c4b4f8f5..9f04812af91 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -25,6 +25,7 @@ pragma Singleton import QtQuick 2.12 +import QtQuickDesignerTheme 1.0 QtObject { id: values diff --git a/share/qtcreator/translations/CMakeLists.txt b/share/qtcreator/translations/CMakeLists.txt index 7b4d29bd77c..d8ade110bc1 100644 --- a/share/qtcreator/translations/CMakeLists.txt +++ b/share/qtcreator/translations/CMakeLists.txt @@ -44,168 +44,6 @@ else() VERBATIM) endif() -function(_extract_ts_data_from_targets outprefix) - set(_sources "") - set(_includes "") - - set(_targets "${ARGN}") - list(REMOVE_DUPLICATES _targets) - - foreach(t IN ITEMS ${_targets}) - if (TARGET "${t}") - get_target_property(_skip_translation "${t}" QT_SKIP_TRANSLATION) - get_target_property(_source_dir "${t}" SOURCE_DIR) - get_target_property(_interface_include_dirs "${t}" INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(_include_dirs "${t}" INCLUDE_DIRECTORIES) - get_target_property(_source_files "${t}" SOURCES) - get_target_property(_extra_translations "${t}" QT_EXTRA_TRANSLATIONS) - - if (NOT _skip_translation) - if(_include_dirs) - list(APPEND _includes ${_include_dirs}) - endif() - - if(_interface_include_dirs) - list(APPEND _interface_includes ${_include_dirs}) - endif() - - set(_target_sources "") - if(_source_files) - list(APPEND _target_sources ${_source_files}) - endif() - if(_extra_translations) - list(APPEND _target_sources ${_extra_translations}) - endif() - foreach(s IN ITEMS ${_target_sources}) - get_filename_component(_abs_source "${s}" ABSOLUTE BASE_DIR "${_source_dir}") - list(APPEND _sources "${_abs_source}") - endforeach() - endif() - endif() - endforeach() - - set("${outprefix}_sources" "${_sources}" PARENT_SCOPE) - set("${outprefix}_includes" "${_includes}" PARENT_SCOPE) -endfunction() - -function(_create_ts_custom_target name) - cmake_parse_arguments(_arg "" "FILE_PREFIX;TS_TARGET_PREFIX" "LANGUAGES;SOURCES;INCLUDES" ${ARGN}) - if (_arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Invalid parameters to _create_ts_custom_target: ${_arg_UNPARSED_ARGUMENTS}.") - endif() - - if (NOT _arg_TS_TARGET_PREFIX) - set(_arg_TS_TARGET_PREFIX "ts_") - endif() - - set(ts_languages ${_arg_LANGUAGES}) - if (NOT ts_languages) - set(ts_languages "${name}") - endif() - - foreach(l IN ITEMS ${ts_languages}) - list(APPEND ts_files "${CMAKE_CURRENT_SOURCE_DIR}/${_arg_FILE_PREFIX}_${l}.ts") - endforeach() - - set(_sources "${_arg_SOURCES}") - list(SORT _sources) - - set(_includes "${_arg_INCLUDES}") - - list(REMOVE_DUPLICATES _sources) - list(REMOVE_DUPLICATES _includes) - - list(REMOVE_ITEM _sources "") - list(REMOVE_ITEM _includes "") - - set(_prepended_includes) - foreach(include IN LISTS _includes) - list(APPEND _prepended_includes "-I${include}") - endforeach() - set(_includes "${_prepended_includes}") - - string(REPLACE ";" "\n" _sources_str "${_sources}") - string(REPLACE ";" "\n" _includes_str "${_includes}") - - set(ts_file_list "${CMAKE_CURRENT_BINARY_DIR}/ts_${name}.lst") - file(WRITE "${ts_file_list}" "${_sources_str}\n${_includes_str}\n") - - add_custom_target("${_arg_TS_TARGET_PREFIX}${name}" - COMMAND Qt5::lupdate -locations relative -no-ui-lines -no-sort "@${ts_file_list}" -ts ${ts_files} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Generate .ts files" - DEPENDS ${_sources} - VERBATIM) -endfunction() - -function(add_translation_targets file_prefix) - if (NOT TARGET Qt5::lrelease) - # No Qt translation tools were found: Skip this directory - message(WARNING "No Qt translation tools found, skipping translation targets. Add find_package(Qt5 COMPONENTS LinguistTools) to CMake to enable.") - return() - endif() - - cmake_parse_arguments(_arg "" - "OUTPUT_DIRECTORY;INSTALL_DESTINATION;TS_TARGET_PREFIX;QM_TARGET_PREFIX;ALL_QM_TARGET" - "LANGUAGES;TARGETS;SOURCES;INCLUDES" ${ARGN}) - if (_arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Invalid parameters to add_translation_targets: ${_arg_UNPARSED_ARGUMENTS}.") - endif() - - if (NOT _arg_TS_TARGET_PREFIX) - set(_arg_TS_TARGET_PREFIX "ts_") - endif() - - if (NOT _arg_QM_TARGET_PREFIX) - set(_arg_QM_TARGET_PREFIX "generate_qm_file_") - endif() - - if (NOT _arg_ALL_QM_TARGET) - set(_arg_ALL_QM_TARGET "generate_qm_files") - endif() - - if (NOT _arg_OUTPUT_DIRECTORY) - set(_arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") - endif() - - if (NOT _arg_INSTALL_DESTINATION) - message(FATAL_ERROR "Please provide a INSTALL_DESTINATION to add_translation_targets") - endif() - - _extract_ts_data_from_targets(_to_process "${_arg_TARGETS}") - - _create_ts_custom_target(untranslated - FILE_PREFIX "${file_prefix}" TS_TARGET_PREFIX "${_arg_TS_TARGET_PREFIX}" - SOURCES ${_to_process_sources} ${_arg_SOURCES} INCLUDES ${_to_process_includes} ${_arg_INCLUDES}) - - if (NOT TARGET "${_arg_ALL_QM_TARGET}") - add_custom_target("${_arg_ALL_QM_TARGET}" ALL COMMENT "Generate .qm-files") - endif() - - foreach(l IN ITEMS ${_arg_LANGUAGES}) - set(_ts_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}_${l}.ts") - set(_qm_file "${_arg_OUTPUT_DIRECTORY}/${file_prefix}_${l}.qm") - - _create_ts_custom_target("${l}" FILE_PREFIX "${file_prefix}" TS_TARGET_PREFIX "${_arg_TS_TARGET_PREFIX}" - SOURCES ${_to_process_sources} ${_arg_SOURCES} INCLUDES ${_to_process_includes} ${_arg_INCLUDES}) - - add_custom_command(OUTPUT "${_qm_file}" - COMMAND Qt5::lrelease "${_ts_file}" -qm "${_qm_file}" - MAIN_DEPENDENCY "${_ts_file}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Generate .qm file" - VERBATIM) - add_custom_target("${_arg_QM_TARGET_PREFIX}${l}" DEPENDS "${_qm_file}") - install(FILES "${_qm_file}" DESTINATION ${_arg_INSTALL_DESTINATION}) - - add_dependencies("${_arg_ALL_QM_TARGET}" "${_arg_QM_TARGET_PREFIX}${l}") - endforeach() - - _create_ts_custom_target(all LANGUAGES ${_arg_LANGUAGES} FILE_PREFIX "${file_prefix}" - SOURCES ${_to_process_sources} ${_arg_SOURCES} INCLUDES ${_to_process_includes} ${_arg_INCLUDES}) -endfunction() - -### collect targets to include in documentation: add_translation_targets(qtcreator LANGUAGES ${languages} OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/translations" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a04ed8a959b..25276f1de1e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,6 +49,10 @@ if (NOT DEFINED add_qtc_plugin) include(\${CMAKE_CURRENT_LIST_DIR}/QtCreatorAPI.cmake) endif() +if (NOT DEFINED add_translation_targets) + include(\${CMAKE_CURRENT_LIST_DIR}/QtCreatorTranslations.cmake) +endif() + if (NOT TARGET QtCreator::Core) include(\${CMAKE_CURRENT_LIST_DIR}/QtCreatorTargets.cmake) endif() @@ -61,6 +65,7 @@ export(EXPORT QtCreator file(COPY ${PROJECT_SOURCE_DIR}/cmake/QtCreatorIDEBranding.cmake + ${PROJECT_SOURCE_DIR}/cmake/QtCreatorTranslations.cmake ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake DESTINATION ${CMAKE_BINARY_DIR}/cmake ) @@ -69,6 +74,7 @@ file(COPY install( FILES ${PROJECT_SOURCE_DIR}/cmake/QtCreatorIDEBranding.cmake + ${PROJECT_SOURCE_DIR}/cmake/QtCreatorTranslations.cmake ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake ${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake DESTINATION lib/cmake/QtCreator diff --git a/src/libs/clangsupport/CMakeLists.txt b/src/libs/clangsupport/CMakeLists.txt index 093213147b2..20af2c1b9d2 100644 --- a/src/libs/clangsupport/CMakeLists.txt +++ b/src/libs/clangsupport/CMakeLists.txt @@ -153,13 +153,10 @@ add_custom_target(copy_clang_to_builddir ALL # For the developer build directory add_custom_command(TARGET copy_clang_to_builddir POST_BUILD - COMMAND "${CMAKE_COMMAND}" - -E make_directory - "${PROJECT_BINARY_DIR}/${IDE_LIBEXEC_PATH}/clang/lib/clang/${CLANG_VERSION}" COMMAND "${CMAKE_COMMAND}" -E copy_directory "${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}/include" - "${PROJECT_BINARY_DIR}/${IDE_LIBEXEC_PATH}/clang/lib/clang/${CLANG_VERSION}" + "${PROJECT_BINARY_DIR}/${IDE_LIBEXEC_PATH}/clang/lib/clang/${CLANG_VERSION}/include" VERBATIM ) diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index 2bd1bd68459..e0f6e9cdb97 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -306,7 +306,43 @@ public: QmlDesigner_BorderColor, QmlDesigner_FormeditorBackgroundColor, QmlDesigner_AlternateBackgroundColor, - QmlDesigner_ScrollBarHandleColor + QmlDesigner_ScrollBarHandleColor, + + /* Palette for DS Controls */ + + DScontrolBackground, + DScontrolOutline, + DStextColor, + DSdisabledTextColor, + DSpanelBackground, + DShoverHighlight, + DScolumnBackground, + DSfocusEdit, + DSfocusDrag, + DScontrolBackgroundPressed, + DScontrolBackgroundChecked, + DSinteraction, + DSsliderActiveTrack, + DSsliderInactiveTrack, + DSsliderHandle, + DSsliderActiveTrackHover, + DSsliderInactiveTrackHover, + DSsliderHandleHover, + DSsliderActiveTrackFocus, + DSsliderInactiveTrackFocus, + DSsliderHandleFocus, + DSerrorColor, + DScontrolBackgroundDisabled, + DScontrolOutlineDisabled, + DStextColorDisabled, + DStextSelectionColor, + DStextSelectedTextColor, + DSscrollBarTrack, + DSscrollBarHandle, + DScontrolBackgroundInteraction, + DStranslationIndicatorBorder, + DSsectionHeadBackground, + DSchangedStateText }; enum Gradient { diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 723f402e4f9..0af2a737358 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1298,15 +1298,14 @@ static QVariant findOrRegisterDebugger(ToolChain *tc, void AndroidConfigurations::updateAutomaticKitList() { - const QList androidKits = Utils::filtered(KitManager::kits(), [](Kit *k) { - Core::Id deviceTypeId = DeviceTypeKitAspect::deviceTypeId(k); - return deviceTypeId == Core::Id(Constants::ANDROID_DEVICE_TYPE); - }); - - for (auto k: androidKits) { - if (k->value(Constants::ANDROID_KIT_NDK).isNull() || k->value(Constants::ANDROID_KIT_SDK).isNull()) { - k->setValueSilently(Constants::ANDROID_KIT_NDK, currentConfig().ndkLocation(QtSupport::QtKitAspect::qtVersion(k)).toString()); - k->setValue(Constants::ANDROID_KIT_SDK, currentConfig().sdkLocation().toString()); + for (Kit *k : KitManager::kits()) { + if (DeviceTypeKitAspect::deviceTypeId(k) == Constants::ANDROID_DEVICE_TYPE) { + if (k->value(Constants::ANDROID_KIT_NDK).isNull() || k->value(Constants::ANDROID_KIT_SDK).isNull()) { + if (BaseQtVersion *qt = QtKitAspect::qtVersion(k)) { + k->setValueSilently(Constants::ANDROID_KIT_NDK, currentConfig().ndkLocation(qt).toString()); + k->setValue(Constants::ANDROID_KIT_SDK, currentConfig().sdkLocation().toString()); + } + } } } diff --git a/src/plugins/android/androiddevicedialog.cpp b/src/plugins/android/androiddevicedialog.cpp index a2783d4d514..35da26b24cd 100644 --- a/src/plugins/android/androiddevicedialog.cpp +++ b/src/plugins/android/androiddevicedialog.cpp @@ -483,8 +483,12 @@ AndroidDeviceDialog::~AndroidDeviceDialog() AndroidDeviceInfo AndroidDeviceDialog::device() { + refreshDeviceList(); + if (!m_defaultDevice.isEmpty()) { - auto device = std::find_if(m_connectedDevices.begin(), m_connectedDevices.end(), [this](const AndroidDeviceInfo& info) { + auto device = std::find_if(m_connectedDevices.begin(), + m_connectedDevices.end(), + [this](const AndroidDeviceInfo &info) { return info.serialNumber == m_defaultDevice || info.avdname == m_defaultDevice; }); @@ -494,8 +498,6 @@ AndroidDeviceInfo AndroidDeviceDialog::device() m_defaultDevice.clear(); } - refreshDeviceList(); - if (exec() == QDialog::Accepted) return m_model->device(m_ui->deviceView->currentIndex()); return AndroidDeviceInfo(); diff --git a/src/plugins/mcusupport/mcusupportoptionspage.cpp b/src/plugins/mcusupport/mcusupportoptionspage.cpp index 87652018c6c..a9d4ea8277b 100644 --- a/src/plugins/mcusupport/mcusupportoptionspage.cpp +++ b/src/plugins/mcusupport/mcusupportoptionspage.cpp @@ -231,7 +231,6 @@ void McuSupportOptionsWidget::apply() return; McuSupportOptions::registerQchFiles(); - McuSupportOptions::removeOutdatedKits(); const McuTarget *mcuTarget = currentMcuTarget(); if (!mcuTarget) diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp index 3028c7e80e2..07f54e061a6 100644 --- a/src/plugins/mcusupport/mcusupportplugin.cpp +++ b/src/plugins/mcusupport/mcusupportplugin.cpp @@ -33,10 +33,15 @@ #include #include #include +#include #include #include +#include +#include + +using namespace Core; using namespace ProjectExplorer; namespace McuSupport { @@ -86,6 +91,32 @@ bool McuSupportPlugin::initialize(const QStringList& arguments, QString* errorSt void McuSupportPlugin::extensionsInitialized() { ProjectExplorer::DeviceManager::instance()->addDevice(McuSupportDevice::create()); + + connect(KitManager::instance(), &KitManager::kitsLoaded, [](){ + McuSupportOptions::removeOutdatedKits(); + McuSupportPlugin::askUserAboutMcuSupportKitsSetup(); + }); +} + +void McuSupportPlugin::askUserAboutMcuSupportKitsSetup() +{ + const char setupMcuSupportKits[] = "SetupMcuSupportKits"; + + if (!ICore::infoBar()->canInfoBeAdded(setupMcuSupportKits) + || McuSupportOptions::qulDirFromSettings().isEmpty() + || !McuSupportOptions::existingKits(nullptr).isEmpty()) + return; + + InfoBarEntry info( + setupMcuSupportKits, + tr("Create Kits for Qt for MCUs? " + "To do it later, select Options > Devices > MCU."), + InfoBarEntry::GlobalSuppression::Enabled); + info.setCustomButtonInfo(tr("Create Kits for Qt for MCUs"), [setupMcuSupportKits] { + ICore::infoBar()->removeInfo(setupMcuSupportKits); + QTimer::singleShot(0, []() { ICore::showOptionsDialog(Constants::SETTINGS_ID); }); + }); + ICore::infoBar()->addInfo(info); } } // namespace Internal diff --git a/src/plugins/mcusupport/mcusupportplugin.h b/src/plugins/mcusupport/mcusupportplugin.h index 9a5def94fbb..2f7c24e6057 100644 --- a/src/plugins/mcusupport/mcusupportplugin.h +++ b/src/plugins/mcusupport/mcusupportplugin.h @@ -43,6 +43,7 @@ public: bool initialize(const QStringList &arguments, QString *errorString) override; void extensionsInitialized() override; + static void askUserAboutMcuSupportKitsSetup(); }; } // namespace Internal diff --git a/src/plugins/qmldesigner/components/connectioneditor/stylesheet.css b/src/plugins/qmldesigner/components/connectioneditor/stylesheet.css index aeacc637330..5155ac3efac 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/stylesheet.css +++ b/src/plugins/qmldesigner/components/connectioneditor/stylesheet.css @@ -40,7 +40,7 @@ QHeaderView::section { background-color: #494949; padding: 4px; border: 1px solid black; - color: #cacaca; + color: creatorTheme.DStextColor; margin: 2px } @@ -54,7 +54,7 @@ QWidget#widgetSpacer { QStackedWidget { border: 0px; - background-color: #4f4f4f; + background-color: creatorTheme.QmlDesigner_TabLight; } QTabBar::tab:selected { diff --git a/src/plugins/qmldesigner/components/resources/stylesheet.css b/src/plugins/qmldesigner/components/resources/stylesheet.css index 841540f1c87..cc72eae062d 100644 --- a/src/plugins/qmldesigner/components/resources/stylesheet.css +++ b/src/plugins/qmldesigner/components/resources/stylesheet.css @@ -51,12 +51,12 @@ QLineEdit#itemLibrarySearchInput QComboBox QAbstractItemView { show-decoration-selected: 1; /* make the selection span the entire width of the view */ - background-color: #494949; /* sets background of the menu */ + background-color: creatorTheme.DSpanelBackground; /* sets background of the menu */ border: 1px solid black; margin: 0px; /* some spacing around the menu */ - color: #cacaca; - selection-background-color: #d2d2d2; - selection-color: #404040; + color: creatorTheme.DStextColor; + selection-background-color: creatorTheme.DSinteraction; + selection-color: creatorTheme.DStextSelectedTextColor; } QTabWidget { diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 91e4c9c7b05..fd0d9a51ff6 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -982,9 +982,6 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH if (rewriterBenchmark().isInfoEnabled()) time.start(); - // maybe the project environment (kit, ...) changed, so we need to clean old caches - NodeMetaInfo::clearCache(); - const QUrl url = m_rewriterView->model()->fileUrl(); m_qrcMapping.clear(); @@ -994,6 +991,9 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH setActive(true); m_rewriterView->setIncompleteTypeInformation(false); + // maybe the project environment (kit, ...) changed, so we need to clean old caches + NodeMetaInfo::clearCache(); + try { Snapshot snapshot = m_rewriterView->textModifier()->qmljsSnapshot(); diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index ddf7be0ec18..379e225b609 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -309,7 +309,7 @@ void DesignModeWidget::setup() // Apply stylesheet to QWidget QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"); sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css"); - sheet += "QLabel { background-color: #4f4f4f; }"; + sheet += "QLabel { background-color: creatorTheme.DSsectionHeadBackground; }"; navigationView.widget->setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet))); // Create DockWidget diff --git a/tests/system/suite_debugger/tst_cli_output_console/test.py b/tests/system/suite_debugger/tst_cli_output_console/test.py index 9774ea59b23..3f996241af1 100644 --- a/tests/system/suite_debugger/tst_cli_output_console/test.py +++ b/tests/system/suite_debugger/tst_cli_output_console/test.py @@ -39,12 +39,15 @@ def main(): mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") replaceEditorContent(mainEditor, "") typeLines(mainEditor, ["#include ", + "#include ", "#include ", + "struct Waiter:public QThread{Waiter(){QThread::sleep(2);}};", "int main(int, char *argv[])", "{", 'std::cout << \"' + outputStdOut + '\" << std::endl;', 'std::cerr << \"' + outputStdErr + '\" << std::endl;', - 'qDebug() << \"' + outputQDebug + '\";']) + 'qDebug() << \"' + outputQDebug + '\";', + 'Waiter();']) # Rely on code completion for closing bracket invokeMenuItem("File", "Save All") openDocument(project + "." + project + "\\.pro")