Merge remote-tracking branch 'origin/4.15'

Change-Id: I0afcf51d354ffd73a8f2956a7f78b1e4f032677b
This commit is contained in:
Eike Ziller
2021-04-09 12:42:03 +02:00
79 changed files with 1144 additions and 290 deletions

2
coin/dependencies.yaml Normal file
View File

@@ -0,0 +1,2 @@
dependencies: {}

View File

@@ -0,0 +1,77 @@
type: Group
instructions:
- type: Group
enable_if:
condition: property
property: target.compiler
in_values: [MSVC2019]
instructions:
- type: EnvironmentVariable
variableName: MAKEFLAGS
variableValue: ""
- type: EnvironmentVariable
variableName: LLVM_INSTALL_DIR
variableValue: "{{.Env.LLVM_DYNAMIC_LIBS_100}}"
enable_if:
condition: property
property: target.arch
equals_value: X86_64
- type: EnvironmentVariable
variableName: LLVM_INSTALL_DIR
variableValue: "{{.Env.LLVM_DYNAMIC_LIBS_100}}"
enable_if:
condition: property
property: target.arch
equals_value: X86
- type: PrependToEnvironmentVariable
variableName: PATH
variableValue: "{{.InstallDir}}\\bin;"
enable_if:
condition: property
property: target.os
equals_value: Windows
- type: PrependToEnvironmentVariable
variableName: PATH
variableValue: "C:\\Utils\\gnuwin32\\bin;"
enable_if:
condition: property
property: target.os
equals_value: Windows
- type: EnvironmentVariable
variableName: LANG
variableValue: en_US.UTF-8
enable_if:
condition: property
property: host.os
in_values: [MacOS, Linux]
- type: Group
instructions:
- type: PrependToEnvironmentVariable
variableName: PATH
variableValue: "{{.InstallDir}}/bin:"
- type: EnvironmentVariable
variableName: DISPLAY
variableValue: ":0"
- type: PrependToEnvironmentVariable
variableName: PATH
variableValue: "/opt/rh/devtoolset-7/root/usr/bin:"
enable_if:
condition: property
property: host.os
equals_value: Linux
- type: Group
instructions:
- type: EnvironmentVariable
variableName: LLVM_INSTALL_DIR
variableValue: "{{.Env.LLVM_DYNAMIC_LIBS_100}}"
enable_if:
condition: property
property: host.os
in_values: [Linux, MacOS]

View File

@@ -0,0 +1,185 @@
type: Group
instructions:
- type: Group
instructions:
- type: ExecuteCommand
command: "mkdir {{.AgentWorkingDir}}/qt_temp"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to create folder qt_temp, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}/qt_temp/icu-linux-g++-Rhel7.2-x64.7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download icu package, check logs."
- type: ExecuteCommand
command: "/usr/bin/7z x -y {{.AgentWorkingDir}}/qt_temp/icu-linux-g++-Rhel7.2-x64.7z -o{{.InstallDir}}/lib"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract icu package, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}/qt_temp/elfutils-release_0.175qt-linux-x86_64.7z http://master.qt.io/development_releases/prebuilt/elfutils/elfutils-release_0.175qt-linux-x86_64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download elfutils package, check logs."
- type: ExecuteCommand
command: "/usr/bin/7z x -y {{.AgentWorkingDir}}/qt_temp/elfutils-release_0.175qt-linux-x86_64.7z -o{{.AgentWorkingDir}}/qt_temp/elfutils"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract elfutils package, check logs."
- type: ExecuteCommand
command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/qt_temp/elfutils"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs."
enable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_value: Linux
- condition: property
property: target.compiler
in_values: [GCC]
- type: Group
instructions:
- type: ExecuteCommand
command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --keychain-unlock-script /Users/qt/unlock-keychain.sh"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs."
enable_if:
condition: property
property: host.os
equals_value: MacOS
- type: Group
instructions:
- type: MakeDirectory
directory: "{{.AgentWorkingDir}}/qt_temp"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to create folder qt_temp, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}\\qt_temp\\elfutils-release_0.175qt-windows-x86_64.7z http://master.qt.io/development_releases/prebuilt/elfutils/elfutils-release_0.175qt-windows-x86_64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download elfutils package, check logs."
- type: ExecuteCommand
command: "C:\\Utils\\sevenzip\\7z.exe x -y {{.AgentWorkingDir}}\\qt_temp\\elfutils-release_0.175qt-windows-x86_64.7z -o{{.AgentWorkingDir}}\\qt_temp\\elfutils"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract elfutils package, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}\\qt_temp\\Python38-win-x64.7z http://master.qt.io/development_releases/prebuilt/python/Python38-win-x64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download python package, check logs."
- type: ExecuteCommand
command: "C:\\Utils\\sevenzip\\7z.exe x -y {{.AgentWorkingDir}}\\qt_temp\\Python38-win-x64.7z -o{{.AgentWorkingDir}}\\qt_temp\\python"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract python package, check logs."
- type: MakeDirectory
directory: "{{.AgentWorkingDir}}/qt_temp/openssl"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to create folder openssl, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}\\qt_temp\\openssl\\openssl_1.1.1d_prebuild_x64.7z http://ci-files02-hki.intra.qt.io/packages/jenkins/openssl/openssl_1.1.1d_prebuild_x64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download openssl package, check logs."
- type: ExecuteCommand
command: "C:\\Utils\\sevenzip\\7z.exe x -y {{.AgentWorkingDir}}\\qt_temp\\openssl\\openssl_1.1.1d_prebuild_x64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract openssl package, check logs."
- type: ExecuteCommand
command: "cmd copy {{.AgentWorkingDir}}\\qt_temp\\openssl\\openssl_1.1.1d_prebuild_x64\\Win_x64\\bin\\*.dll {{.InstallDir}}\\bin\\"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to copy openssl ddl's, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}\\qt_temp\\opengl32sw-64.7z http://master.qt.io/development_releases/prebuilt/llvmpipe/windows/opengl32sw-64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download opengl package, check logs."
- type: ExecuteCommand
command: "C:\\Utils\\sevenzip\\7z.exe x -y {{.AgentWorkingDir}}\\qt_temp\\opengl32sw-64.7z -o{{.InstallDir}}\\bin"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract opengl package, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}\\qt_temp\\d3dcompiler_47-x64.7z http://master.qt.io/development_releases/prebuilt/d3dcompiler/msvc2013/d3dcompiler_47-x64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download d3dcompiler package, check logs."
- type: ExecuteCommand
command: "C:\\Utils\\sevenzip\\7z.exe x -y {{.AgentWorkingDir}}\\qt_temp\\d3dcompiler_47-x64.7z -o{{.InstallDir}}\\bin"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract d3dcompiler package, check logs."
- type: ExecuteCommand
command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\qt_temp\\elfutils"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs."
enable_if:
condition: and
conditions:
- condition: property
property: target.compiler
in_values: [MSVC2013, MSVC2015, MSVC2017, MSVC2019]
- condition: property
property: target.arch
equals_value: X86_64
- type: Group
instructions:
- type: MakeDirectory
directory: "{{.AgentWorkingDir}}/qt_temp"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to create folder qt_temp, check logs."
- type: ExecuteCommand
command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}\\qt_temp\\Python38-win-x86.7z http://master.qt.io/development_releases/prebuilt/python/Python38-win-x86.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download python package, check logs."
- type: ExecuteCommand
command: "C:\\Utils\\sevenzip\\7z.exe x -y {{.AgentWorkingDir}}\\qt_temp\\Python38-win-x86.7z -o{{.AgentWorkingDir}}\\qt_temp\\python"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract python package, check logs."
- type: ExecuteCommand
command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\qt_temp\\python --no-qtcreator"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs."
enable_if:
condition: and
conditions:
- condition: property
property: target.compiler
in_values: [MSVC2013, MSVC2015, MSVC2017, MSVC2019]
- condition: property
property: target.arch
equals_value: X86
- type: SignPackage
directory: "{{.AgentWorkingDir}}/qt-creator/qt-creator_build/install/"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: UploadArtifact
archiveDirectory: "{{.AgentWorkingDir}}/qt-creator/qt-creator_build/install/"
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1800
maxTimeBetweenOutput: 1800

View File

@@ -0,0 +1,77 @@
type: Group
instructions:
- type: MakeDirectory
directory: ".git"
- type: SetBuildDirectory
directory: "{{.SourceDir}}"
disable_if:
condition: property
property: features
contains_value: OutOfSourceBuild
- type: Group
instructions:
- type: SetBuildDirectory
directory: "{{.AgentWorkingDir}}/build"
- type: MakeDirectory
directory: "{{.BuildDir}}"
enable_if:
condition: property
property: features
contains_value: OutOfSourceBuild
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: InstallSourceArchive
maxTimeInSeconds: 600
maxTimeBetweenOutput: 600
project: qtsdk/qtsdk
ref: master
directory: "build/qtsdk"
userMessageOnFailure: "Failed to install qtsdk, check logs"
enable_if:
condition: property
property: host.os
in_values: [MacOS, Linux, Windows]
- type: ExecuteCommand
command: "python -u /home/qt/work/build/qtsdk/packaging-tools/install_qt.py --qt-path /home/qt/work/build/qt5_install_dir --temp-path /home/qt/work/build/qt_temp --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qt5compat/qt5compat-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtbase/qtbase-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtdeclarative/qtdeclarative-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtgraphicaleffects/qtgraphicaleffects-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtimageformats/qtimageformats-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtlocation/qtlocation-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtmacextras/qtmacextras-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquick3d/qtquick3d-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquickcontrols/qtquickcontrols-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquickcontrols2/qtquickcontrols2-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquicktimeline/qtquicktimeline-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtscript/qtscript-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtserialport/qtserialport-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtshadertools/qtshadertools-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtsvg/qtsvg-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qttools/qttools-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qttranslations/qttranslations-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtx11extras/qtx11extras-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtxmlpatterns/qtxmlpatterns-Linux-CentOS_8_3-GCC-Linux-CentOS_8_3-X86_64.7z --qt-module file:///home/qt/work/build/downloads/qtdocumentation/qt-everywhere-documentation.7z --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to install qt, check logs."
enable_if:
condition: property
property: host.os
equals_value: Linux
- type: ExecuteCommand
command: "python -u /Users/qt/work/build/qtsdk/packaging-tools/install_qt.py --qt-path /Users/qt/work/build/qt5_install_dir --temp-path /Users/qt/work/build/qt_temp --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qt5compat/qt5compat-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtbase/qtbase-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtdeclarative/qtdeclarative-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtgraphicaleffects/qtgraphicaleffects-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtimageformats/qtimageformats-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtlocation/qtlocation-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtmacextras/qtmacextras-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquick3d/qtquick3d-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquickcontrols/qtquickcontrols-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquickcontrols2/qtquickcontrols2-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquicktimeline/qtquicktimeline-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtscript/qtscript-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtserialport/qtserialport-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtshadertools/qtshadertools-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtsvg/qtsvg-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qttools/qttools-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qttranslations/qttranslations-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtx11extras/qtx11extras-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtxmlpatterns/qtxmlpatterns-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64.7z --qt-module file:///Users/qt/work/build/downloads/qtdocumentation/qt-everywhere-documentation.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to install qt, check logs."
enable_if:
condition: property
property: host.os
equals_value: MacOS
- type: ExecuteCommand
command: "C:\\Python27\\Scripts\\pip.exe install pywin32"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 120
userMessageOnFailure: "Failed to install win32api, check logs."
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: ExecuteCommand
command: "python -u {{.AgentWorkingDir}}\\build\\qtsdk\\packaging-tools\\install_qt.py --qt-path {{.AgentWorkingDir}}\\build\\qt5_install_dir --temp-path {{.AgentWorkingDir}}\\build\\qt_temp --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qt5compat/qt5compat-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtbase/qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtdeclarative/qtdeclarative-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtgraphicaleffects/qtgraphicaleffects-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtimageformats/qtimageformats-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtlocation/qtlocation-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtmacextras/qtmacextras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquick3d/qtquick3d-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquickcontrols/qtquickcontrols-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquickcontrols2/qtquickcontrols2-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtquicktimeline/qtquicktimeline-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtscript/qtscript-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtserialport/qtserialport-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtshadertools/qtshadertools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtsvg/qtsvg-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qttools/qttools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qttranslations/qttranslations-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtx11extras/qtx11extras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z --qt-module http://ci-files02-hki-infra.intra.qt.io/packages/jenkins/qt/6.1.0/release_content//qtxmlpatterns/qtxmlpatterns-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z"
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to install qt, check logs."
enable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_value: Windows
- condition: property
property: target.arch
equals_value: X86_64
- !include "{{qt-creator/qt-creator}}/make_instructions.yaml"

68
coin/module_config.yaml Normal file
View File

@@ -0,0 +1,68 @@
version: 2
accept_configuration:
condition: or
conditions:
- condition: property
property: features
contains_value: LicenseCheck
- condition: and
conditions:
- condition: property
property: host.os
equals_value: Windows
- condition: property
property: host
equals_property: target
- condition: property
property: target.compiler
equals_value: MSVC2019
- condition: and
conditions:
- condition: property
property: host.os
equals_value: Linux
- condition: and
conditions:
- condition: property
property: host.os
equals_value: MacOS
run_license_check: &run_license_check
type: Group
enable_if:
condition: property
property: features
contains_value: LicenseCheck
instructions:
- type: EnvironmentVariable
variableName: QT_MODULE_TO_TEST
variableValue: "qt-creator/qt-creator"
- type: ChangeDirectory
directory: "{{.AgentWorkingDir}}"
- type: ExecuteCommand
command: echo " should run perl qt/qtqa-latest/tests/prebuild/license/tst_licenses.pl"
maxTimeInSeconds: 7200
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed ....
common_environment: &common_environment
type: Group
instructions:
- !include "{{qt-creator/qt-creator}}/common_environment.yaml"
make_instructions: &make_instructions
type: Group
instructions:
- !include "{{qt-creator/qt-creator}}/qmake_module_build.yaml"
instructions:
Build:
- *common_environment
- *make_instructions
Test: []
LicenseCheck:
- *run_license_check

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -7,4 +7,6 @@
images/UfvA04CIXv0.jpg \
images/FzmLuRHQXaw.jpg \
images/pEETxSxYazg.jpg \
images/V3Po15bNErw.jpg
images/V3Po15bNErw.jpg \
images/bMXeeQw6BYs.jpg \
images/u3kZJjlk3CY.jpg

View File

@@ -12,4 +12,6 @@
images/FzmLuRHQXaw.jpg \
images/w1yhDl93YI0.jpg \
images/pEETxSxYazg.jpg \
images/V3Po15bNErw.jpg
images/V3Po15bNErw.jpg \
images/bMXeeQw6BYs.jpg \
images/u3kZJjlk3CY.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -178,6 +178,11 @@
\li Add and remove subprojects.
\endif
\li Search from the selected directory.
\li Open a terminal window in the project directory. To specify the
terminal to use on Linux and \macos, select \uicontrol Tools >
\uicontrol Options > \uicontrol Environment > \uicontrol System.
\li Open a terminal window in the project directory that is configured
for building or running the project.
\li Expand or collapse the tree view to show or hide all files and
folders.
\li Close all files in a project.

View File

@@ -61,6 +61,9 @@
linked frameworks, such as the Qt framework itself. You do not need this
option for debugging your application code.
On Linux, select the \uicontrol {Run as root user} check box to run the
application with root user permissions.
You can also create custom executable run configurations where you
can set the executable to be run. For more information, see
\l{Specifying a Custom Executable to Run}.

View File

@@ -41,15 +41,17 @@
\title Design Views
\image studio-design-mode.png "Design views"
\QDS contains views for designing UIs. To open them, select
\uicontrol View > \uicontrol Views.
\uicontrol View > \uicontrol Views. The following images present the
views that you are likely to use most often while designing UIs.
\image studio-design-mode.png "Design views"
\image studio-design-mode-states-timeline.png "The States and Timeline views"
You can move the views anywhere on the screen and save them as
\e workspaces, as instructed in \l {Managing Workspaces}.
Watch a video about using the design views:
To learn more about using the design views, see the following video:
\youtube RfEYO-5Mw6s
@@ -63,8 +65,7 @@
\row
\li \l{Form Editor}
\li Provides a working area for designing 2D UIs.
When you are editing 3D scenes, the \uicontrol {Form Editor} is
When you are editing 3D scenes, \uicontrol {Form Editor} is
used as a canvas for the 3D scene projected by the camera.
\li \l{Form Editor}
\row
@@ -119,7 +120,7 @@
\row
\li \l{Working in Edit Mode}{Text Editor}
\li Provides a code editor for viewing and modifying the code
generatedby the visual editors.
generated by the visual editors.
\li \l {Working in Edit Mode}
\row
\li \l{Viewing Project Files}{Projects}
@@ -137,60 +138,69 @@
\section1 Summary of Main Toolbar Actions
The top level toolbar in the Design mode contains shortcuts to widely used
actions.
The top level toolbar in the \uicontrol Design mode contains shortcuts to
widely used actions.
\table
\header
\li Button/Field
\li Action
\li Keyboard Shortcut
\li Read More
\row
\li \inlineimage prev.png
\li \uicontrol {Go Back} (\key Alt+<): moves a step backwards in your
location history. That is, returns focus to the last location in
the last file it was on.
\li \uicontrol {Go Back}: moves a step backwards in your location history.
That is, returns the focus to the last location in the last file it
was on.
\li \key Alt+< (\key Opt+Cmd+< on \macos)
\li \l{Navigating Between Open Files and Symbols}
\row
\li \inlineimage next.png
\li \uicontrol {Go Forward} (\key Alt+>): moves a step forward in your
location history.
\li \uicontrol {Go Forward}: moves a step forward in your location history.
\li \key Alt+> (\key Opt+Cmd+> on \macos)
\li \l{Navigating Between Open Files and Symbols}
\row
\li \inlineimage unlocked.png
\li Indicates that the currently open file can be modified and saved.
\li File is writable: the currently open file can be modified and saved.
\li
\li \l{Viewing Open Documents}
\row
\li File type icon
\li Indicates the type of the currently open file. Design views cannot
be split, so the icon cannot be dragged, contrary to the tooltip.
\li
\li \l{Viewing Open Documents}
\row
\li Currently open file
\li Displays the location and filename of the currently open file. You
can select another file in the list of open files to view it in
\uicontrol {Form Editor} and \uicontrol Navigator.
\li
\li \l{Viewing Open Documents}
\row
\li \inlineimage close.png
\li \uicontrol {Close Document} (\key Ctrl+W): closes the current file.
\li \uicontrol {Close Document}: closes the current file.
\li \key Ctrl+W (\key Cmd+W on \macos)
\li
\row
\li \inlineimage live_preview.png
\li \uicontrol {Show Live Preview} (\key Alt+P) shows a preview of the
current file or the entire UI. The changes you make to the UI are
instantly visible to you in the preview.
\li \uicontrol {Show Live Preview} shows a preview of the current file
or the entire UI. The changes you make to the UI are instantly
visible to you in the preview.
\li \key Alt+P (\key Opt+P on \macos)
\li \l{Previewing}
\row
\li Preview size
\li Displays the size of the preview dialog as a percentage. You can
select another percentage in the list to view the UI in different
sizes.
\li
\li \l{Previewing on Desktop}
\row
\li FPS
\li Displays the frames-per-second (FPS) refresh rate of previewed
animations.
\li
\li \l{Previewing on Desktop}
\row
\li Preview language
@@ -198,67 +208,81 @@
preview. You can select another language in the list of languages
that the application has been localized to.
\li
\li
\row
\li \inlineimage qtcreator-reset-position-icon.png
\li Returns a component to its \e {implicit position} after it was
moved.
\li Returns a component to its \e {implicit position} after
being moved.
\li \key Ctrl+D (\key Cmd+D on \macos)
\li \l{Resetting Component Position and Size}
\row
\li \inlineimage qtcreator-reset-size-icon.png
\li Returns a component to its implicit size after it was scaled.
\li \key Shift+S
\li \l{Resetting Component Position and Size}
\row
\li \inlineimage icons/anchor-fill.png
\li Fills the selected component to its parent component.
\li \key Shift+F
\li \l{Setting Anchors and Margins}
\row
\li \inlineimage qtcreator-anchors-reset-icon.png
\li Resets anchors to their saved state.
\li Resets anchors to their saved state for the selected component.
\li \key Ctrl+Shift+R (\key Shift+Cmd+R on \macos)
\li \l{Setting Anchors and Margins}
\row
\li \inlineimage row.png
\li Uses a \uicontrol Row component to lay out the selected components.
\li \key Ctrl+U (\key Cmd+U on \macos)
\li \l{Using Layouts}
\row
\li \inlineimage column.png
\li Uses a \uicontrol Column component to lay out the selected
components.
\li \key Ctrl+L (\key Cmd+L on \macos)
\li \l{Using Layouts}
\row
\li \inlineimage grid.png
\li Uses a \uicontrol Grid component to lay out the selected
components.
\li \key Shift+G
\li \l{Using Layouts}
\if defined(qtdesignstudio)
\row
\li \inlineimage icons/edit.png
\li \uicontrol {Show Event List} (\key {Alt+E}): opens a dialog for
viewing and creating an event list for an application flow.
\li \uicontrol {Show Event List}: opens a dialog for viewing and
creating an event list for an application flow.
\li \key Alt+E (\key Opt+E on \macos)
\li \l{Simulating Events}
\row
\li \inlineimage icons/assign.png
\li \uicontrol {Assign Events to Actions} (\key {Alt+A}): assigns
events to actions in an application flow.
\li \uicontrol {Assign Events to Actions}: assigns events to actions in
an application flow.
\li \key Alt+A (\key Opt+A on \macos)
\li \l{Simulating Events}
\endif
\row
\li Styling
\li Displays the UI style used for UI controls.
\li
\li \l{Styling Controls}
\row
\li Subcomponents
\li Displays the components referred to in the current file. Select a
component in the list to open it in \uicontrol {Form Editor} and
\uicontrol Navigator.
\li
\li \l{Creating Components}
\row
\li Workspace
\li Displays the currently selected workspace. To switch to another
workspace, select it in the list.
\li
\li \l{Managing Workspaces}
\row
\li \inlineimage icons/annotation.png
\li Enables you to add or edit global annotations.
\li
\li \l{Annotating Designs}
\endtable
*/

View File

@@ -67,6 +67,7 @@
\li \l {Logic Helpers}
\endif
\li \l Animations
\li \l{Using 3D Components}{3D Components}
\endlist
For more information about creating your own components, see
@@ -74,14 +75,17 @@
\section2 Adding and Removing Modules
When you create projects, modules typically needed in them are added by
default. For example, an empty application project contains only basic
components, while a 3D application project contains additional 3D
components.
When you \l{Creating Projects}{create projects}, modules typically needed in
them are added by default. For example, an empty application project
contains only basic components, while a 3D application project contains
additional 3D components.
To add modules to the project, select \inlineimage plus.png
, and then select the module to add from the list of available
modules.
To view the list of available modules, select \inlineimage plus.png
. Most commonly used modules are placed at the top of the list in
alphabetical order. You can search for components and modules by entering
search criteria in the \uicontrol Search field.
Select the module to add it to \uicontrol Library > \uicontrol Components.
\image qtquick-components-tab-add.png "Select Modules to Add"
@@ -90,11 +94,8 @@
\uicontrol QtQuick.Controls module, the following import statement
is added to the code: \c {import QtQuick.Controls}.
You can search for components and modules by entering search criteria
in the \uicontrol Search field.
The added components and modules are packaged with your UI into the final
application package, so it is recommended that you select
Since the added components and modules are packaged with your UI into the
final application package, it is recommended that you select
\uicontrol {Remove Module} to remove the ones you don't use in the project.
\section1 Assets

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -144,13 +144,13 @@
\section2 Importing the Simulink Connector
To integrate the Simulink model into \QDS, you first need to import the
Simulink connector in \uicontrol Library. Click the \uicontrol {QML Imports
Tab}, select the \uicontrol {<Add Import>} drop-down menu, and then select
\uicontrol SimulinkConnector. \QDS is now ready to communicate with the
To integrate the Simulink model into \QDS, you first need to add the
Simulink connector module to your project. In the \l Library view, select
\uicontrol Components > \inlineimage plus.png
> \uicontrol SimulinkConnector. \QDS is now ready to communicate with the
Simulink model.
\image studio-qml-imports-slconnector.png "Simulink Connector in the QML Imports list"
\image studio-qml-imports-slconnector.png "Simulink Connector in the list of available modules."
If you need to change the IP address and/or port, you need to select the
\uicontrol SimulinkConnector item in \uicontrol Navigator and set the IP
@@ -162,8 +162,8 @@
To communicate with a specific model in Simulink, you need to create
properties matching the send and receive properties in the root of the
application you are building. Select the root item in \uicontrol
Navigator to add the properties in the \uicontrol Properties tab in
\uicontrol {Connection View}.
Navigator to add the properties in \uicontrol {Connection View} >
\uicontrol Properties.
See \l {Specifying Dynamic Properties} for a detailed description of how
to add a custom property. The name of the property and the data type

View File

@@ -43,6 +43,19 @@
To edit 3D components, select the component in \uicontrol {3D Editor} or in
\uicontrol Navigator and set its properties in the \l Properties view.
\section1 Getting Started Videos
The following video shows you how to add the components included in the
\uicontrol QtQuick3D module, such as 3D models, cameras, and lights, to your
scene:
\youtube u3kZJjlk3CY
See the next video to learn more about the custom shader utilities, 3D
effects, and materials:
\youtube bMXeeQw6BYs
\section1 More Information about 3D Components
\list
\li \l {Setting Group Properties}

View File

@@ -49,12 +49,15 @@
two-sided polygons, index-of-refraction, and fragment cutoff (masking).
For more information, see \l {Qt Quick 3D Custom Material Reference}.
You can use the components in \uicontrol Library > \uicontrol Components >
Use the components in \uicontrol Library > \uicontrol Components >
\uicontrol QtQuick3D > \uicontrol {Qt Quick 3D Custom Shader Utils} to
create custom effects and materials. For more information about the shader
utilities and commands and their properties, see \l {Using Custom Shaders}.
\image studio-qtquick-3d-shader-utilities.png "Qt Quick 3D Custom Shader Utils tab in Library"
create custom effects and materials. You can find the \uicontrol Effect
component in \uicontrol Library > \uicontrol {QtQuick3D Effects} > \uicontrol
{Qt Quick 3D Custom Shader Utils}, and the \uicontrol {Custom Material}
component in \uicontrol Library > \uicontrol {QtQuick3D Materials} >
\uicontrol {Qt Quick 3D Custom Shader Utils}. For more information about the
shader utilities and commands and their properties, see
\l {Using Custom Shaders}.
\note You must create the actual shader source files with some other tool
and copy them to your project folder. You can then specify the source file
@@ -65,9 +68,9 @@
\section1 Creating Custom Effects
By default, a custom effect component contains a Pass type and a Shader
type in the fragment stage. You can add passes, shaders, and other shader
utilities to the effect.
By default, a custom effect component contains a Pass component and a Shader
component in the fragment stage. You can add passes, shaders, and other
shader utilities to the effect.
\image studio-qtquick-3d-custom-effect-navigator.png "Custom effect in Navigator"
@@ -78,7 +81,7 @@
To create a custom effect:
\list 1
\li Drag and drop an \uicontrol {Effect} type from the
\li Drag and drop an \uicontrol {Effect} component from the
\uicontrol {Qt Quick 3D Custom Shader Utils} tab of
\uicontrol Library to a Model component in \uicontrol Navigator.
\li Select the custom effect component in \uicontrol Navigator to edit
@@ -90,14 +93,14 @@
for its properties in \uicontrol Properties.
\image studio-qtquick-3d-pass.png "Pass properties"
\li To execute commands during the pass, drag and drop the following
command types from \uicontrol Library to the custom material in
command components from \uicontrol Library to the custom material in
\uicontrol Navigator: \uicontrol Blending, \uicontrol {Buffer Blit},
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
\uicontrol {Depth Input}, \uicontrol {Render State}, and
\uicontrol {Set Uniform Value}. Then select the commands in the
\uicontrol Commands field.
\li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer
type to the custom material. Then select the buffer in the
component to the custom material. Then select the buffer in the
\uicontrol Buffer field.
\li Select the shader component in \uicontrol Navigator to set the path
to the shader files in the \uicontrol Source field in
@@ -107,9 +110,9 @@
\section1 Creating Custom Materials
By default, a Custom Material component contains two Shader types, a Shader
Info type, and a Pass type. You can add shaders, passes, and other shader
utilities to the material.
By default, a Custom Material component contains two Shader components, a
Shader Info component, and a Pass component. You can add shaders, passes,
and other shader utilities to the material.
\image studio-qtquick-3d-custom-material-navigator.png "Custom material in Navigator"
@@ -117,20 +120,20 @@
the paths to the shader files. Specify the paths to the shader files to use
in the shader properties.
The Shader Info type specifies the shader type and version, as well
as the options used by the shader based on the selected shader key values,
such as diffuse or specular lighting, refraction, transparency, displacement,
transmissiveness, glossiness, and alpha cutout.
The Shader Info component specifies the shader component and version, as
well as the options used by the shader based on the selected shader key
values, such as diffuse or specular lighting, refraction, transparency,
displacement, transmissiveness, glossiness, and alpha cutout.
The shaders are used with the Pass type to create the resulting material.
A pass can contain multiple rendering passes and other commands. You can
use a Buffer type to allocate a buffer for storing intermediate rendering
results.
The shaders are used with the Pass component to create the resulting
material. A pass can contain multiple rendering passes and other commands.
You can use a Buffer component to allocate a buffer for storing intermediate
rendering results.
To create a custom material:
\list 1
\li Drag and drop a \uicontrol {Custom Material} type from the
\li Drag and drop a \uicontrol {Custom Material} component from the
\uicontrol {Qt Quick 3D Custom Shader Utils} tab of
\uicontrol Library to a Model component in \uicontrol Navigator.
\li Select the custom material component in \uicontrol Navigator to
@@ -143,7 +146,7 @@
\li Select the \uicontrol {Always dirty} check box to determine that
the material needs to be refreshed every time it is used.
\li In the \uicontrol {Shader Info} field, select the shader info
type to use.
component to use.
\li In the \uicontrol Passes field, select the pass components for
the effect.
\li In the \uicontrol Material group, select the
@@ -157,7 +160,7 @@
for its properties in \uicontrol Properties.
\image studio-qtquick-3d-pass.png "Pass properties"
\li To execute commands during the pass, drag and drop the following
command types from \uicontrol Library to the pass component in
command components from \uicontrol Library to the pass component in
\uicontrol Navigator: \uicontrol Blending, \uicontrol {Buffer Blit},
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
\uicontrol {Depth Input}, \uicontrol {Render State}, and
@@ -165,11 +168,11 @@
at the same level as the pass component and automatically added to
the \uicontrol Commands field.
\li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer
type to the custom material. Then select the buffer in the
component to the custom material. Then select the buffer in the
\uicontrol Buffer field.
\li To add a shader to the pass, drag and drop the \uicontrol Shader
type from the \uicontrol Library to the pass component in \uicontrol
Navigator. The shader components are created at the same
component from the \uicontrol Library to the pass component in
\uicontrol Navigator. The shader components are created at the same
level as the pass component and automatically added to the
\uicontrol Shaders field.
\li Select the shader components in \uicontrol Navigator to set the

View File

@@ -38,8 +38,17 @@
\image studio-qtquick-3d-shader-utilities.png
If the custom shader utilities are not displayed in \uicontrol Library, you
should add the \uicontrol QtQuick3D module to your project, as described in
Additional 3D shader utilities include the \uicontrol Effect, which you can
find in \uicontrol Library > \uicontrol {QtQuick3D Effects} > \uicontrol
{Qt Quick 3D Custom Shader Utils}, and \uicontrol {Custom Material},
available in \uicontrol Library > \uicontrol {QtQuick3D Materials} >
\uicontrol {Qt Quick 3D Custom Shader Utils}.
\image studio-qtquick-3d-shader-effect.png
\image studio-qtquick-3d-shader-custom-material.png
If the custom shader utilities are not displayed in \uicontrol Library, add
the \uicontrol QtQuick3D module to your project, as described in
\l {Adding and Removing Modules}.
For more information on using the shaders, see
@@ -193,5 +202,4 @@
uniform.
\endtable
*/

View File

@@ -35,18 +35,23 @@
\QDS provides a set of 3D effects, which are visible in \l {Form Editor}.
To apply a visual effect to a scene, drag-and-drop an effect from \l Library
> \uicontrol Components > \uicontrol QtQuick3D > \uicontrol {Qt Quick 3D Effects}
to a \uicontrol View3D component in \l Navigator. You can apply multiple
effects to a scene. Select the \uicontrol {Scene Environment} component in
\uicontrol Navigator to view the applied effects in \l Properties >
\uicontrol {Scene Environment} > \uicontrol Effect. If the effects are not
displayed in \l Library, you should add the \uicontrol QtQuick3D.Effects
module to your project, as described in \l {Adding and Removing Modules}.
to a \uicontrol View3D component in \l Navigator.
You can use the \l Effect component available in \uicontrol
{Qt Quick 3D Effects} > \uicontrol {Custom Shader Utils} as the base
component for creating custom post-processing effects. For more information,
see \l {Creating Custom Effects and Materials} and \l {Using Custom Shaders}.
You can apply multiple effects to a scene. Select the \uicontrol
{Scene Environment} component in \uicontrol Navigator to view the applied
effects in \l Properties > \uicontrol {Scene Environment} > \uicontrol Effect.
If the effects are not displayed in \l Library, you should add the
\uicontrol QtQuick3D.Effects module to your project, as described in
\l {Adding and Removing Modules}.
See the following table for available effects and example images.
For more information about creating your own effects, see
\l {Creating Custom Effects and Materials}.
\section1 Available Effects
\table
\header

View File

@@ -35,23 +35,20 @@
\QDS provides a set of pregenerated Qt Quick 3D materials that can be used
to create good-looking \l {Adding 3D Models}{models} quickly and easily.
To apply 3D materials to models, you should first delete the default material,
and then drag-and-drop a new material from \l Library to a model component
in \l Navigator.
You can apply the same material to another component as well. Again,
delete the default material first. You should then select the component and
go to the \uicontrol Properties view. Find the \uicontrol Materials property,
select the \inlineimage plus.png
icon, and choose the new material in the dropdown menu.
To apply a 3D material to a component, drag-and-drop a material from
\l Library > \uicontrol Components > \uicontrol QtQuick3D >
To apply a 3D material to a component, you should first delete the default
material and then drag-and-drop a new material from \l Library >
\uicontrol Components > \uicontrol QtQuick3D >
\uicontrol {Qt Quick 3D Materials} to a model component in \l Navigator.
The materials you add to the model are listed in the model component's
\l Properties view. If the 3D materials are not displayed in \l Library,
you should add the \uicontrol QtQuick3D.Materials module to your project, as
described in \l {Adding and Removing Modules}.
\l Properties view. You can apply the same material to another component as
well. Again, delete the default material first. You should then select the
component and go to the \uicontrol Properties view. Find the
\uicontrol Materials property, select the \inlineimage plus.png
icon, and choose the new material in the dropdown menu.
If the 3D materials are not displayed in \uicontrol Library, you should add
the \uicontrol QtQuick3D.Materials module to your project, as described in
\l {Adding and Removing Modules}.
Each material has its own set of properties that can be used to further
define the appearance of the material. For each material the \uicontrol
@@ -62,6 +59,14 @@
determine whether or not shadow mapping is used for generating realistic
shadows. You can also select a \uicontrol Texture for shadow mapping.
\section1 Custom Material
You can use the \l {CustomMaterial}{Custom Material} component available in
\uicontrol {Qt Quick 3D Effects} > \uicontrol {Custom Shader Utils} as
the base component for creating custom materials used to shade models. For
more information, see \l {Creating Custom Effects and Materials} and
\l {Using Custom Shaders}.
\section1 Metal Materials
The following describes properties of the metal-based materials, which

View File

@@ -689,6 +689,12 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
* QML type. This is the case for example if a C++ type is mocked up with a QML file.
*/
if (!object && majorNumber == 6 && minorNumber == 0) {
object = QmlPrivateGate::createPrimitive(polishTypeName, 2, 15, context);
if (!object)
object = QmlPrivateGate::createPrimitive(polishTypeName, 1, 0, context);
}
if (!object)
object = createPrimitiveFromSource(polishTypeName, majorNumber, minorNumber, context);

View File

@@ -78,11 +78,14 @@ ScrollView {
property string importToRemove: ""
property string importToAdd: ""
property var currentItem: null
property var currentCategory: null
property var currentImport: null
// called from C++ to close context menu on focus out
function closeContextMenu()
{
importContextMenu.close()
moduleContextMenu.close()
itemContextMenu.close()
}
@@ -107,25 +110,73 @@ ScrollView {
2 * cellVerticalMargin + cellVerticalSpacing
StudioControls.Menu {
id: importContextMenu
id: moduleContextMenu
StudioControls.MenuItem {
text: qsTr("Remove Module")
visible: currentCategory === null
height: visible ? implicitHeight : 0
enabled: importToRemove !== ""
onTriggered: rootView.removeImport(importToRemove)
}
StudioControls.MenuSeparator {}
StudioControls.MenuSeparator {
visible: currentCategory === null
height: StudioTheme.Values.border
}
StudioControls.MenuItem {
text: qsTr("Expand All")
visible: currentCategory === null
height: visible ? implicitHeight : 0
onTriggered: itemLibraryModel.expandAll()
}
StudioControls.MenuItem {
text: qsTr("Collapse All")
visible: currentCategory === null
height: visible ? implicitHeight : 0
onTriggered: itemLibraryModel.collapseAll()
}
StudioControls.MenuSeparator {
visible: currentCategory === null
height: StudioTheme.Values.border
}
StudioControls.MenuItem {
text: qsTr("Hide Category")
visible: currentCategory
height: visible ? implicitHeight : 0
onTriggered: {
itemLibraryModel.isAnyCategoryHidden = true
currentCategory.categoryVisible = false
}
}
StudioControls.MenuSeparator {
visible: currentCategory
height: StudioTheme.Values.border
}
StudioControls.MenuItem {
text: qsTr("Show Module Hidden Categories")
enabled: currentImport && !currentImport.importCatVisibleState
onTriggered: {
currentImport.importCatVisibleState = true
if (!itemLibraryModel.getIsAnyCategoryHidden())
itemLibraryModel.isAnyCategoryHidden = false
}
}
StudioControls.MenuItem {
text: qsTr("Show All Hidden Categories")
enabled: itemLibraryModel.isAnyCategoryHidden
onTriggered: {
itemLibraryModel.isAnyCategoryHidden = false
itemLibraryModel.showHiddenCategories()
}
}
}
StudioControls.Menu {
@@ -166,11 +217,14 @@ ScrollView {
}
onShowContextMenu: {
importToRemove = importRemovable ? importUrl : ""
importContextMenu.popup()
currentImport = model
currentCategory = null
moduleContextMenu.popup()
}
Column {
spacing: 2
property var currentImportModel: model // allows accessing the import model from inside the category section
Repeater {
model: categoryModel
delegate: Section {
@@ -188,6 +242,11 @@ ScrollView {
expanded: categoryExpanded
expandOnClick: false
onToggleExpand: categoryExpanded = !categoryExpanded
onShowContextMenu: {
currentCategory = model
currentImport = parent.currentImportModel
moduleContextMenu.popup()
}
Grid {
id: itemGrid

View File

@@ -462,6 +462,7 @@ void TypePrettyPrinter::visit(Function *type)
argumentText.showReturnTypes = true;
argumentText.showArgumentNames = false;
argumentText.showFunctionSignatures = true;
argumentText.showTemplateParameters = _overview->showTemplateParameters;
_text += QLatin1Char('(');

View File

@@ -213,7 +213,7 @@ void AutoTestUnitTests::testCodeParserGTest()
QVERIFY(parserSpy.wait(20000));
QVERIFY(modelUpdateSpy.wait());
QCOMPARE(m_model->gtestNamesCount(), 7);
QCOMPARE(m_model->gtestNamesCount(), 8);
QMultiMap<QString, int> expectedNamesAndSets;
expectedNamesAndSets.insert(QStringLiteral("FactorialTest"), 3);
@@ -222,6 +222,7 @@ void AutoTestUnitTests::testCodeParserGTest()
expectedNamesAndSets.insert(QStringLiteral("QueueTest"), 2);
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as parameterized test
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as 'normal' test
expectedNamesAndSets.insert(QStringLiteral("NumberAsNameStart"), 1);
expectedNamesAndSets.insert(QStringLiteral("NamespaceTest"), 1);
QMultiMap<QString, int> foundNamesAndSets = m_model->gtestNamesAndSets();

View File

@@ -29,6 +29,8 @@
#include <cplusplus/LookupContext.h>
#include <utils/qtcassert.h>
#include <QRegularExpression>
namespace Autotest {
namespace Internal {
@@ -45,7 +47,7 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
return false;
CPlusPlus::DeclaratorIdAST *id = ast->declarator->core_declarator->asDeclaratorId();
if (!id || !ast->symbol || ast->symbol->argumentCount() != 2)
if (!id || !ast->symbol)
return false;
QString prettyName =
@@ -61,33 +63,68 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
if (!GTestUtils::isGTestMacro(prettyName))
return false;
CPlusPlus::Argument *testCaseNameArg = ast->symbol->argumentAt(0)->asArgument();
CPlusPlus::Argument *testNameArg = ast->symbol->argumentAt(1)->asArgument();
if (testCaseNameArg && testNameArg) {
const QString &testCaseName = m_overview.prettyType(testCaseNameArg->type());
const QString &testName = m_overview.prettyType(testNameArg->type());
QString testSuiteName;
QString testCaseName;
if (ast->symbol->argumentCount() != 2 && ast->declarator->initializer) {
// we might have a special case when second parameter is a literal starting with a number
if (auto expressionListParenAST = ast->declarator->initializer->asExpressionListParen()) {
// only try if we have 3 tokens between left and right paren (2 parameters and a comma)
if (expressionListParenAST->rparen_token - expressionListParenAST->lparen_token != 4)
return false;
const bool disabled = testName.startsWith(disabledPrefix);
const bool disabledCase = testCaseName.startsWith(disabledPrefix);
int line = 0;
int column = 0;
unsigned token = id->firstToken();
m_document->translationUnit()->getTokenStartPosition(token, &line, &column);
const CPlusPlus::Token parameter1
= translationUnit()->tokenAt(expressionListParenAST->lparen_token + 1);
const CPlusPlus::Token parameter2
= translationUnit()->tokenAt(expressionListParenAST->rparen_token - 1);
const CPlusPlus::Token comma
= translationUnit()->tokenAt(expressionListParenAST->lparen_token + 2);
if (!comma.is(CPlusPlus::T_COMMA))
return false;
GTestCodeLocationAndType locationAndType;
locationAndType.m_name = testName;
locationAndType.m_line = line;
locationAndType.m_column = column - 1;
locationAndType.m_type = TestTreeItem::TestCase;
locationAndType.m_state = disabled ? GTestTreeItem::Disabled
: GTestTreeItem::Enabled;
GTestCaseSpec spec;
spec.testCaseName = testCaseName;
spec.parameterized = GTestUtils::isGTestParameterized(prettyName);
spec.typed = GTestUtils::isGTestTyped(prettyName);
spec.disabled = disabledCase;
m_gtestFunctions[spec].append(locationAndType);
testSuiteName = QString::fromUtf8(parameter1.spell());
testCaseName = QString::fromUtf8(parameter2.spell());
// test (suite) name needs to be a alpha numerical literal ( _ and $ allowed)
const QRegularExpression alnum("^[[:alnum:]_$]+$");
// test suite must not start with a number, test case may
if (!alnum.match(testSuiteName).hasMatch()
|| (!testSuiteName.isEmpty() && testSuiteName.at(0).isNumber())) {
testSuiteName.clear();
}
if (!alnum.match(testCaseName).hasMatch())
testCaseName.clear();
}
} else {
const CPlusPlus::Argument *testSuiteNameArg = ast->symbol->argumentAt(0)->asArgument();
const CPlusPlus::Argument *testCaseNameArg = ast->symbol->argumentAt(1)->asArgument();
if (testSuiteNameArg && testCaseNameArg) {
testSuiteName = m_overview.prettyType(testSuiteNameArg->type());
testCaseName = m_overview.prettyType(testCaseNameArg->type());
}
}
if (testSuiteName.isEmpty() || testCaseName.isEmpty())
return false;
const bool disabled = testCaseName.startsWith(disabledPrefix);
const bool disabledCase = testSuiteName.startsWith(disabledPrefix);
int line = 0;
int column = 0;
unsigned token = id->firstToken();
m_document->translationUnit()->getTokenStartPosition(token, &line, &column);
GTestCodeLocationAndType locationAndType;
locationAndType.m_name = testCaseName;
locationAndType.m_line = line;
locationAndType.m_column = column - 1;
locationAndType.m_type = TestTreeItem::TestCase;
locationAndType.m_state = disabled ? GTestTreeItem::Disabled
: GTestTreeItem::Enabled;
GTestCaseSpec spec;
// FIXME GTestCaseSpec structure wrong nowadays (suite vs case / case vs function)
spec.testCaseName = testSuiteName;
spec.parameterized = GTestUtils::isGTestParameterized(prettyName);
spec.typed = GTestUtils::isGTestTyped(prettyName);
spec.disabled = disabledCase;
m_gtestFunctions[spec].append(locationAndType);
return false;
}

View File

@@ -70,6 +70,11 @@ TEST(FactorialTest_Iterative, DISABLED_HandlesPositiveInput)
ASSERT_EQ(40320, factorial_it(8));
}
TEST(NumberAsNameStart, 1IsEnough)
{
EXPECT_FALSE(false);
}
int main(int argc, char *argv[])
{
::testing::InitGoogleTest(&argc, argv);

View File

@@ -534,6 +534,14 @@ void CMakeBuildStep::recreateBuildTargetsModel()
addItem(QString(), true);
// Remove the targets that do not exist in the build system
// This can result when selected targets get renamed
if (!targetList.empty()) {
Utils::erase(m_buildTargets, [targetList](const QString &bt) { return !targetList.contains(bt); });
if (m_buildTargets.empty())
m_buildTargets.push_back(m_allTarget);
}
for (const QString &buildTarget : qAsConst(targetList))
addItem(buildTarget, specialTargets(usesAllCapsTargets).contains(buildTarget));

View File

@@ -932,10 +932,6 @@ void CMakeBuildSystem::becameDirty()
if (isParsing())
return;
const CMakeTool *tool = m_parameters.cmakeTool();
if (!tool->isAutoRun())
return;
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()), REPARSE_SCAN);
}

View File

@@ -3839,7 +3839,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_headerSource_basic2()
QByteArray expected;
// Header File
original = "void f()@;\n";
original = "void f(const std::vector<int> &v)@;\n";
expected = original;
testDocuments << QuickFixTestDocument::create("file.h", original, expected);
@@ -3854,7 +3854,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_headerSource_basic2()
"\n"
"int x;\n"
"\n"
"void f()\n"
"void f(const std::vector<int> &v)\n"
"{\n"
"\n"
"}\n"

View File

@@ -456,20 +456,21 @@ void Client::requestDocumentHighlights(TextEditor::TextEditorWidget *widget)
return;
}
auto runningRequest = m_highlightRequests.find(uri);
if (runningRequest != m_highlightRequests.end())
cancelRequest(runningRequest.value());
if (m_highlightRequests.contains(widget))
cancelRequest(m_highlightRequests.take(widget));
DocumentHighlightsRequest request(
TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(widget->textCursor())));
auto connection = connect(widget, &QObject::destroyed, this, [this, widget]() {
if (m_highlightRequests.contains(widget))
cancelRequest(m_highlightRequests.take(widget));
});
request.setResponseCallback(
[widget = QPointer<TextEditor::TextEditorWidget>(widget), this, uri]
[widget, this, uri, connection]
(const DocumentHighlightsRequest::Response &response)
{
m_highlightRequests.remove(uri);
if (!widget)
return;
m_highlightRequests.remove(widget);
disconnect(connection);
const Id &id = TextEditor::TextEditorWidget::CodeSemanticsSelection;
QList<QTextEdit::ExtraSelection> selections;
const Utils::optional<DocumentHighlightsResult> &result = response.result();
@@ -493,7 +494,7 @@ void Client::requestDocumentHighlights(TextEditor::TextEditorWidget *widget)
}
widget->setExtraSelections(id, selections);
});
m_highlightRequests[uri] = request.id();
m_highlightRequests[widget] = request.id();
sendContent(request);
}
@@ -713,19 +714,19 @@ void Client::cursorPositionChanged(TextEditor::TextEditorWidget *widget)
QTimer *timer = m_documentHighlightsTimer[widget];
if (!timer) {
const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath());
auto runningRequest = m_highlightRequests.find(uri);
if (runningRequest != m_highlightRequests.end())
cancelRequest(runningRequest.value());
if (m_highlightRequests.contains(widget))
cancelRequest(m_highlightRequests.take(widget));
timer = new QTimer;
timer->setSingleShot(true);
m_documentHighlightsTimer.insert(widget, timer);
connect(timer, &QTimer::timeout, this, [this, widget]() {
auto connection = connect(widget, &QWidget::destroyed, this, [widget, this]() {
delete m_documentHighlightsTimer.take(widget);
});
connect(timer, &QTimer::timeout, this, [this, widget, connection]() {
disconnect(connection);
requestDocumentHighlights(widget);
m_documentHighlightsTimer.take(widget)->deleteLater();
});
connect(widget, &QWidget::destroyed, this, [widget, this]() {
delete m_documentHighlightsTimer.take(widget);
});
}
const Id selectionsId(TextEditor::TextEditorWidget::CodeSemanticsSelection);
const QList semanticSelections = widget->extraSelections(selectionsId);

View File

@@ -231,7 +231,7 @@ private:
AssistProviders m_clientProviders;
QMap<TextEditor::TextDocument *, AssistProviders> m_resetAssistProvider;
QHash<LanguageServerProtocol::DocumentUri, LanguageServerProtocol::MessageId> m_highlightRequests;
QHash<TextEditor::TextEditorWidget *, LanguageServerProtocol::MessageId> m_highlightRequests;
int m_restartsLeft = 5;
QScopedPointer<BaseClientInterface> m_clientInterface;
DiagnosticManager m_diagnosticManager;

View File

@@ -59,7 +59,8 @@ void HoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget,
{
if (m_currentRequest.has_value())
abort();
if (m_client.isNull() || !m_client->documentOpen(editorWidget->textDocument())) {
if (m_client.isNull() || !m_client->documentOpen(editorWidget->textDocument())
|| !m_client->reachable()) {
report(Priority_None);
return;
}

View File

@@ -311,12 +311,15 @@ void KitManagerConfigWidget::setIcon()
for (const IDeviceFactory * const factory : qAsConst(allDeviceFactories)) {
if (factory->icon().isNull())
continue;
iconMenu.addAction(factory->icon(), tr("Default for %1").arg(factory->displayName()),
[this, factory] {
m_iconButton->setIcon(factory->icon());
m_modifiedKit->setDeviceTypeForIcon(factory->deviceType());
emit dirty();
});
QAction *action = iconMenu.addAction(factory->icon(),
tr("Default for %1").arg(factory->displayName()),
[this, factory] {
m_iconButton->setIcon(factory->icon());
m_modifiedKit->setDeviceTypeForIcon(
factory->deviceType());
emit dirty();
});
action->setIconVisibleInMenu(true);
}
iconMenu.addSeparator();
iconMenu.addAction(Utils::PathChooser::browseButtonLabel(), [this] {

View File

@@ -344,6 +344,12 @@ static BuildConfiguration *activeBuildConfiguration()
return target ? target->activeBuildConfiguration() : nullptr;
}
static RunConfiguration *activeRunConfiguration()
{
const Target * const target = activeTarget();
return target ? target->activeRunConfiguration() : nullptr;
}
static bool isTextFile(const QString &fileName)
{
return Utils::mimeTypeForFile(fileName).inherits(
@@ -1881,6 +1887,39 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return QString();
});
expander->registerVariable("ActiveProject:RunConfig:Name",
tr("Name of the active project's active run configuration."),
[]() -> QString {
if (const RunConfiguration * const rc = activeRunConfiguration())
return rc->displayName();
return QString();
});
expander->registerFileVariables("ActiveProject:RunConfig:Executable",
tr("The executable of the active project's active run configuration."),
[]() -> QString {
if (const RunConfiguration * const rc = activeRunConfiguration())
return rc->commandLine().executable().toString();
return QString();
});
expander->registerPrefix("ActiveProject:RunConfig:Env",
tr("Variables in the environment of the active project's active run configuration."),
[](const QString &var) {
if (const RunConfiguration * const rc = activeRunConfiguration()) {
if (const auto envAspect = rc->aspect<EnvironmentAspect>())
return envAspect->environment().expandedValueForKey(var);
}
return QString();
});
expander->registerVariable("ActiveProject:RunConfig:WorkingDir",
tr("The working directory of the active project's active run configuration."),
[] {
if (const RunConfiguration * const rc = activeRunConfiguration()) {
if (const auto wdAspect = rc->aspect<WorkingDirectoryAspect>())
return wdAspect->workingDirectory(rc->macroExpander()).toString();
}
return QString();
});
const auto fileHandler = [] {
return SessionManager::sessionNameToFileName(SessionManager::activeSession()).toString();
};

View File

@@ -188,6 +188,24 @@ RunConfiguration::RunConfiguration(Target *target, Utils::Id id)
BuildConfiguration *bc = target->activeBuildConfiguration();
return bc ? bc->macroExpander() : target->macroExpander();
});
m_expander.registerPrefix("RunConfig:Env", tr("Variables in the run environment"),
[this](const QString &var) {
const auto envAspect = aspect<EnvironmentAspect>();
return envAspect ? envAspect->environment().expandedValueForKey(var) : QString();
});
m_expander.registerVariable("RunConfig:WorkingDir",
tr("The run configuration's working directory"),
[this] {
const auto wdAspect = aspect<WorkingDirectoryAspect>();
return wdAspect ? wdAspect->workingDirectory(&m_expander).toString() : QString();
});
m_expander.registerVariable("RunConfig:Name", tr("The run configuration's name."),
[this] { return displayName(); });
m_expander.registerFileVariables("RunConfig:Executable",
tr("The run configuration's executable."),
[this] { return commandLine().executable().toString(); });
m_commandLineGetter = [this] {
FilePath executable;
if (const auto executableAspect = aspect<ExecutableAspect>())

View File

@@ -363,7 +363,7 @@ void RunControl::setRunConfiguration(RunConfiguration *runConfig)
d->runConfiguration = runConfig;
d->runConfigId = runConfig->id();
d->runnable = runConfig->runnable();
d->displayName = runConfig->displayName();
d->displayName = runConfig->expandedDisplayName();
d->macroExpander = runConfig->macroExpander();
d->buildKey = runConfig->buildKey();
d->settingsData = runConfig->aspectData();

View File

@@ -174,14 +174,14 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
if (RunConfiguration * const rc = activeRunConfiguration())
return rc->displayName();
return QString();
});
}, false);
d->m_macroExpander.registerFileVariables("CurrentRun:Executable",
tr("The currently active run configuration's executable (if applicable)."),
[this]() -> QString {
if (RunConfiguration * const rc = activeRunConfiguration())
return rc->commandLine().executable().toString();
return QString();
});
}, false);
d->m_macroExpander.registerPrefix("CurrentRun:Env", tr("Variables in the current run environment."),
[this](const QString &var) {
if (RunConfiguration * const rc = activeRunConfiguration()) {
@@ -189,7 +189,7 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
return envAspect->environment().expandedValueForKey(var);
}
return QString();
});
}, false);
d->m_macroExpander.registerVariable("CurrentRun:WorkingDir",
tr("The currently active run configuration's working directory."),
[this] {
@@ -198,7 +198,7 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
return wdAspect->workingDirectory(&d->m_macroExpander).toString();
}
return QString();
});
}, false);
}
Target::~Target()

View File

@@ -78,7 +78,6 @@ class TaskView : public Utils::ListView
{
public:
TaskView(QWidget *parent = nullptr);
void setCurrentAndScrollTo(const QModelIndex &index);
~TaskView() override;
private:
@@ -213,12 +212,6 @@ TaskView::TaskView(QWidget *parent)
verticalScrollBar()->setSingleStep(vStepSize);
}
void TaskView::setCurrentAndScrollTo(const QModelIndex &index)
{
scrollTo(index);
setCurrentIndex(index);
}
TaskView::~TaskView() = default;
void TaskView::resizeEvent(QResizeEvent *e)
@@ -482,6 +475,7 @@ void TaskWindow::currentChanged(const QModelIndex &index)
ITaskHandler *h = d->handler(action);
action->setEnabled((task.isNull() || !h) ? false : h->canHandle(task));
}
d->m_listview->scrollTo(index);
}
void TaskWindow::saveSettings()
@@ -563,7 +557,7 @@ void TaskWindow::showTask(unsigned int id)
int sourceRow = d->m_model->rowForId(id);
QModelIndex sourceIdx = d->m_model->index(sourceRow, 0);
QModelIndex filterIdx = d->m_filter->mapFromSource(sourceIdx);
d->m_listview->setCurrentAndScrollTo(filterIdx);
d->m_listview->setCurrentIndex(filterIdx);
popup(Core::IOutputPane::ModeSwitch);
}
@@ -692,7 +686,7 @@ void TaskWindow::setFocus()
if (d->m_filter->rowCount()) {
d->m_listview->setFocus();
if (d->m_listview->currentIndex() == QModelIndex())
d->m_listview->setCurrentAndScrollTo(d->m_filter->index(0,0, QModelIndex()));
d->m_listview->setCurrentIndex(d->m_filter->index(0,0, QModelIndex()));
}
}
@@ -725,7 +719,7 @@ void TaskWindow::goToNext()
} else {
currentIndex = d->m_filter->index(0, 0);
}
d->m_listview->setCurrentAndScrollTo(currentIndex);
d->m_listview->setCurrentIndex(currentIndex);
triggerDefaultHandler(currentIndex);
}
@@ -748,7 +742,7 @@ void TaskWindow::goToPrev()
} else {
currentIndex = d->m_filter->index(0, 0);
}
d->m_listview->setCurrentAndScrollTo(currentIndex);
d->m_listview->setCurrentIndex(currentIndex);
triggerDefaultHandler(currentIndex);
}

View File

@@ -85,6 +85,7 @@ void CommentDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
Q_UNUSED(index)
editor->setGeometry(option.rect);
}
@@ -104,6 +105,9 @@ QWidget *CommentTitleDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
Q_UNUSED(option)
Q_UNUSED(index)
auto *editor = new QComboBox(parent);
editor->setEditable(true);
editor->setCompleter(completer());

View File

@@ -139,9 +139,6 @@ QVariantMap DefaultAnnotationsModel::asVariantMapFromJson(const QJsonDocument &d
case QJsonValue::Double:
map[key] = double{0.0};
break;
case QJsonValue::String:
map[key] = QString{};
break;
case QJsonValue::Bool:
map[key] = false;
break;
@@ -160,7 +157,13 @@ QVariantMap DefaultAnnotationsModel::asVariantMapFromJson(const QJsonDocument &d
map[key] = QVariant::fromValue(val.toDouble());
else if (type == QStringLiteral("color"))
map[key] = QVariant::fromValue(QColor(val.toString()));
break;
}
case QJsonValue::String:
map[key] = QString{};
break;
default:
break;
}
}

View File

@@ -39,6 +39,8 @@
#include <qmldesignerconstants.h>
#include <qmldesignerplugin.h>
#include <utils/qtcassert.h>
#include <QStandardItemModel>
#include <QMessageBox>
#include <QTableView>
@@ -370,7 +372,10 @@ void ConnectionModel::abstractPropertyChanged(const AbstractProperty &abstractPr
void ConnectionModel::deleteConnectionByRow(int currentRow)
{
SignalHandlerProperty targetSignal = signalHandlerPropertyForRow(currentRow);
QTC_ASSERT(targetSignal.isValid(), return );
QmlDesigner::ModelNode node = targetSignal.parentModelNode();
QTC_ASSERT(node.isValid(), return );
QList<SignalHandlerProperty> allSignals = node.signalProperties();
if (allSignals.size() > 1) {
if (allSignals.contains(targetSignal))

View File

@@ -102,7 +102,15 @@ void ConnectionView::nodeIdChanged(const ModelNode & /*node*/, const QString & /
dynamicPropertiesModel()->resetModel();
}
void ConnectionView::propertiesAboutToBeRemoved(const QList<AbstractProperty> & propertyList)
void ConnectionView::propertiesRemoved(const QList<AbstractProperty> &propertyList)
{
for (const AbstractProperty &property : propertyList) {
if (property.isDefaultProperty())
connectionModel()->resetModel();
}
}
void ConnectionView::propertiesAboutToBeRemoved(const QList<AbstractProperty> &propertyList)
{
foreach (const AbstractProperty &property, propertyList) {
if (property.isBindingProperty()) {

View File

@@ -62,6 +62,7 @@ public:
void nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent,
const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange) override;
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId) override;
void propertiesRemoved(const QList<AbstractProperty> &propertyList) override;
void propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList) override;
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange) override;
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange) override;

View File

@@ -2046,7 +2046,7 @@ void FormEditorFlowDecisionItem::updateGeometry()
QRectF textRect(0, 0, 100, 20);
Qt::Corner corner = Qt::TopRightCorner;
Qt::Corner corner = Qt::TopLeftCorner;
if (qmlItemNode().modelNode().hasAuxiliaryData("dialogLabelPosition"))
corner = qmlItemNode().modelNode().auxiliaryData("dialogLabelPosition").value<Qt::Corner>();
@@ -2191,7 +2191,7 @@ void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGrap
QRectF textRect(0, 0, 100, 20);
Qt::Corner corner = Qt::TopRightCorner;
Qt::Corner corner = Qt::TopLeftCorner;
if (qmlItemNode().modelNode().hasAuxiliaryData("dialogLabelPosition"))
corner = qmlItemNode().modelNode().auxiliaryData("dialogLabelPosition").value<Qt::Corner>();

View File

@@ -129,19 +129,24 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
m_scene->synchronizeTransformation(rootItem);
formEditorWidget()->setRootItemRect(qmlItemNode.instanceBoundingRect());
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
if (QmlItemNode::isValidQmlItemNode(nextNode) && nextNode.toQmlItemNode().isFlowItem()) {
setupFormEditorItemTree(nextNode.toQmlItemNode());
const QList<QmlObjectNode> allDirectSubNodes = qmlItemNode.allDirectSubNodes();
for (const QmlObjectNode &childNode : allDirectSubNodes) {
if (QmlItemNode::isValidQmlItemNode(childNode)
&& childNode.toQmlItemNode().isFlowItem()) {
setupFormEditorItemTree(childNode.toQmlItemNode());
}
}
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowTransition()) {
setupFormEditorItemTree(nextNode.toQmlItemNode());
} else if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowDecision()) {
setupFormEditorItemTree(nextNode.toQmlItemNode());
} else if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowWildcard()) {
setupFormEditorItemTree(nextNode.toQmlItemNode());
for (const QmlObjectNode &childNode : allDirectSubNodes) {
if (QmlVisualNode::isValidQmlVisualNode(childNode)
&& childNode.toQmlVisualNode().isFlowTransition()) {
setupFormEditorItemTree(childNode.toQmlItemNode());
} else if (QmlVisualNode::isValidQmlVisualNode(childNode)
&& childNode.toQmlVisualNode().isFlowDecision()) {
setupFormEditorItemTree(childNode.toQmlItemNode());
} else if (QmlVisualNode::isValidQmlVisualNode(childNode)
&& childNode.toQmlVisualNode().isFlowWildcard()) {
setupFormEditorItemTree(childNode.toQmlItemNode());
}
}
} else {
@@ -632,8 +637,21 @@ void FormEditorView::auxiliaryDataChanged(const ModelNode &node, const PropertyN
}
}
static void updateTransitions(FormEditorScene *scene, const QmlItemNode &qmlItemNode)
{
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 FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeList)
{
const bool isFlow = rootModelNode().isValid() && QmlItemNode(rootModelNode()).isFlowView();
QList<FormEditorItem*> itemNodeList;
for (const ModelNode &node : completedNodeList) {
const QmlItemNode qmlItemNode(node);
@@ -641,6 +659,8 @@ void FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeL
if (FormEditorItem *item = scene()->itemForQmlItemNode(qmlItemNode)) {
scene()->synchronizeParent(qmlItemNode);
itemNodeList.append(item);
if (isFlow && qmlItemNode.isFlowItem())
updateTransitions(scene(), qmlItemNode);
}
}
}

View File

@@ -75,14 +75,18 @@ QVariant ItemLibraryCategoriesModel::data(const QModelIndex &index, int role) co
bool ItemLibraryCategoriesModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
// currently only categoryExpanded property is updatable
// currently only categoryExpanded and categoryVisible properties is updatable
if (index.isValid() && m_roleNames.contains(role)) {
QVariant currValue = m_categoryList.at(index.row())->property(m_roleNames.value(role));
if (currValue != value) {
m_categoryList[index.row()]->setProperty(m_roleNames.value(role), value);
if (m_roleNames.value(role) == "categoryExpanded") {
ItemLibraryModel::saveExpandedState(value.toBool(),
m_categoryList[index.row()]->categoryName());
} else if (m_roleNames.value(role) == "categoryVisible") {
ItemLibraryModel::saveCategoryVisibleState(value.toBool(),
m_categoryList[index.row()]->categoryName());
}
emit dataChanged(index, index, {role});
return true;
@@ -139,6 +143,17 @@ void ItemLibraryCategoriesModel::resetModel()
endResetModel();
}
void ItemLibraryCategoriesModel::showAllCategories(bool show)
{
for (const auto &category : std::as_const(m_categoryList)) {
if (category->isCategoryVisible() != show) {
category->setCategoryVisible(show);
ItemLibraryModel::saveCategoryVisibleState(show, category->categoryName());
}
}
emit dataChanged(index(0), index(m_categoryList.size() - 1), {m_roleNames.key("categoryVisible")});
}
void ItemLibraryCategoriesModel::addRoleNames()
{
int role = 0;

View File

@@ -54,6 +54,7 @@ public:
void sortCategorySections();
void resetModel();
void showAllCategories(bool show = true);
private:
void addRoleNames();

View File

@@ -87,6 +87,14 @@ bool ItemLibraryCategory::updateItemVisibility(const QString &searchText, bool *
return hasVisibleItems;
}
void ItemLibraryCategory::setCategoryVisible(bool isVisible)
{
if (isVisible != m_isVisible) {
m_isVisible = isVisible;
emit categoryVisibilityChanged();
}
}
bool ItemLibraryCategory::setVisible(bool isVisible)
{
if (isVisible != m_isVisible) {
@@ -97,7 +105,7 @@ bool ItemLibraryCategory::setVisible(bool isVisible)
return false;
}
bool ItemLibraryCategory::isVisible() const
bool ItemLibraryCategory::isCategoryVisible() const
{
return m_isVisible;
}

View File

@@ -36,7 +36,7 @@ class ItemLibraryCategory : public QObject
Q_OBJECT
Q_PROPERTY(QString categoryName READ categoryName FINAL)
Q_PROPERTY(bool categoryVisible READ isVisible NOTIFY visibilityChanged FINAL)
Q_PROPERTY(bool categoryVisible READ isCategoryVisible WRITE setCategoryVisible NOTIFY categoryVisibilityChanged FINAL)
Q_PROPERTY(bool categoryExpanded READ categoryExpanded WRITE setExpanded NOTIFY expandedChanged FINAL)
Q_PROPERTY(QObject *itemModel READ itemModel NOTIFY itemModelChanged FINAL)
@@ -52,8 +52,9 @@ public:
bool updateItemVisibility(const QString &searchText, bool *changed);
void setCategoryVisible(bool isVisible);
bool setVisible(bool isVisible);
bool isVisible() const;
bool isCategoryVisible() const;
void sortItems();
@@ -63,6 +64,7 @@ signals:
void itemModelChanged();
void visibilityChanged();
void expandedChanged();
void categoryVisibilityChanged();
private:
ItemLibraryItemsModel m_itemModel;

View File

@@ -116,19 +116,28 @@ bool ItemLibraryImport::updateCategoryVisibility(const QString &searchText, bool
*changed = false;
for (const auto &category : m_categoryModel.categorySections()) {
bool categoryChanged = false;
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
categoryChanged |= category->setVisible(hasVisibleItems);
category->setCategoryVisible(ItemLibraryModel::loadCategoryVisibleState(category->categoryName()));
*changed |= categoryChanged;
if (!searchText.isEmpty() || category->isCategoryVisible()) {
bool categoryChanged = false;
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
categoryChanged |= category->setVisible(hasVisibleItems);
if (hasVisibleItems)
hasVisibleCategories = true;
*changed |= categoryChanged;
if (hasVisibleItems)
hasVisibleCategories = true;
}
}
return hasVisibleCategories;
}
void ItemLibraryImport::showAllCategories(bool show)
{
m_categoryModel.showAllCategories(show);
}
Import ItemLibraryImport::importEntry() const
{
return m_import;
@@ -235,4 +244,22 @@ void ItemLibraryImport::updateRemovable()
}
}
// returns true if all categories are visible, otherwise false
bool ItemLibraryImport::importCatVisibleState() const
{
if (m_categoryModel.rowCount() > 0) {
for (ItemLibraryCategory *cat : m_categoryModel.categorySections()) {
if (!cat->isCategoryVisible())
return false;
}
}
return true;
}
void ItemLibraryImport::setImportCatVisibleState(bool show)
{
m_categoryModel.showAllCategories(show);
}
} // namespace QmlDesigner

View File

@@ -43,6 +43,7 @@ class ItemLibraryImport : public QObject
Q_PROPERTY(bool importExpanded READ importExpanded WRITE setImportExpanded NOTIFY importExpandChanged FINAL)
Q_PROPERTY(bool importRemovable READ importRemovable NOTIFY importRemovableChanged FINAL)
Q_PROPERTY(bool importUnimported READ importUnimported FINAL)
Q_PROPERTY(bool importCatVisibleState READ importCatVisibleState WRITE setImportCatVisibleState NOTIFY importCatVisibleStateChanged FINAL)
Q_PROPERTY(QObject *categoryModel READ categoryModel NOTIFY categoryModelChanged FINAL)
public:
@@ -64,6 +65,7 @@ public:
bool importVisible() const;
bool importUsed() const;
bool importRemovable() const;
bool importCatVisibleState() const;
bool hasCategories() const;
bool hasSingleCategory() const;
ItemLibraryCategory *getCategorySection(const QString &categoryName) const;
@@ -75,7 +77,9 @@ public:
void setImportUsed(bool importUsed);
void sortCategorySections();
void setImportExpanded(bool expanded = true);
void setImportCatVisibleState(bool show);
void expandCategories(bool expand = true);
void showAllCategories(bool show = true);
static QString userComponentsTitle();
static QString quick3DAssetsTitle();
@@ -89,6 +93,7 @@ signals:
void importUsedChanged();
void importExpandChanged();
void importRemovableChanged();
void importCatVisibleStateChanged();
private:
void updateRemovable();

View File

@@ -59,6 +59,49 @@ bool ItemLibraryModel::loadExpandedState(const QString &sectionName)
return expandedStateHash.value(sectionName, true);
}
void ItemLibraryModel::saveCategoryVisibleState(bool isVisible, const QString &categoryName)
{
categoryVisibleStateHash.insert(categoryName, isVisible);
}
bool ItemLibraryModel::loadCategoryVisibleState(const QString &categoryName)
{
return categoryVisibleStateHash.value(categoryName, true);
}
void ItemLibraryModel::showHiddenCategories()
{
for (const QPointer<ItemLibraryImport> &import : std::as_const(m_importList)) {
if (import->hasCategories())
import->showAllCategories(true);
}
categoryVisibleStateHash.clear();
}
bool ItemLibraryModel::getIsAnyCategoryHidden() const
{
for (const bool &catState : std::as_const(categoryVisibleStateHash)) {
if (!catState)
return true;
}
return false;
}
bool ItemLibraryModel::isAnyCategoryHidden() const
{
return m_isAnyCategoryHidden;
}
void ItemLibraryModel::setIsAnyCategoryHidden(bool state)
{
if (state != m_isAnyCategoryHidden) {
m_isAnyCategoryHidden = state;
emit isAnyCategoryHiddenChanged();
}
}
void ItemLibraryModel::expandAll()
{
int i = 0;

View File

@@ -41,6 +41,7 @@ class ItemLibraryImport;
class ItemLibraryModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(bool isAnyCategoryHidden READ isAnyCategoryHidden WRITE setIsAnyCategoryHidden NOTIFY isAnyCategoryHiddenChanged FINAL)
public:
explicit ItemLibraryModel(QObject *parent = nullptr);
@@ -62,15 +63,25 @@ public:
void setSearchText(const QString &searchText);
void setFlowMode(bool);
bool isAnyCategoryHidden() const;
void setIsAnyCategoryHidden(bool state);
static void registerQmlTypes();
static void saveExpandedState(bool expanded, const QString &sectionName);
static bool loadExpandedState(const QString &sectionName);
static void saveCategoryVisibleState(bool isVisible, const QString &categoryName);
static bool loadCategoryVisibleState(const QString &categoryName);
Q_INVOKABLE void expandAll();
Q_INVOKABLE void collapseAll();
Q_INVOKABLE void showHiddenCategories();
Q_INVOKABLE bool getIsAnyCategoryHidden() const;
Import entryToImport(const ItemLibraryEntry &entry);
signals:
void isAnyCategoryHiddenChanged();
private:
void updateVisibility(bool *changed);
void addRoleNames();
@@ -82,8 +93,10 @@ private:
QString m_searchText;
bool m_flowMode = false;
bool m_isAnyCategoryHidden = false;
inline static QHash<QString, bool> expandedStateHash;
inline static QHash<QString, bool> categoryVisibleStateHash;
};
} // namespace QmlDesigner

View File

@@ -126,8 +126,6 @@ QIcon paintPreview(const QColor& background)
QIcon paintPreview(const EasingCurve &curve, const QColor& background, const QColor& curveColor)
{
const QColor curveLine = Theme::getColor(Theme::DStextColor);
QPixmap pm(iconWidth, iconHeight);
pm.fill(background);

View File

@@ -328,8 +328,11 @@ void TransitionEditorWidget::init()
if (root.isValid() && root.hasProperty("transitions")) {
NodeAbstractProperty transitions = root.nodeAbstractProperty("transitions");
if (transitions.isValid())
transition = transitions.directSubNodes().constFirst();
if (transitions.isValid()) {
const QList<ModelNode> directSubNodes = transitions.directSubNodes();
if (!directSubNodes.isEmpty())
transition = directSubNodes.constFirst();
}
}
m_graphicsScene->setTransition(transition);

View File

@@ -104,16 +104,26 @@ QStringList globalQtEnums()
QStringList knownEnumScopes()
{
static const QStringList list = {
"TextInput", "TextEdit", "Material", "Universal", "Font", "Shape", "ShapePath",
"AbstractButton", "Text", "ShaderEffectSource", "Grid"
};
static const QStringList list = {"TextInput",
"TextEdit",
"Material",
"Universal",
"Font",
"Shape",
"ShapePath",
"AbstractButton",
"Text",
"ShaderEffectSource",
"Grid",
"ItemLayer",
"ImageLayer",
"SpriteLayer"};
return list;
}
bool supportedQtQuickVersion(const QString &version)
{
return supportedVersionsList().contains(version);
return version.isEmpty() || supportedVersionsList().contains(version);
}
QString stripQuotes(const QString &str)
@@ -787,11 +797,8 @@ void TextToModelMerger::setupImports(const Document::Ptr &doc,
differenceHandler.modelMissesImport(newImport);
} else {
QString importUri = toString(import->importUri);
if (importUri == QStringLiteral("Qt") && version == QStringLiteral("4.7")) {
importUri = QStringLiteral("QtQuick");
version = QStringLiteral("1.0");
}
if (version.isEmpty())
version = "2.15";
const Import newImport =
Import::createLibraryImport(importUri, version, as, m_rewriterView->importDirectories());
@@ -946,9 +953,13 @@ void TextToModelMerger::setupUsedImports()
}
for (const QmlJS::Import &import : allImports) {
QString version = import.info.version().toString();
if (version.isEmpty())
version = "2.15";
if (!import.info.name().isEmpty() && usedImportsSet.contains(import.info.name())) {
if (import.info.type() == ImportType::Library)
usedImports.append(Import::createLibraryImport(import.info.name(), import.info.version().toString(), import.info.as()));
usedImports.append(
Import::createLibraryImport(import.info.name(), version, import.info.as()));
else if (import.info.type() == ImportType::Directory || import.info.type() == ImportType::File)
usedImports.append(Import::createFileImport(import.info.name(), import.info.version().toString(), import.info.as()));
}

View File

@@ -1040,11 +1040,16 @@ QString BaseQtVersionPrivate::findHostBinary(HostBinaries binary) const
switch (binary) {
case Designer:
case Linguist:
case Rcc:
case Uic:
case QScxmlc:
baseDir = q->hostBinPath().toString();
break;
case Rcc:
case Uic:
if (q->qtVersion() >= QtVersionNumber(6, 1))
baseDir = q->hostLibexecPath().toString();
else
baseDir = q->hostBinPath().toString();
break;
default:
// Can't happen
Q_ASSERT(false);

View File

@@ -305,6 +305,6 @@ Image {
scale: 0.5
checked: usageStatisticModel.usageStatisticEnabled
onCheckedChanged: usageStatisticModel.setPluginEnabled(usageStatisticCheckBox.checked)
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
}
}

View File

@@ -49,36 +49,55 @@
#include <QAbstractListModel>
#include <QApplication>
#include <QDesktopServices>
#include <QFontDatabase>
#include <QFileInfo>
#include <QFontDatabase>
#include <QPointer>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQuickItem>
#include <QQuickView>
#include <QQuickWidget>
#include <QSettings>
#include <QTimer>
#include <algorithm>
#include <memory>
namespace StudioWelcome {
namespace Internal {
const char DO_NOT_SHOW_SPLASHSCREEN_AGAIN_KEY[] = "StudioSplashScreen";
const char DETAILED_USAGE_STATISTICS[] = "DetailedUsageStatistics";
const char STATISTICS_COLLECTION_MODE[] = "StatisticsCollectionMode";
const char NO_TELEMETRY[] = "NoTelemetry";
QPointer<QQuickWidget> s_view = nullptr;
static StudioWelcomePlugin *s_pluginInstance = nullptr;
static bool isUsageStatistic(const ExtensionSystem::PluginSpec *spec)
std::unique_ptr<QSettings> makeUserFeedbackSettings()
{
if (!spec)
return false;
QStringList domain = QCoreApplication::organizationDomain().split(QLatin1Char('.'));
std::reverse(domain.begin(), domain.end());
QString productId = domain.join(QLatin1String("."));
if (!productId.isEmpty())
productId += ".";
productId += QCoreApplication::applicationName();
return spec->name().contains("UsageStatistic");
}
QString organization;
if (Utils::HostOsInfo::isMacHost()) {
organization = QCoreApplication::organizationDomain().isEmpty()
? QCoreApplication::organizationName()
: QCoreApplication::organizationDomain();
} else {
organization = QCoreApplication::organizationName().isEmpty()
? QCoreApplication::organizationDomain()
: QCoreApplication::organizationName();
}
ExtensionSystem::PluginSpec *getUsageStatisticPlugin()
{
const auto plugins = ExtensionSystem::PluginManager::plugins();
return Utils::findOrDefault(plugins, &isUsageStatistic);
std::unique_ptr<QSettings> settings(new QSettings(organization, "UserFeedback." + productId));
settings->beginGroup("UserFeedback");
return settings;
}
class UsageStatisticPluginModel : public QObject
@@ -95,27 +114,21 @@ public:
void setupModel()
{
auto plugin = getUsageStatisticPlugin();
if (plugin)
m_usageStatisticEnabled = plugin->isEnabledBySettings();
else
m_usageStatisticEnabled = false;
auto settings = makeUserFeedbackSettings();
QVariant value = settings->value(STATISTICS_COLLECTION_MODE);
m_usageStatisticEnabled = value.isValid() && value.toString() == DETAILED_USAGE_STATISTICS;
emit usageStatisticChanged();
}
Q_INVOKABLE void setPluginEnabled(bool b)
Q_INVOKABLE void setTelemetryEnabled(bool b)
{
auto plugin = getUsageStatisticPlugin();
if (!plugin)
if (m_usageStatisticEnabled == b)
return;
if (plugin->isEnabledBySettings() == b)
return;
auto settings = makeUserFeedbackSettings();
plugin->setEnabledBySettings(b);
ExtensionSystem::PluginManager::writeSettings();
settings->setValue(STATISTICS_COLLECTION_MODE, b ? DETAILED_USAGE_STATISTICS : NO_TELEMETRY);
// pause remove splash timer while dialog is open otherwise splash crashes upon removal
s_pluginInstance->pauseRemoveSplashTimer();
@@ -139,9 +152,9 @@ class ProjectModel : public QAbstractListModel
{
Q_OBJECT
public:
enum { FilePathRole = Qt::UserRole+1, PrettyFilePathRole };
enum { FilePathRole = Qt::UserRole + 1, PrettyFilePathRole };
Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged)
Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged)
explicit ProjectModel(QObject *parent = nullptr);
@@ -161,16 +174,12 @@ public:
Q_INVOKABLE void openProjectAt(int row)
{
const QString projectFile = data(index(row, 0),
ProjectModel::FilePathRole).toString();
const QString projectFile = data(index(row, 0), ProjectModel::FilePathRole).toString();
if (QFileInfo::exists(projectFile))
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(projectFile);
}
Q_INVOKABLE int get(int)
{
return -1;
}
Q_INVOKABLE int get(int) { return -1; }
Q_INVOKABLE void showHelp()
{
@@ -200,8 +209,11 @@ public:
const QString projectFile = Core::ICore::resourcePath() + "/examples/" + example + "/"
+ example + ".qmlproject";
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(projectFile);
const QString qmlFile = Core::ICore::resourcePath() + "/examples/" + example + "/" + formFile;
const QString qmlFile = Core::ICore::resourcePath() + "/examples/" + example + "/"
+ formFile;
Core::EditorManager::openEditor(qmlFile);
}
public slots:
@@ -222,9 +234,9 @@ ProjectModel::ProjectModel(QObject *parent)
this,
&ProjectModel::resetProjects);
if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(),
Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker"))))
Utils::equal(&ExtensionSystem::PluginSpec::name,
QString("LicenseChecker"))))
m_communityVersion = true;
}
@@ -235,8 +247,8 @@ int ProjectModel::rowCount(const QModelIndex &) const
QVariant ProjectModel::data(const QModelIndex &index, int role) const
{
QPair<QString,QString> data =
ProjectExplorer::ProjectExplorerPlugin::recentProjects().at(index.row());
QPair<QString, QString> data = ProjectExplorer::ProjectExplorerPlugin::recentProjects().at(
index.row());
switch (role) {
case Qt::DisplayRole:
return data.second;
@@ -275,7 +287,6 @@ public:
~WelcomeMode() override;
private:
QQuickWidget *m_modeWidget = nullptr;
};
@@ -344,22 +355,25 @@ void StudioWelcomePlugin::extensionsInitialized()
s_view->setWindowFlag(Qt::SplashScreen, true);
s_view->setWindowModality(Qt::ApplicationModal);
s_view->engine()->addImportPath("qrc:/studiofonts");
#ifdef QT_DEBUG
s_view->engine()->addImportPath(QLatin1String(STUDIO_QML_PATH)
+ "splashscreen/imports");
s_view->setSource(QUrl::fromLocalFile(QLatin1String(STUDIO_QML_PATH)
+ "splashscreen/main.qml"));
#else
#ifdef QT_DEBUG
s_view->engine()->addImportPath(QLatin1String(STUDIO_QML_PATH) + "splashscreen/imports");
s_view->setSource(
QUrl::fromLocalFile(QLatin1String(STUDIO_QML_PATH) + "splashscreen/main.qml"));
#else
s_view->engine()->addImportPath("qrc:/qml/splashscreen/imports");
s_view->setSource(QUrl("qrc:/qml/splashscreen/main.qml"));
#endif
#endif
QTC_ASSERT(s_view->rootObject(),
qWarning() << "The StudioWelcomePlugin has a runtime depdendency on qt/qtquicktimeline.";
return);
qWarning() << "The StudioWelcomePlugin has a runtime depdendency on "
"qt/qtquicktimeline.";
return );
connect(s_view->rootObject(), SIGNAL(closeClicked()), this, SLOT(closeSplashScreen()));
connect(s_view->rootObject(), SIGNAL(configureClicked()), this, SLOT(showSystemSettings()));
connect(s_view->rootObject(),
SIGNAL(configureClicked()),
this,
SLOT(showSystemSettings()));
s_view->show();
s_view->raise();
@@ -374,7 +388,7 @@ bool StudioWelcomePlugin::delayedInitialize()
if (s_view.isNull())
return false;
QTC_ASSERT(s_view->rootObject() , return true);
QTC_ASSERT(s_view->rootObject(), return true);
#ifdef ENABLE_CRASHPAD
const bool crashReportingEnabled = true;

View File

@@ -30,6 +30,7 @@
#include <texteditor/completionsettings.h>
#include <QDebug>
#include <QElapsedTimer>
#include <QRegularExpression>
#include <QtAlgorithms>
#include <QHash>
@@ -297,28 +298,46 @@ void GenericProposalModel::filter(const QString &prefix)
convertCaseSensitivity(TextEditorSettings::completionSettings().m_caseSensitivity);
const QRegularExpression regExp = FuzzyMatcher::createRegExp(prefix, caseSensitivity);
QElapsedTimer timer;
timer.start();
m_currentItems.clear();
const QString lowerPrefix = prefix.toLower();
const bool checkInfix = prefix.size() >= 3;
for (const auto &item : qAsConst(m_originalItems)) {
const QString &text = item->text();
// Direct match?
if (text.startsWith(prefix)) {
m_currentItems.append(item);
item->setProposalMatch(text.length() == prefix.length()
? AssistProposalItemInterface::ProposalMatch::Full
: AssistProposalItemInterface::ProposalMatch::Exact);
continue;
}
if (text.startsWith(lowerPrefix, Qt::CaseInsensitive)) {
m_currentItems.append(item);
item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Prefix);
continue;
}
if (checkInfix && text.contains(lowerPrefix, Qt::CaseInsensitive)) {
m_currentItems.append(item);
item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix);
continue;
}
// Our fuzzy matcher can become unusably slow with certain inputs, so skip it
// if we'd become unresponsive. See QTCREATORBUG-25419.
if (timer.elapsed() > 100)
continue;
const QRegularExpressionMatch match = regExp.match(text);
const bool hasPrefixMatch = match.capturedStart() == 0;
const bool hasInfixMatch = prefix.size() >= 3 && match.hasMatch();
if (hasPrefixMatch || hasInfixMatch) {
const bool hasInfixMatch = checkInfix && match.hasMatch();
if (hasPrefixMatch || hasInfixMatch)
m_currentItems.append(item);
if (text.startsWith(prefix)) {
// Direct match
item->setProposalMatch(text.length() == prefix.length()
? AssistProposalItemInterface::ProposalMatch::Full
: AssistProposalItemInterface::ProposalMatch::Exact);
continue;
}
if (text.startsWith(lowerPrefix, Qt::CaseInsensitive))
item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Prefix);
else if (text.contains(lowerPrefix, Qt::CaseInsensitive))
item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix);
}
}
}

View File

@@ -1999,7 +1999,7 @@ void TextEditorWidgetPrivate::moveLineUpDown(bool up)
move.setPosition(cursor.selectionStart());
move.movePosition(QTextCursor::StartOfBlock);
move.setPosition(cursor.selectionEnd(), QTextCursor::KeepAnchor);
move.movePosition(move.atBlockStart() ? QTextCursor::Left: QTextCursor::EndOfBlock,
move.movePosition(move.atBlockStart() ? QTextCursor::PreviousCharacter: QTextCursor::EndOfBlock,
QTextCursor::KeepAnchor);
} else {
move.movePosition(QTextCursor::StartOfBlock);
@@ -2024,19 +2024,19 @@ void TextEditorWidgetPrivate::moveLineUpDown(bool up)
}
}
move.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
move.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
move.removeSelectedText();
if (up) {
move.movePosition(QTextCursor::PreviousBlock);
move.insertBlock();
move.movePosition(QTextCursor::Left);
move.movePosition(QTextCursor::PreviousCharacter);
} else {
move.movePosition(QTextCursor::EndOfBlock);
if (move.atBlockStart()) { // empty block
move.movePosition(QTextCursor::NextBlock);
move.insertBlock();
move.movePosition(QTextCursor::Left);
move.movePosition(QTextCursor::PreviousCharacter);
} else {
move.insertBlock();
}