Merge remote-tracking branch 'origin/4.15'
Change-Id: I0afcf51d354ffd73a8f2956a7f78b1e4f032677b
2
coin/dependencies.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
dependencies: {}
|
||||||
|
|
||||||
77
coin/instructions/common_environment.yaml
Normal 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]
|
||||||
|
|
||||||
|
|
||||||
185
coin/instructions/make_instructions.yaml
Normal 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
|
||||||
|
|
||||||
77
coin/instructions/qmake_module_build.yaml
Normal 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
@@ -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
|
||||||
BIN
doc/qtcreator/images/extraimages/images/bMXeeQw6BYs.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
doc/qtcreator/images/extraimages/images/u3kZJjlk3CY.jpg
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
@@ -7,4 +7,6 @@
|
|||||||
images/UfvA04CIXv0.jpg \
|
images/UfvA04CIXv0.jpg \
|
||||||
images/FzmLuRHQXaw.jpg \
|
images/FzmLuRHQXaw.jpg \
|
||||||
images/pEETxSxYazg.jpg \
|
images/pEETxSxYazg.jpg \
|
||||||
images/V3Po15bNErw.jpg
|
images/V3Po15bNErw.jpg \
|
||||||
|
images/bMXeeQw6BYs.jpg \
|
||||||
|
images/u3kZJjlk3CY.jpg
|
||||||
|
|||||||
@@ -12,4 +12,6 @@
|
|||||||
images/FzmLuRHQXaw.jpg \
|
images/FzmLuRHQXaw.jpg \
|
||||||
images/w1yhDl93YI0.jpg \
|
images/w1yhDl93YI0.jpg \
|
||||||
images/pEETxSxYazg.jpg \
|
images/pEETxSxYazg.jpg \
|
||||||
images/V3Po15bNErw.jpg
|
images/V3Po15bNErw.jpg \
|
||||||
|
images/bMXeeQw6BYs.jpg \
|
||||||
|
images/u3kZJjlk3CY.jpg
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 21 KiB |
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2020 The Qt Company Ltd.
|
** Copyright (C) 2021 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -178,6 +178,11 @@
|
|||||||
\li Add and remove subprojects.
|
\li Add and remove subprojects.
|
||||||
\endif
|
\endif
|
||||||
\li Search from the selected directory.
|
\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
|
\li Expand or collapse the tree view to show or hide all files and
|
||||||
folders.
|
folders.
|
||||||
\li Close all files in a project.
|
\li Close all files in a project.
|
||||||
|
|||||||
@@ -61,6 +61,9 @@
|
|||||||
linked frameworks, such as the Qt framework itself. You do not need this
|
linked frameworks, such as the Qt framework itself. You do not need this
|
||||||
option for debugging your application code.
|
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
|
You can also create custom executable run configurations where you
|
||||||
can set the executable to be run. For more information, see
|
can set the executable to be run. For more information, see
|
||||||
\l{Specifying a Custom Executable to Run}.
|
\l{Specifying a Custom Executable to Run}.
|
||||||
|
|||||||
@@ -41,15 +41,17 @@
|
|||||||
|
|
||||||
\title Design Views
|
\title Design Views
|
||||||
|
|
||||||
\image studio-design-mode.png "Design views"
|
|
||||||
|
|
||||||
\QDS contains views for designing UIs. To open them, select
|
\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
|
You can move the views anywhere on the screen and save them as
|
||||||
\e workspaces, as instructed in \l {Managing Workspaces}.
|
\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
|
\youtube RfEYO-5Mw6s
|
||||||
|
|
||||||
@@ -63,8 +65,7 @@
|
|||||||
\row
|
\row
|
||||||
\li \l{Form Editor}
|
\li \l{Form Editor}
|
||||||
\li Provides a working area for designing 2D UIs.
|
\li Provides a working area for designing 2D UIs.
|
||||||
|
When you are editing 3D scenes, \uicontrol {Form Editor} is
|
||||||
When you are editing 3D scenes, the \uicontrol {Form Editor} is
|
|
||||||
used as a canvas for the 3D scene projected by the camera.
|
used as a canvas for the 3D scene projected by the camera.
|
||||||
\li \l{Form Editor}
|
\li \l{Form Editor}
|
||||||
\row
|
\row
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
\row
|
\row
|
||||||
\li \l{Working in Edit Mode}{Text Editor}
|
\li \l{Working in Edit Mode}{Text Editor}
|
||||||
\li Provides a code editor for viewing and modifying the code
|
\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}
|
\li \l {Working in Edit Mode}
|
||||||
\row
|
\row
|
||||||
\li \l{Viewing Project Files}{Projects}
|
\li \l{Viewing Project Files}{Projects}
|
||||||
@@ -137,60 +138,69 @@
|
|||||||
|
|
||||||
\section1 Summary of Main Toolbar Actions
|
\section1 Summary of Main Toolbar Actions
|
||||||
|
|
||||||
The top level toolbar in the Design mode contains shortcuts to widely used
|
The top level toolbar in the \uicontrol Design mode contains shortcuts to
|
||||||
actions.
|
widely used actions.
|
||||||
|
|
||||||
\table
|
\table
|
||||||
\header
|
\header
|
||||||
\li Button/Field
|
\li Button/Field
|
||||||
\li Action
|
\li Action
|
||||||
|
\li Keyboard Shortcut
|
||||||
\li Read More
|
\li Read More
|
||||||
\row
|
\row
|
||||||
\li \inlineimage prev.png
|
\li \inlineimage prev.png
|
||||||
\li \uicontrol {Go Back} (\key Alt+<): moves a step backwards in your
|
\li \uicontrol {Go Back}: moves a step backwards in your location history.
|
||||||
location history. That is, returns focus to the last location in
|
That is, returns the focus to the last location in the last file it
|
||||||
the last file it was on.
|
was on.
|
||||||
|
\li \key Alt+< (\key Opt+Cmd+< on \macos)
|
||||||
\li \l{Navigating Between Open Files and Symbols}
|
\li \l{Navigating Between Open Files and Symbols}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage next.png
|
\li \inlineimage next.png
|
||||||
\li \uicontrol {Go Forward} (\key Alt+>): moves a step forward in your
|
\li \uicontrol {Go Forward}: moves a step forward in your location history.
|
||||||
location history.
|
\li \key Alt+> (\key Opt+Cmd+> on \macos)
|
||||||
\li \l{Navigating Between Open Files and Symbols}
|
\li \l{Navigating Between Open Files and Symbols}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage unlocked.png
|
\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}
|
\li \l{Viewing Open Documents}
|
||||||
\row
|
\row
|
||||||
\li File type icon
|
\li File type icon
|
||||||
\li Indicates the type of the currently open file. Design views cannot
|
\li Indicates the type of the currently open file. Design views cannot
|
||||||
be split, so the icon cannot be dragged, contrary to the tooltip.
|
be split, so the icon cannot be dragged, contrary to the tooltip.
|
||||||
|
\li
|
||||||
\li \l{Viewing Open Documents}
|
\li \l{Viewing Open Documents}
|
||||||
\row
|
\row
|
||||||
\li Currently open file
|
\li Currently open file
|
||||||
\li Displays the location and filename of the currently open file. You
|
\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
|
can select another file in the list of open files to view it in
|
||||||
\uicontrol {Form Editor} and \uicontrol Navigator.
|
\uicontrol {Form Editor} and \uicontrol Navigator.
|
||||||
|
\li
|
||||||
\li \l{Viewing Open Documents}
|
\li \l{Viewing Open Documents}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage close.png
|
\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
|
\li
|
||||||
\row
|
\row
|
||||||
\li \inlineimage live_preview.png
|
\li \inlineimage live_preview.png
|
||||||
\li \uicontrol {Show Live Preview} (\key Alt+P) shows a preview of the
|
\li \uicontrol {Show Live Preview} shows a preview of the current file
|
||||||
current file or the entire UI. The changes you make to the UI are
|
or the entire UI. The changes you make to the UI are instantly
|
||||||
instantly visible to you in the preview.
|
visible to you in the preview.
|
||||||
|
\li \key Alt+P (\key Opt+P on \macos)
|
||||||
\li \l{Previewing}
|
\li \l{Previewing}
|
||||||
\row
|
\row
|
||||||
\li Preview size
|
\li Preview size
|
||||||
\li Displays the size of the preview dialog as a percentage. You can
|
\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
|
select another percentage in the list to view the UI in different
|
||||||
sizes.
|
sizes.
|
||||||
|
\li
|
||||||
\li \l{Previewing on Desktop}
|
\li \l{Previewing on Desktop}
|
||||||
\row
|
\row
|
||||||
\li FPS
|
\li FPS
|
||||||
\li Displays the frames-per-second (FPS) refresh rate of previewed
|
\li Displays the frames-per-second (FPS) refresh rate of previewed
|
||||||
animations.
|
animations.
|
||||||
|
\li
|
||||||
\li \l{Previewing on Desktop}
|
\li \l{Previewing on Desktop}
|
||||||
\row
|
\row
|
||||||
\li Preview language
|
\li Preview language
|
||||||
@@ -198,67 +208,81 @@
|
|||||||
preview. You can select another language in the list of languages
|
preview. You can select another language in the list of languages
|
||||||
that the application has been localized to.
|
that the application has been localized to.
|
||||||
\li
|
\li
|
||||||
|
\li
|
||||||
\row
|
\row
|
||||||
\li \inlineimage qtcreator-reset-position-icon.png
|
\li \inlineimage qtcreator-reset-position-icon.png
|
||||||
\li Returns a component to its \e {implicit position} after it was
|
\li Returns a component to its \e {implicit position} after
|
||||||
moved.
|
being moved.
|
||||||
|
\li \key Ctrl+D (\key Cmd+D on \macos)
|
||||||
\li \l{Resetting Component Position and Size}
|
\li \l{Resetting Component Position and Size}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage qtcreator-reset-size-icon.png
|
\li \inlineimage qtcreator-reset-size-icon.png
|
||||||
\li Returns a component to its implicit size after it was scaled.
|
\li Returns a component to its implicit size after it was scaled.
|
||||||
|
\li \key Shift+S
|
||||||
\li \l{Resetting Component Position and Size}
|
\li \l{Resetting Component Position and Size}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage icons/anchor-fill.png
|
\li \inlineimage icons/anchor-fill.png
|
||||||
\li Fills the selected component to its parent component.
|
\li Fills the selected component to its parent component.
|
||||||
|
\li \key Shift+F
|
||||||
\li \l{Setting Anchors and Margins}
|
\li \l{Setting Anchors and Margins}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage qtcreator-anchors-reset-icon.png
|
\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}
|
\li \l{Setting Anchors and Margins}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage row.png
|
\li \inlineimage row.png
|
||||||
\li Uses a \uicontrol Row component to lay out the selected components.
|
\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}
|
\li \l{Using Layouts}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage column.png
|
\li \inlineimage column.png
|
||||||
\li Uses a \uicontrol Column component to lay out the selected
|
\li Uses a \uicontrol Column component to lay out the selected
|
||||||
components.
|
components.
|
||||||
|
\li \key Ctrl+L (\key Cmd+L on \macos)
|
||||||
\li \l{Using Layouts}
|
\li \l{Using Layouts}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage grid.png
|
\li \inlineimage grid.png
|
||||||
\li Uses a \uicontrol Grid component to lay out the selected
|
\li Uses a \uicontrol Grid component to lay out the selected
|
||||||
components.
|
components.
|
||||||
|
\li \key Shift+G
|
||||||
\li \l{Using Layouts}
|
\li \l{Using Layouts}
|
||||||
\if defined(qtdesignstudio)
|
\if defined(qtdesignstudio)
|
||||||
\row
|
\row
|
||||||
\li \inlineimage icons/edit.png
|
\li \inlineimage icons/edit.png
|
||||||
\li \uicontrol {Show Event List} (\key {Alt+E}): opens a dialog for
|
\li \uicontrol {Show Event List}: opens a dialog for viewing and
|
||||||
viewing and creating an event list for an application flow.
|
creating an event list for an application flow.
|
||||||
|
\li \key Alt+E (\key Opt+E on \macos)
|
||||||
\li \l{Simulating Events}
|
\li \l{Simulating Events}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage icons/assign.png
|
\li \inlineimage icons/assign.png
|
||||||
\li \uicontrol {Assign Events to Actions} (\key {Alt+A}): assigns
|
\li \uicontrol {Assign Events to Actions}: assigns events to actions in
|
||||||
events to actions in an application flow.
|
an application flow.
|
||||||
|
\li \key Alt+A (\key Opt+A on \macos)
|
||||||
\li \l{Simulating Events}
|
\li \l{Simulating Events}
|
||||||
\endif
|
\endif
|
||||||
\row
|
\row
|
||||||
\li Styling
|
\li Styling
|
||||||
\li Displays the UI style used for UI controls.
|
\li Displays the UI style used for UI controls.
|
||||||
|
\li
|
||||||
\li \l{Styling Controls}
|
\li \l{Styling Controls}
|
||||||
\row
|
\row
|
||||||
\li Subcomponents
|
\li Subcomponents
|
||||||
\li Displays the components referred to in the current file. Select a
|
\li Displays the components referred to in the current file. Select a
|
||||||
component in the list to open it in \uicontrol {Form Editor} and
|
component in the list to open it in \uicontrol {Form Editor} and
|
||||||
\uicontrol Navigator.
|
\uicontrol Navigator.
|
||||||
|
\li
|
||||||
\li \l{Creating Components}
|
\li \l{Creating Components}
|
||||||
\row
|
\row
|
||||||
\li Workspace
|
\li Workspace
|
||||||
\li Displays the currently selected workspace. To switch to another
|
\li Displays the currently selected workspace. To switch to another
|
||||||
workspace, select it in the list.
|
workspace, select it in the list.
|
||||||
|
\li
|
||||||
\li \l{Managing Workspaces}
|
\li \l{Managing Workspaces}
|
||||||
\row
|
\row
|
||||||
\li \inlineimage icons/annotation.png
|
\li \inlineimage icons/annotation.png
|
||||||
\li Enables you to add or edit global annotations.
|
\li Enables you to add or edit global annotations.
|
||||||
|
\li
|
||||||
\li \l{Annotating Designs}
|
\li \l{Annotating Designs}
|
||||||
\endtable
|
\endtable
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
\li \l {Logic Helpers}
|
\li \l {Logic Helpers}
|
||||||
\endif
|
\endif
|
||||||
\li \l Animations
|
\li \l Animations
|
||||||
|
\li \l{Using 3D Components}{3D Components}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
For more information about creating your own components, see
|
For more information about creating your own components, see
|
||||||
@@ -74,14 +75,17 @@
|
|||||||
|
|
||||||
\section2 Adding and Removing Modules
|
\section2 Adding and Removing Modules
|
||||||
|
|
||||||
When you create projects, modules typically needed in them are added by
|
When you \l{Creating Projects}{create projects}, modules typically needed in
|
||||||
default. For example, an empty application project contains only basic
|
them are added by default. For example, an empty application project
|
||||||
components, while a 3D application project contains additional 3D
|
contains only basic components, while a 3D application project contains
|
||||||
components.
|
additional 3D components.
|
||||||
|
|
||||||
To add modules to the project, select \inlineimage plus.png
|
To view the list of available modules, select \inlineimage plus.png
|
||||||
, and then select the module to add from the list of available
|
. Most commonly used modules are placed at the top of the list in
|
||||||
modules.
|
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"
|
\image qtquick-components-tab-add.png "Select Modules to Add"
|
||||||
|
|
||||||
@@ -90,11 +94,8 @@
|
|||||||
\uicontrol QtQuick.Controls module, the following import statement
|
\uicontrol QtQuick.Controls module, the following import statement
|
||||||
is added to the code: \c {import QtQuick.Controls}.
|
is added to the code: \c {import QtQuick.Controls}.
|
||||||
|
|
||||||
You can search for components and modules by entering search criteria
|
Since the added components and modules are packaged with your UI into the
|
||||||
in the \uicontrol Search field.
|
final application package, it is recommended that you select
|
||||||
|
|
||||||
The added components and modules are packaged with your UI into the final
|
|
||||||
application package, so it is recommended that you select
|
|
||||||
\uicontrol {Remove Module} to remove the ones you don't use in the project.
|
\uicontrol {Remove Module} to remove the ones you don't use in the project.
|
||||||
|
|
||||||
\section1 Assets
|
\section1 Assets
|
||||||
|
|||||||
BIN
doc/qtdesignstudio/images/studio-3d-effects.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
doc/qtdesignstudio/images/studio-3d-materials.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.4 KiB |
BIN
doc/qtdesignstudio/images/studio-design-mode-states-timeline.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
BIN
doc/qtdesignstudio/images/studio-qtquick-3d-shader-effect.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -144,13 +144,13 @@
|
|||||||
|
|
||||||
\section2 Importing the Simulink Connector
|
\section2 Importing the Simulink Connector
|
||||||
|
|
||||||
To integrate the Simulink model into \QDS, you first need to import the
|
To integrate the Simulink model into \QDS, you first need to add the
|
||||||
Simulink connector in \uicontrol Library. Click the \uicontrol {QML Imports
|
Simulink connector module to your project. In the \l Library view, select
|
||||||
Tab}, select the \uicontrol {<Add Import>} drop-down menu, and then select
|
\uicontrol Components > \inlineimage plus.png
|
||||||
\uicontrol SimulinkConnector. \QDS is now ready to communicate with the
|
> \uicontrol SimulinkConnector. \QDS is now ready to communicate with the
|
||||||
Simulink model.
|
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
|
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
|
\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
|
To communicate with a specific model in Simulink, you need to create
|
||||||
properties matching the send and receive properties in the root of the
|
properties matching the send and receive properties in the root of the
|
||||||
application you are building. Select the root item in \uicontrol
|
application you are building. Select the root item in \uicontrol
|
||||||
Navigator to add the properties in the \uicontrol Properties tab in
|
Navigator to add the properties in \uicontrol {Connection View} >
|
||||||
\uicontrol {Connection View}.
|
\uicontrol Properties.
|
||||||
|
|
||||||
See \l {Specifying Dynamic Properties} for a detailed description of how
|
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
|
to add a custom property. The name of the property and the data type
|
||||||
|
|||||||
@@ -43,6 +43,19 @@
|
|||||||
To edit 3D components, select the component in \uicontrol {3D Editor} or in
|
To edit 3D components, select the component in \uicontrol {3D Editor} or in
|
||||||
\uicontrol Navigator and set its properties in the \l Properties view.
|
\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
|
\list
|
||||||
\li \l {Setting Group Properties}
|
\li \l {Setting Group Properties}
|
||||||
|
|
||||||
|
|||||||
@@ -49,12 +49,15 @@
|
|||||||
two-sided polygons, index-of-refraction, and fragment cutoff (masking).
|
two-sided polygons, index-of-refraction, and fragment cutoff (masking).
|
||||||
For more information, see \l {Qt Quick 3D Custom Material Reference}.
|
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
|
\uicontrol QtQuick3D > \uicontrol {Qt Quick 3D Custom Shader Utils} to
|
||||||
create custom effects and materials. For more information about the shader
|
create custom effects and materials. You can find the \uicontrol Effect
|
||||||
utilities and commands and their properties, see \l {Using Custom Shaders}.
|
component in \uicontrol Library > \uicontrol {QtQuick3D Effects} > \uicontrol
|
||||||
|
{Qt Quick 3D Custom Shader Utils}, and the \uicontrol {Custom Material}
|
||||||
\image studio-qtquick-3d-shader-utilities.png "Qt Quick 3D Custom Shader Utils tab in Library"
|
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
|
\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
|
and copy them to your project folder. You can then specify the source file
|
||||||
@@ -65,9 +68,9 @@
|
|||||||
|
|
||||||
\section1 Creating Custom Effects
|
\section1 Creating Custom Effects
|
||||||
|
|
||||||
By default, a custom effect component contains a Pass type and a Shader
|
By default, a custom effect component contains a Pass component and a Shader
|
||||||
type in the fragment stage. You can add passes, shaders, and other shader
|
component in the fragment stage. You can add passes, shaders, and other
|
||||||
utilities to the effect.
|
shader utilities to the effect.
|
||||||
|
|
||||||
\image studio-qtquick-3d-custom-effect-navigator.png "Custom effect in Navigator"
|
\image studio-qtquick-3d-custom-effect-navigator.png "Custom effect in Navigator"
|
||||||
|
|
||||||
@@ -78,7 +81,7 @@
|
|||||||
To create a custom effect:
|
To create a custom effect:
|
||||||
|
|
||||||
\list 1
|
\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 {Qt Quick 3D Custom Shader Utils} tab of
|
||||||
\uicontrol Library to a Model component in \uicontrol Navigator.
|
\uicontrol Library to a Model component in \uicontrol Navigator.
|
||||||
\li Select the custom effect component in \uicontrol Navigator to edit
|
\li Select the custom effect component in \uicontrol Navigator to edit
|
||||||
@@ -90,14 +93,14 @@
|
|||||||
for its properties in \uicontrol Properties.
|
for its properties in \uicontrol Properties.
|
||||||
\image studio-qtquick-3d-pass.png "Pass properties"
|
\image studio-qtquick-3d-pass.png "Pass properties"
|
||||||
\li To execute commands during the pass, drag and drop the following
|
\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 Navigator: \uicontrol Blending, \uicontrol {Buffer Blit},
|
||||||
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
|
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
|
||||||
\uicontrol {Depth Input}, \uicontrol {Render State}, and
|
\uicontrol {Depth Input}, \uicontrol {Render State}, and
|
||||||
\uicontrol {Set Uniform Value}. Then select the commands in the
|
\uicontrol {Set Uniform Value}. Then select the commands in the
|
||||||
\uicontrol Commands field.
|
\uicontrol Commands field.
|
||||||
\li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer
|
\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.
|
\uicontrol Buffer field.
|
||||||
\li Select the shader component in \uicontrol Navigator to set the path
|
\li Select the shader component in \uicontrol Navigator to set the path
|
||||||
to the shader files in the \uicontrol Source field in
|
to the shader files in the \uicontrol Source field in
|
||||||
@@ -107,9 +110,9 @@
|
|||||||
|
|
||||||
\section1 Creating Custom Materials
|
\section1 Creating Custom Materials
|
||||||
|
|
||||||
By default, a Custom Material component contains two Shader types, a Shader
|
By default, a Custom Material component contains two Shader components, a
|
||||||
Info type, and a Pass type. You can add shaders, passes, and other shader
|
Shader Info component, and a Pass component. You can add shaders, passes,
|
||||||
utilities to the material.
|
and other shader utilities to the material.
|
||||||
|
|
||||||
\image studio-qtquick-3d-custom-material-navigator.png "Custom material in Navigator"
|
\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
|
the paths to the shader files. Specify the paths to the shader files to use
|
||||||
in the shader properties.
|
in the shader properties.
|
||||||
|
|
||||||
The Shader Info type specifies the shader type and version, as well
|
The Shader Info component specifies the shader component and version, as
|
||||||
as the options used by the shader based on the selected shader key values,
|
well as the options used by the shader based on the selected shader key
|
||||||
such as diffuse or specular lighting, refraction, transparency, displacement,
|
values, such as diffuse or specular lighting, refraction, transparency,
|
||||||
transmissiveness, glossiness, and alpha cutout.
|
displacement, transmissiveness, glossiness, and alpha cutout.
|
||||||
|
|
||||||
The shaders are used with the Pass type to create the resulting material.
|
The shaders are used with the Pass component to create the resulting
|
||||||
A pass can contain multiple rendering passes and other commands. You can
|
material. A pass can contain multiple rendering passes and other commands.
|
||||||
use a Buffer type to allocate a buffer for storing intermediate rendering
|
You can use a Buffer component to allocate a buffer for storing intermediate
|
||||||
results.
|
rendering results.
|
||||||
|
|
||||||
To create a custom material:
|
To create a custom material:
|
||||||
|
|
||||||
\list 1
|
\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 {Qt Quick 3D Custom Shader Utils} tab of
|
||||||
\uicontrol Library to a Model component in \uicontrol Navigator.
|
\uicontrol Library to a Model component in \uicontrol Navigator.
|
||||||
\li Select the custom material component in \uicontrol Navigator to
|
\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
|
\li Select the \uicontrol {Always dirty} check box to determine that
|
||||||
the material needs to be refreshed every time it is used.
|
the material needs to be refreshed every time it is used.
|
||||||
\li In the \uicontrol {Shader Info} field, select the shader info
|
\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
|
\li In the \uicontrol Passes field, select the pass components for
|
||||||
the effect.
|
the effect.
|
||||||
\li In the \uicontrol Material group, select the
|
\li In the \uicontrol Material group, select the
|
||||||
@@ -157,7 +160,7 @@
|
|||||||
for its properties in \uicontrol Properties.
|
for its properties in \uicontrol Properties.
|
||||||
\image studio-qtquick-3d-pass.png "Pass properties"
|
\image studio-qtquick-3d-pass.png "Pass properties"
|
||||||
\li To execute commands during the pass, drag and drop the following
|
\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 Navigator: \uicontrol Blending, \uicontrol {Buffer Blit},
|
||||||
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
|
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
|
||||||
\uicontrol {Depth Input}, \uicontrol {Render State}, and
|
\uicontrol {Depth Input}, \uicontrol {Render State}, and
|
||||||
@@ -165,11 +168,11 @@
|
|||||||
at the same level as the pass component and automatically added to
|
at the same level as the pass component and automatically added to
|
||||||
the \uicontrol Commands field.
|
the \uicontrol Commands field.
|
||||||
\li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer
|
\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.
|
\uicontrol Buffer field.
|
||||||
\li To add a shader to the pass, drag and drop the \uicontrol Shader
|
\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
|
component from the \uicontrol Library to the pass component in
|
||||||
Navigator. The shader components are created at the same
|
\uicontrol Navigator. The shader components are created at the same
|
||||||
level as the pass component and automatically added to the
|
level as the pass component and automatically added to the
|
||||||
\uicontrol Shaders field.
|
\uicontrol Shaders field.
|
||||||
\li Select the shader components in \uicontrol Navigator to set the
|
\li Select the shader components in \uicontrol Navigator to set the
|
||||||
|
|||||||
@@ -38,8 +38,17 @@
|
|||||||
|
|
||||||
\image studio-qtquick-3d-shader-utilities.png
|
\image studio-qtquick-3d-shader-utilities.png
|
||||||
|
|
||||||
If the custom shader utilities are not displayed in \uicontrol Library, you
|
Additional 3D shader utilities include the \uicontrol Effect, which you can
|
||||||
should add the \uicontrol QtQuick3D module to your project, as described in
|
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}.
|
\l {Adding and Removing Modules}.
|
||||||
|
|
||||||
For more information on using the shaders, see
|
For more information on using the shaders, see
|
||||||
@@ -193,5 +202,4 @@
|
|||||||
uniform.
|
uniform.
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,18 +35,23 @@
|
|||||||
\QDS provides a set of 3D effects, which are visible in \l {Form Editor}.
|
\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
|
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}
|
> \uicontrol Components > \uicontrol QtQuick3D > \uicontrol {Qt Quick 3D Effects}
|
||||||
to a \uicontrol View3D component in \l Navigator. You can apply multiple
|
to a \uicontrol View3D component in \l Navigator.
|
||||||
effects to a scene. Select the \uicontrol {Scene Environment} component in
|
|
||||||
\uicontrol Navigator to view the applied effects in \l Properties >
|
You can use the \l Effect component available in \uicontrol
|
||||||
\uicontrol {Scene Environment} > \uicontrol Effect. If the effects are not
|
{Qt Quick 3D Effects} > \uicontrol {Custom Shader Utils} as the base
|
||||||
displayed in \l Library, you should add the \uicontrol QtQuick3D.Effects
|
component for creating custom post-processing effects. For more information,
|
||||||
module to your project, as described in \l {Adding and Removing Modules}.
|
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.
|
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
|
\section1 Available Effects
|
||||||
\table
|
\table
|
||||||
\header
|
\header
|
||||||
|
|||||||
@@ -35,23 +35,20 @@
|
|||||||
\QDS provides a set of pregenerated Qt Quick 3D materials that can be used
|
\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 create good-looking \l {Adding 3D Models}{models} quickly and easily.
|
||||||
|
|
||||||
To apply 3D materials to models, you should first delete the default material,
|
To apply a 3D material to a component, you should first delete the default
|
||||||
and then drag-and-drop a new material from \l Library to a model component
|
material and then drag-and-drop a new material from \l Library >
|
||||||
in \l Navigator.
|
\uicontrol Components > \uicontrol QtQuick3D >
|
||||||
|
|
||||||
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 >
|
|
||||||
\uicontrol {Qt Quick 3D Materials} to a model component in \l Navigator.
|
\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
|
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,
|
\l Properties view. You can apply the same material to another component as
|
||||||
you should add the \uicontrol QtQuick3D.Materials module to your project, as
|
well. Again, delete the default material first. You should then select the
|
||||||
described in \l {Adding and Removing Modules}.
|
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
|
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
|
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
|
determine whether or not shadow mapping is used for generating realistic
|
||||||
shadows. You can also select a \uicontrol Texture for shadow mapping.
|
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
|
\section1 Metal Materials
|
||||||
|
|
||||||
The following describes properties of the metal-based materials, which
|
The following describes properties of the metal-based materials, which
|
||||||
|
|||||||
@@ -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.
|
* 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)
|
if (!object)
|
||||||
object = createPrimitiveFromSource(polishTypeName, majorNumber, minorNumber, context);
|
object = createPrimitiveFromSource(polishTypeName, majorNumber, minorNumber, context);
|
||||||
|
|
||||||
|
|||||||
@@ -78,11 +78,14 @@ ScrollView {
|
|||||||
|
|
||||||
property string importToRemove: ""
|
property string importToRemove: ""
|
||||||
property string importToAdd: ""
|
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
|
// called from C++ to close context menu on focus out
|
||||||
function closeContextMenu()
|
function closeContextMenu()
|
||||||
{
|
{
|
||||||
importContextMenu.close()
|
moduleContextMenu.close()
|
||||||
itemContextMenu.close()
|
itemContextMenu.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,25 +110,73 @@ ScrollView {
|
|||||||
2 * cellVerticalMargin + cellVerticalSpacing
|
2 * cellVerticalMargin + cellVerticalSpacing
|
||||||
|
|
||||||
StudioControls.Menu {
|
StudioControls.Menu {
|
||||||
id: importContextMenu
|
id: moduleContextMenu
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
StudioControls.MenuItem {
|
||||||
text: qsTr("Remove Module")
|
text: qsTr("Remove Module")
|
||||||
|
visible: currentCategory === null
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
enabled: importToRemove !== ""
|
enabled: importToRemove !== ""
|
||||||
onTriggered: rootView.removeImport(importToRemove)
|
onTriggered: rootView.removeImport(importToRemove)
|
||||||
}
|
}
|
||||||
|
|
||||||
StudioControls.MenuSeparator {}
|
StudioControls.MenuSeparator {
|
||||||
|
visible: currentCategory === null
|
||||||
|
height: StudioTheme.Values.border
|
||||||
|
}
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
StudioControls.MenuItem {
|
||||||
text: qsTr("Expand All")
|
text: qsTr("Expand All")
|
||||||
|
visible: currentCategory === null
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
onTriggered: itemLibraryModel.expandAll()
|
onTriggered: itemLibraryModel.expandAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
StudioControls.MenuItem {
|
||||||
text: qsTr("Collapse All")
|
text: qsTr("Collapse All")
|
||||||
|
visible: currentCategory === null
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
onTriggered: itemLibraryModel.collapseAll()
|
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 {
|
StudioControls.Menu {
|
||||||
@@ -166,11 +217,14 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
onShowContextMenu: {
|
onShowContextMenu: {
|
||||||
importToRemove = importRemovable ? importUrl : ""
|
importToRemove = importRemovable ? importUrl : ""
|
||||||
importContextMenu.popup()
|
currentImport = model
|
||||||
|
currentCategory = null
|
||||||
|
moduleContextMenu.popup()
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
property var currentImportModel: model // allows accessing the import model from inside the category section
|
||||||
Repeater {
|
Repeater {
|
||||||
model: categoryModel
|
model: categoryModel
|
||||||
delegate: Section {
|
delegate: Section {
|
||||||
@@ -188,6 +242,11 @@ ScrollView {
|
|||||||
expanded: categoryExpanded
|
expanded: categoryExpanded
|
||||||
expandOnClick: false
|
expandOnClick: false
|
||||||
onToggleExpand: categoryExpanded = !categoryExpanded
|
onToggleExpand: categoryExpanded = !categoryExpanded
|
||||||
|
onShowContextMenu: {
|
||||||
|
currentCategory = model
|
||||||
|
currentImport = parent.currentImportModel
|
||||||
|
moduleContextMenu.popup()
|
||||||
|
}
|
||||||
|
|
||||||
Grid {
|
Grid {
|
||||||
id: itemGrid
|
id: itemGrid
|
||||||
|
|||||||
@@ -462,6 +462,7 @@ void TypePrettyPrinter::visit(Function *type)
|
|||||||
argumentText.showReturnTypes = true;
|
argumentText.showReturnTypes = true;
|
||||||
argumentText.showArgumentNames = false;
|
argumentText.showArgumentNames = false;
|
||||||
argumentText.showFunctionSignatures = true;
|
argumentText.showFunctionSignatures = true;
|
||||||
|
argumentText.showTemplateParameters = _overview->showTemplateParameters;
|
||||||
|
|
||||||
_text += QLatin1Char('(');
|
_text += QLatin1Char('(');
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ void AutoTestUnitTests::testCodeParserGTest()
|
|||||||
QVERIFY(parserSpy.wait(20000));
|
QVERIFY(parserSpy.wait(20000));
|
||||||
QVERIFY(modelUpdateSpy.wait());
|
QVERIFY(modelUpdateSpy.wait());
|
||||||
|
|
||||||
QCOMPARE(m_model->gtestNamesCount(), 7);
|
QCOMPARE(m_model->gtestNamesCount(), 8);
|
||||||
|
|
||||||
QMultiMap<QString, int> expectedNamesAndSets;
|
QMultiMap<QString, int> expectedNamesAndSets;
|
||||||
expectedNamesAndSets.insert(QStringLiteral("FactorialTest"), 3);
|
expectedNamesAndSets.insert(QStringLiteral("FactorialTest"), 3);
|
||||||
@@ -222,6 +222,7 @@ void AutoTestUnitTests::testCodeParserGTest()
|
|||||||
expectedNamesAndSets.insert(QStringLiteral("QueueTest"), 2);
|
expectedNamesAndSets.insert(QStringLiteral("QueueTest"), 2);
|
||||||
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as parameterized test
|
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as parameterized test
|
||||||
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as 'normal' test
|
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as 'normal' test
|
||||||
|
expectedNamesAndSets.insert(QStringLiteral("NumberAsNameStart"), 1);
|
||||||
expectedNamesAndSets.insert(QStringLiteral("NamespaceTest"), 1);
|
expectedNamesAndSets.insert(QStringLiteral("NamespaceTest"), 1);
|
||||||
|
|
||||||
QMultiMap<QString, int> foundNamesAndSets = m_model->gtestNamesAndSets();
|
QMultiMap<QString, int> foundNamesAndSets = m_model->gtestNamesAndSets();
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include <cplusplus/LookupContext.h>
|
#include <cplusplus/LookupContext.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -45,7 +47,7 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
CPlusPlus::DeclaratorIdAST *id = ast->declarator->core_declarator->asDeclaratorId();
|
CPlusPlus::DeclaratorIdAST *id = ast->declarator->core_declarator->asDeclaratorId();
|
||||||
if (!id || !ast->symbol || ast->symbol->argumentCount() != 2)
|
if (!id || !ast->symbol)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QString prettyName =
|
QString prettyName =
|
||||||
@@ -61,33 +63,68 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
|
|||||||
if (!GTestUtils::isGTestMacro(prettyName))
|
if (!GTestUtils::isGTestMacro(prettyName))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CPlusPlus::Argument *testCaseNameArg = ast->symbol->argumentAt(0)->asArgument();
|
QString testSuiteName;
|
||||||
CPlusPlus::Argument *testNameArg = ast->symbol->argumentAt(1)->asArgument();
|
QString testCaseName;
|
||||||
if (testCaseNameArg && testNameArg) {
|
if (ast->symbol->argumentCount() != 2 && ast->declarator->initializer) {
|
||||||
const QString &testCaseName = m_overview.prettyType(testCaseNameArg->type());
|
// we might have a special case when second parameter is a literal starting with a number
|
||||||
const QString &testName = m_overview.prettyType(testNameArg->type());
|
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 CPlusPlus::Token parameter1
|
||||||
const bool disabledCase = testCaseName.startsWith(disabledPrefix);
|
= translationUnit()->tokenAt(expressionListParenAST->lparen_token + 1);
|
||||||
int line = 0;
|
const CPlusPlus::Token parameter2
|
||||||
int column = 0;
|
= translationUnit()->tokenAt(expressionListParenAST->rparen_token - 1);
|
||||||
unsigned token = id->firstToken();
|
const CPlusPlus::Token comma
|
||||||
m_document->translationUnit()->getTokenStartPosition(token, &line, &column);
|
= translationUnit()->tokenAt(expressionListParenAST->lparen_token + 2);
|
||||||
|
if (!comma.is(CPlusPlus::T_COMMA))
|
||||||
|
return false;
|
||||||
|
|
||||||
GTestCodeLocationAndType locationAndType;
|
testSuiteName = QString::fromUtf8(parameter1.spell());
|
||||||
locationAndType.m_name = testName;
|
testCaseName = QString::fromUtf8(parameter2.spell());
|
||||||
locationAndType.m_line = line;
|
// test (suite) name needs to be a alpha numerical literal ( _ and $ allowed)
|
||||||
locationAndType.m_column = column - 1;
|
const QRegularExpression alnum("^[[:alnum:]_$]+$");
|
||||||
locationAndType.m_type = TestTreeItem::TestCase;
|
// test suite must not start with a number, test case may
|
||||||
locationAndType.m_state = disabled ? GTestTreeItem::Disabled
|
if (!alnum.match(testSuiteName).hasMatch()
|
||||||
: GTestTreeItem::Enabled;
|
|| (!testSuiteName.isEmpty() && testSuiteName.at(0).isNumber())) {
|
||||||
GTestCaseSpec spec;
|
testSuiteName.clear();
|
||||||
spec.testCaseName = testCaseName;
|
}
|
||||||
spec.parameterized = GTestUtils::isGTestParameterized(prettyName);
|
if (!alnum.match(testCaseName).hasMatch())
|
||||||
spec.typed = GTestUtils::isGTestTyped(prettyName);
|
testCaseName.clear();
|
||||||
spec.disabled = disabledCase;
|
}
|
||||||
m_gtestFunctions[spec].append(locationAndType);
|
} 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ TEST(FactorialTest_Iterative, DISABLED_HandlesPositiveInput)
|
|||||||
ASSERT_EQ(40320, factorial_it(8));
|
ASSERT_EQ(40320, factorial_it(8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(NumberAsNameStart, 1IsEnough)
|
||||||
|
{
|
||||||
|
EXPECT_FALSE(false);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
|||||||
@@ -534,6 +534,14 @@ void CMakeBuildStep::recreateBuildTargetsModel()
|
|||||||
|
|
||||||
addItem(QString(), true);
|
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))
|
for (const QString &buildTarget : qAsConst(targetList))
|
||||||
addItem(buildTarget, specialTargets(usesAllCapsTargets).contains(buildTarget));
|
addItem(buildTarget, specialTargets(usesAllCapsTargets).contains(buildTarget));
|
||||||
|
|
||||||
|
|||||||
@@ -932,10 +932,6 @@ void CMakeBuildSystem::becameDirty()
|
|||||||
if (isParsing())
|
if (isParsing())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CMakeTool *tool = m_parameters.cmakeTool();
|
|
||||||
if (!tool->isAutoRun())
|
|
||||||
return;
|
|
||||||
|
|
||||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()), REPARSE_SCAN);
|
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()), REPARSE_SCAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3839,7 +3839,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_headerSource_basic2()
|
|||||||
QByteArray expected;
|
QByteArray expected;
|
||||||
|
|
||||||
// Header File
|
// Header File
|
||||||
original = "void f()@;\n";
|
original = "void f(const std::vector<int> &v)@;\n";
|
||||||
expected = original;
|
expected = original;
|
||||||
testDocuments << QuickFixTestDocument::create("file.h", original, expected);
|
testDocuments << QuickFixTestDocument::create("file.h", original, expected);
|
||||||
|
|
||||||
@@ -3854,7 +3854,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_headerSource_basic2()
|
|||||||
"\n"
|
"\n"
|
||||||
"int x;\n"
|
"int x;\n"
|
||||||
"\n"
|
"\n"
|
||||||
"void f()\n"
|
"void f(const std::vector<int> &v)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"\n"
|
"\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|||||||
@@ -456,20 +456,21 @@ void Client::requestDocumentHighlights(TextEditor::TextEditorWidget *widget)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto runningRequest = m_highlightRequests.find(uri);
|
if (m_highlightRequests.contains(widget))
|
||||||
if (runningRequest != m_highlightRequests.end())
|
cancelRequest(m_highlightRequests.take(widget));
|
||||||
cancelRequest(runningRequest.value());
|
|
||||||
|
|
||||||
DocumentHighlightsRequest request(
|
DocumentHighlightsRequest request(
|
||||||
TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(widget->textCursor())));
|
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(
|
request.setResponseCallback(
|
||||||
[widget = QPointer<TextEditor::TextEditorWidget>(widget), this, uri]
|
[widget, this, uri, connection]
|
||||||
(const DocumentHighlightsRequest::Response &response)
|
(const DocumentHighlightsRequest::Response &response)
|
||||||
{
|
{
|
||||||
m_highlightRequests.remove(uri);
|
m_highlightRequests.remove(widget);
|
||||||
if (!widget)
|
disconnect(connection);
|
||||||
return;
|
|
||||||
|
|
||||||
const Id &id = TextEditor::TextEditorWidget::CodeSemanticsSelection;
|
const Id &id = TextEditor::TextEditorWidget::CodeSemanticsSelection;
|
||||||
QList<QTextEdit::ExtraSelection> selections;
|
QList<QTextEdit::ExtraSelection> selections;
|
||||||
const Utils::optional<DocumentHighlightsResult> &result = response.result();
|
const Utils::optional<DocumentHighlightsResult> &result = response.result();
|
||||||
@@ -493,7 +494,7 @@ void Client::requestDocumentHighlights(TextEditor::TextEditorWidget *widget)
|
|||||||
}
|
}
|
||||||
widget->setExtraSelections(id, selections);
|
widget->setExtraSelections(id, selections);
|
||||||
});
|
});
|
||||||
m_highlightRequests[uri] = request.id();
|
m_highlightRequests[widget] = request.id();
|
||||||
sendContent(request);
|
sendContent(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,19 +714,19 @@ void Client::cursorPositionChanged(TextEditor::TextEditorWidget *widget)
|
|||||||
QTimer *timer = m_documentHighlightsTimer[widget];
|
QTimer *timer = m_documentHighlightsTimer[widget];
|
||||||
if (!timer) {
|
if (!timer) {
|
||||||
const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath());
|
const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath());
|
||||||
auto runningRequest = m_highlightRequests.find(uri);
|
if (m_highlightRequests.contains(widget))
|
||||||
if (runningRequest != m_highlightRequests.end())
|
cancelRequest(m_highlightRequests.take(widget));
|
||||||
cancelRequest(runningRequest.value());
|
|
||||||
timer = new QTimer;
|
timer = new QTimer;
|
||||||
timer->setSingleShot(true);
|
timer->setSingleShot(true);
|
||||||
m_documentHighlightsTimer.insert(widget, timer);
|
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);
|
requestDocumentHighlights(widget);
|
||||||
m_documentHighlightsTimer.take(widget)->deleteLater();
|
m_documentHighlightsTimer.take(widget)->deleteLater();
|
||||||
});
|
});
|
||||||
connect(widget, &QWidget::destroyed, this, [widget, this]() {
|
|
||||||
delete m_documentHighlightsTimer.take(widget);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const Id selectionsId(TextEditor::TextEditorWidget::CodeSemanticsSelection);
|
const Id selectionsId(TextEditor::TextEditorWidget::CodeSemanticsSelection);
|
||||||
const QList semanticSelections = widget->extraSelections(selectionsId);
|
const QList semanticSelections = widget->extraSelections(selectionsId);
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ private:
|
|||||||
|
|
||||||
AssistProviders m_clientProviders;
|
AssistProviders m_clientProviders;
|
||||||
QMap<TextEditor::TextDocument *, AssistProviders> m_resetAssistProvider;
|
QMap<TextEditor::TextDocument *, AssistProviders> m_resetAssistProvider;
|
||||||
QHash<LanguageServerProtocol::DocumentUri, LanguageServerProtocol::MessageId> m_highlightRequests;
|
QHash<TextEditor::TextEditorWidget *, LanguageServerProtocol::MessageId> m_highlightRequests;
|
||||||
int m_restartsLeft = 5;
|
int m_restartsLeft = 5;
|
||||||
QScopedPointer<BaseClientInterface> m_clientInterface;
|
QScopedPointer<BaseClientInterface> m_clientInterface;
|
||||||
DiagnosticManager m_diagnosticManager;
|
DiagnosticManager m_diagnosticManager;
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ void HoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget,
|
|||||||
{
|
{
|
||||||
if (m_currentRequest.has_value())
|
if (m_currentRequest.has_value())
|
||||||
abort();
|
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);
|
report(Priority_None);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,12 +311,15 @@ void KitManagerConfigWidget::setIcon()
|
|||||||
for (const IDeviceFactory * const factory : qAsConst(allDeviceFactories)) {
|
for (const IDeviceFactory * const factory : qAsConst(allDeviceFactories)) {
|
||||||
if (factory->icon().isNull())
|
if (factory->icon().isNull())
|
||||||
continue;
|
continue;
|
||||||
iconMenu.addAction(factory->icon(), tr("Default for %1").arg(factory->displayName()),
|
QAction *action = iconMenu.addAction(factory->icon(),
|
||||||
[this, factory] {
|
tr("Default for %1").arg(factory->displayName()),
|
||||||
m_iconButton->setIcon(factory->icon());
|
[this, factory] {
|
||||||
m_modifiedKit->setDeviceTypeForIcon(factory->deviceType());
|
m_iconButton->setIcon(factory->icon());
|
||||||
emit dirty();
|
m_modifiedKit->setDeviceTypeForIcon(
|
||||||
});
|
factory->deviceType());
|
||||||
|
emit dirty();
|
||||||
|
});
|
||||||
|
action->setIconVisibleInMenu(true);
|
||||||
}
|
}
|
||||||
iconMenu.addSeparator();
|
iconMenu.addSeparator();
|
||||||
iconMenu.addAction(Utils::PathChooser::browseButtonLabel(), [this] {
|
iconMenu.addAction(Utils::PathChooser::browseButtonLabel(), [this] {
|
||||||
|
|||||||
@@ -344,6 +344,12 @@ static BuildConfiguration *activeBuildConfiguration()
|
|||||||
return target ? target->activeBuildConfiguration() : nullptr;
|
return target ? target->activeBuildConfiguration() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static RunConfiguration *activeRunConfiguration()
|
||||||
|
{
|
||||||
|
const Target * const target = activeTarget();
|
||||||
|
return target ? target->activeRunConfiguration() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
static bool isTextFile(const QString &fileName)
|
static bool isTextFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
return Utils::mimeTypeForFile(fileName).inherits(
|
return Utils::mimeTypeForFile(fileName).inherits(
|
||||||
@@ -1881,6 +1887,39 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
return QString();
|
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 = [] {
|
const auto fileHandler = [] {
|
||||||
return SessionManager::sessionNameToFileName(SessionManager::activeSession()).toString();
|
return SessionManager::sessionNameToFileName(SessionManager::activeSession()).toString();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -188,6 +188,24 @@ RunConfiguration::RunConfiguration(Target *target, Utils::Id id)
|
|||||||
BuildConfiguration *bc = target->activeBuildConfiguration();
|
BuildConfiguration *bc = target->activeBuildConfiguration();
|
||||||
return bc ? bc->macroExpander() : target->macroExpander();
|
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] {
|
m_commandLineGetter = [this] {
|
||||||
FilePath executable;
|
FilePath executable;
|
||||||
if (const auto executableAspect = aspect<ExecutableAspect>())
|
if (const auto executableAspect = aspect<ExecutableAspect>())
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ void RunControl::setRunConfiguration(RunConfiguration *runConfig)
|
|||||||
d->runConfiguration = runConfig;
|
d->runConfiguration = runConfig;
|
||||||
d->runConfigId = runConfig->id();
|
d->runConfigId = runConfig->id();
|
||||||
d->runnable = runConfig->runnable();
|
d->runnable = runConfig->runnable();
|
||||||
d->displayName = runConfig->displayName();
|
d->displayName = runConfig->expandedDisplayName();
|
||||||
d->macroExpander = runConfig->macroExpander();
|
d->macroExpander = runConfig->macroExpander();
|
||||||
d->buildKey = runConfig->buildKey();
|
d->buildKey = runConfig->buildKey();
|
||||||
d->settingsData = runConfig->aspectData();
|
d->settingsData = runConfig->aspectData();
|
||||||
|
|||||||
@@ -174,14 +174,14 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
|
|||||||
if (RunConfiguration * const rc = activeRunConfiguration())
|
if (RunConfiguration * const rc = activeRunConfiguration())
|
||||||
return rc->displayName();
|
return rc->displayName();
|
||||||
return QString();
|
return QString();
|
||||||
});
|
}, false);
|
||||||
d->m_macroExpander.registerFileVariables("CurrentRun:Executable",
|
d->m_macroExpander.registerFileVariables("CurrentRun:Executable",
|
||||||
tr("The currently active run configuration's executable (if applicable)."),
|
tr("The currently active run configuration's executable (if applicable)."),
|
||||||
[this]() -> QString {
|
[this]() -> QString {
|
||||||
if (RunConfiguration * const rc = activeRunConfiguration())
|
if (RunConfiguration * const rc = activeRunConfiguration())
|
||||||
return rc->commandLine().executable().toString();
|
return rc->commandLine().executable().toString();
|
||||||
return QString();
|
return QString();
|
||||||
});
|
}, false);
|
||||||
d->m_macroExpander.registerPrefix("CurrentRun:Env", tr("Variables in the current run environment."),
|
d->m_macroExpander.registerPrefix("CurrentRun:Env", tr("Variables in the current run environment."),
|
||||||
[this](const QString &var) {
|
[this](const QString &var) {
|
||||||
if (RunConfiguration * const rc = activeRunConfiguration()) {
|
if (RunConfiguration * const rc = activeRunConfiguration()) {
|
||||||
@@ -189,7 +189,7 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
|
|||||||
return envAspect->environment().expandedValueForKey(var);
|
return envAspect->environment().expandedValueForKey(var);
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
});
|
}, false);
|
||||||
d->m_macroExpander.registerVariable("CurrentRun:WorkingDir",
|
d->m_macroExpander.registerVariable("CurrentRun:WorkingDir",
|
||||||
tr("The currently active run configuration's working directory."),
|
tr("The currently active run configuration's working directory."),
|
||||||
[this] {
|
[this] {
|
||||||
@@ -198,7 +198,7 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
|
|||||||
return wdAspect->workingDirectory(&d->m_macroExpander).toString();
|
return wdAspect->workingDirectory(&d->m_macroExpander).toString();
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
});
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Target::~Target()
|
Target::~Target()
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ class TaskView : public Utils::ListView
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TaskView(QWidget *parent = nullptr);
|
TaskView(QWidget *parent = nullptr);
|
||||||
void setCurrentAndScrollTo(const QModelIndex &index);
|
|
||||||
~TaskView() override;
|
~TaskView() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -213,12 +212,6 @@ TaskView::TaskView(QWidget *parent)
|
|||||||
verticalScrollBar()->setSingleStep(vStepSize);
|
verticalScrollBar()->setSingleStep(vStepSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskView::setCurrentAndScrollTo(const QModelIndex &index)
|
|
||||||
{
|
|
||||||
scrollTo(index);
|
|
||||||
setCurrentIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
TaskView::~TaskView() = default;
|
TaskView::~TaskView() = default;
|
||||||
|
|
||||||
void TaskView::resizeEvent(QResizeEvent *e)
|
void TaskView::resizeEvent(QResizeEvent *e)
|
||||||
@@ -482,6 +475,7 @@ void TaskWindow::currentChanged(const QModelIndex &index)
|
|||||||
ITaskHandler *h = d->handler(action);
|
ITaskHandler *h = d->handler(action);
|
||||||
action->setEnabled((task.isNull() || !h) ? false : h->canHandle(task));
|
action->setEnabled((task.isNull() || !h) ? false : h->canHandle(task));
|
||||||
}
|
}
|
||||||
|
d->m_listview->scrollTo(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskWindow::saveSettings()
|
void TaskWindow::saveSettings()
|
||||||
@@ -563,7 +557,7 @@ void TaskWindow::showTask(unsigned int id)
|
|||||||
int sourceRow = d->m_model->rowForId(id);
|
int sourceRow = d->m_model->rowForId(id);
|
||||||
QModelIndex sourceIdx = d->m_model->index(sourceRow, 0);
|
QModelIndex sourceIdx = d->m_model->index(sourceRow, 0);
|
||||||
QModelIndex filterIdx = d->m_filter->mapFromSource(sourceIdx);
|
QModelIndex filterIdx = d->m_filter->mapFromSource(sourceIdx);
|
||||||
d->m_listview->setCurrentAndScrollTo(filterIdx);
|
d->m_listview->setCurrentIndex(filterIdx);
|
||||||
popup(Core::IOutputPane::ModeSwitch);
|
popup(Core::IOutputPane::ModeSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -692,7 +686,7 @@ void TaskWindow::setFocus()
|
|||||||
if (d->m_filter->rowCount()) {
|
if (d->m_filter->rowCount()) {
|
||||||
d->m_listview->setFocus();
|
d->m_listview->setFocus();
|
||||||
if (d->m_listview->currentIndex() == QModelIndex())
|
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 {
|
} else {
|
||||||
currentIndex = d->m_filter->index(0, 0);
|
currentIndex = d->m_filter->index(0, 0);
|
||||||
}
|
}
|
||||||
d->m_listview->setCurrentAndScrollTo(currentIndex);
|
d->m_listview->setCurrentIndex(currentIndex);
|
||||||
triggerDefaultHandler(currentIndex);
|
triggerDefaultHandler(currentIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -748,7 +742,7 @@ void TaskWindow::goToPrev()
|
|||||||
} else {
|
} else {
|
||||||
currentIndex = d->m_filter->index(0, 0);
|
currentIndex = d->m_filter->index(0, 0);
|
||||||
}
|
}
|
||||||
d->m_listview->setCurrentAndScrollTo(currentIndex);
|
d->m_listview->setCurrentIndex(currentIndex);
|
||||||
triggerDefaultHandler(currentIndex);
|
triggerDefaultHandler(currentIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ void CommentDelegate::updateEditorGeometry(QWidget *editor,
|
|||||||
const QStyleOptionViewItem &option,
|
const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(index)
|
||||||
editor->setGeometry(option.rect);
|
editor->setGeometry(option.rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +105,9 @@ QWidget *CommentTitleDelegate::createEditor(QWidget *parent,
|
|||||||
const QStyleOptionViewItem &option,
|
const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(option)
|
||||||
|
Q_UNUSED(index)
|
||||||
|
|
||||||
auto *editor = new QComboBox(parent);
|
auto *editor = new QComboBox(parent);
|
||||||
editor->setEditable(true);
|
editor->setEditable(true);
|
||||||
editor->setCompleter(completer());
|
editor->setCompleter(completer());
|
||||||
|
|||||||
@@ -139,9 +139,6 @@ QVariantMap DefaultAnnotationsModel::asVariantMapFromJson(const QJsonDocument &d
|
|||||||
case QJsonValue::Double:
|
case QJsonValue::Double:
|
||||||
map[key] = double{0.0};
|
map[key] = double{0.0};
|
||||||
break;
|
break;
|
||||||
case QJsonValue::String:
|
|
||||||
map[key] = QString{};
|
|
||||||
break;
|
|
||||||
case QJsonValue::Bool:
|
case QJsonValue::Bool:
|
||||||
map[key] = false;
|
map[key] = false;
|
||||||
break;
|
break;
|
||||||
@@ -160,7 +157,13 @@ QVariantMap DefaultAnnotationsModel::asVariantMapFromJson(const QJsonDocument &d
|
|||||||
map[key] = QVariant::fromValue(val.toDouble());
|
map[key] = QVariant::fromValue(val.toDouble());
|
||||||
else if (type == QStringLiteral("color"))
|
else if (type == QStringLiteral("color"))
|
||||||
map[key] = QVariant::fromValue(QColor(val.toString()));
|
map[key] = QVariant::fromValue(QColor(val.toString()));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case QJsonValue::String:
|
||||||
|
map[key] = QString{};
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
#include <qmldesignerconstants.h>
|
#include <qmldesignerconstants.h>
|
||||||
#include <qmldesignerplugin.h>
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
@@ -370,7 +372,10 @@ void ConnectionModel::abstractPropertyChanged(const AbstractProperty &abstractPr
|
|||||||
void ConnectionModel::deleteConnectionByRow(int currentRow)
|
void ConnectionModel::deleteConnectionByRow(int currentRow)
|
||||||
{
|
{
|
||||||
SignalHandlerProperty targetSignal = signalHandlerPropertyForRow(currentRow);
|
SignalHandlerProperty targetSignal = signalHandlerPropertyForRow(currentRow);
|
||||||
|
QTC_ASSERT(targetSignal.isValid(), return );
|
||||||
QmlDesigner::ModelNode node = targetSignal.parentModelNode();
|
QmlDesigner::ModelNode node = targetSignal.parentModelNode();
|
||||||
|
QTC_ASSERT(node.isValid(), return );
|
||||||
|
|
||||||
QList<SignalHandlerProperty> allSignals = node.signalProperties();
|
QList<SignalHandlerProperty> allSignals = node.signalProperties();
|
||||||
if (allSignals.size() > 1) {
|
if (allSignals.size() > 1) {
|
||||||
if (allSignals.contains(targetSignal))
|
if (allSignals.contains(targetSignal))
|
||||||
|
|||||||
@@ -102,7 +102,15 @@ void ConnectionView::nodeIdChanged(const ModelNode & /*node*/, const QString & /
|
|||||||
dynamicPropertiesModel()->resetModel();
|
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) {
|
foreach (const AbstractProperty &property, propertyList) {
|
||||||
if (property.isBindingProperty()) {
|
if (property.isBindingProperty()) {
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
void nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent,
|
void nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent,
|
||||||
const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange) override;
|
const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange) override;
|
||||||
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId) 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 propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList) override;
|
||||||
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange) override;
|
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange) override;
|
||||||
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange) override;
|
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange) override;
|
||||||
|
|||||||
@@ -2046,7 +2046,7 @@ void FormEditorFlowDecisionItem::updateGeometry()
|
|||||||
|
|
||||||
QRectF textRect(0, 0, 100, 20);
|
QRectF textRect(0, 0, 100, 20);
|
||||||
|
|
||||||
Qt::Corner corner = Qt::TopRightCorner;
|
Qt::Corner corner = Qt::TopLeftCorner;
|
||||||
if (qmlItemNode().modelNode().hasAuxiliaryData("dialogLabelPosition"))
|
if (qmlItemNode().modelNode().hasAuxiliaryData("dialogLabelPosition"))
|
||||||
corner = qmlItemNode().modelNode().auxiliaryData("dialogLabelPosition").value<Qt::Corner>();
|
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);
|
QRectF textRect(0, 0, 100, 20);
|
||||||
|
|
||||||
Qt::Corner corner = Qt::TopRightCorner;
|
Qt::Corner corner = Qt::TopLeftCorner;
|
||||||
if (qmlItemNode().modelNode().hasAuxiliaryData("dialogLabelPosition"))
|
if (qmlItemNode().modelNode().hasAuxiliaryData("dialogLabelPosition"))
|
||||||
corner = qmlItemNode().modelNode().auxiliaryData("dialogLabelPosition").value<Qt::Corner>();
|
corner = qmlItemNode().modelNode().auxiliaryData("dialogLabelPosition").value<Qt::Corner>();
|
||||||
|
|
||||||
|
|||||||
@@ -129,19 +129,24 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
|||||||
m_scene->synchronizeTransformation(rootItem);
|
m_scene->synchronizeTransformation(rootItem);
|
||||||
formEditorWidget()->setRootItemRect(qmlItemNode.instanceBoundingRect());
|
formEditorWidget()->setRootItemRect(qmlItemNode.instanceBoundingRect());
|
||||||
|
|
||||||
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
|
const QList<QmlObjectNode> allDirectSubNodes = qmlItemNode.allDirectSubNodes();
|
||||||
if (QmlItemNode::isValidQmlItemNode(nextNode) && nextNode.toQmlItemNode().isFlowItem()) {
|
for (const QmlObjectNode &childNode : allDirectSubNodes) {
|
||||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
if (QmlItemNode::isValidQmlItemNode(childNode)
|
||||||
|
&& childNode.toQmlItemNode().isFlowItem()) {
|
||||||
|
setupFormEditorItemTree(childNode.toQmlItemNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
|
for (const QmlObjectNode &childNode : allDirectSubNodes) {
|
||||||
if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowTransition()) {
|
if (QmlVisualNode::isValidQmlVisualNode(childNode)
|
||||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
&& childNode.toQmlVisualNode().isFlowTransition()) {
|
||||||
} else if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowDecision()) {
|
setupFormEditorItemTree(childNode.toQmlItemNode());
|
||||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
} else if (QmlVisualNode::isValidQmlVisualNode(childNode)
|
||||||
} else if (QmlVisualNode::isValidQmlVisualNode(nextNode) && nextNode.toQmlVisualNode().isFlowWildcard()) {
|
&& childNode.toQmlVisualNode().isFlowDecision()) {
|
||||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
setupFormEditorItemTree(childNode.toQmlItemNode());
|
||||||
|
} else if (QmlVisualNode::isValidQmlVisualNode(childNode)
|
||||||
|
&& childNode.toQmlVisualNode().isFlowWildcard()) {
|
||||||
|
setupFormEditorItemTree(childNode.toQmlItemNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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)
|
void FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeList)
|
||||||
{
|
{
|
||||||
|
const bool isFlow = rootModelNode().isValid() && QmlItemNode(rootModelNode()).isFlowView();
|
||||||
QList<FormEditorItem*> itemNodeList;
|
QList<FormEditorItem*> itemNodeList;
|
||||||
for (const ModelNode &node : completedNodeList) {
|
for (const ModelNode &node : completedNodeList) {
|
||||||
const QmlItemNode qmlItemNode(node);
|
const QmlItemNode qmlItemNode(node);
|
||||||
@@ -641,6 +659,8 @@ void FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeL
|
|||||||
if (FormEditorItem *item = scene()->itemForQmlItemNode(qmlItemNode)) {
|
if (FormEditorItem *item = scene()->itemForQmlItemNode(qmlItemNode)) {
|
||||||
scene()->synchronizeParent(qmlItemNode);
|
scene()->synchronizeParent(qmlItemNode);
|
||||||
itemNodeList.append(item);
|
itemNodeList.append(item);
|
||||||
|
if (isFlow && qmlItemNode.isFlowItem())
|
||||||
|
updateTransitions(scene(), qmlItemNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,14 +75,18 @@ QVariant ItemLibraryCategoriesModel::data(const QModelIndex &index, int role) co
|
|||||||
|
|
||||||
bool ItemLibraryCategoriesModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
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)) {
|
if (index.isValid() && m_roleNames.contains(role)) {
|
||||||
QVariant currValue = m_categoryList.at(index.row())->property(m_roleNames.value(role));
|
QVariant currValue = m_categoryList.at(index.row())->property(m_roleNames.value(role));
|
||||||
|
|
||||||
if (currValue != value) {
|
if (currValue != value) {
|
||||||
m_categoryList[index.row()]->setProperty(m_roleNames.value(role), value);
|
m_categoryList[index.row()]->setProperty(m_roleNames.value(role), value);
|
||||||
if (m_roleNames.value(role) == "categoryExpanded") {
|
if (m_roleNames.value(role) == "categoryExpanded") {
|
||||||
ItemLibraryModel::saveExpandedState(value.toBool(),
|
ItemLibraryModel::saveExpandedState(value.toBool(),
|
||||||
m_categoryList[index.row()]->categoryName());
|
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});
|
emit dataChanged(index, index, {role});
|
||||||
return true;
|
return true;
|
||||||
@@ -139,6 +143,17 @@ void ItemLibraryCategoriesModel::resetModel()
|
|||||||
endResetModel();
|
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()
|
void ItemLibraryCategoriesModel::addRoleNames()
|
||||||
{
|
{
|
||||||
int role = 0;
|
int role = 0;
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public:
|
|||||||
|
|
||||||
void sortCategorySections();
|
void sortCategorySections();
|
||||||
void resetModel();
|
void resetModel();
|
||||||
|
void showAllCategories(bool show = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addRoleNames();
|
void addRoleNames();
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ bool ItemLibraryCategory::updateItemVisibility(const QString &searchText, bool *
|
|||||||
return hasVisibleItems;
|
return hasVisibleItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ItemLibraryCategory::setCategoryVisible(bool isVisible)
|
||||||
|
{
|
||||||
|
if (isVisible != m_isVisible) {
|
||||||
|
m_isVisible = isVisible;
|
||||||
|
emit categoryVisibilityChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool ItemLibraryCategory::setVisible(bool isVisible)
|
bool ItemLibraryCategory::setVisible(bool isVisible)
|
||||||
{
|
{
|
||||||
if (isVisible != m_isVisible) {
|
if (isVisible != m_isVisible) {
|
||||||
@@ -97,7 +105,7 @@ bool ItemLibraryCategory::setVisible(bool isVisible)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ItemLibraryCategory::isVisible() const
|
bool ItemLibraryCategory::isCategoryVisible() const
|
||||||
{
|
{
|
||||||
return m_isVisible;
|
return m_isVisible;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ItemLibraryCategory : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY(QString categoryName READ categoryName FINAL)
|
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(bool categoryExpanded READ categoryExpanded WRITE setExpanded NOTIFY expandedChanged FINAL)
|
||||||
Q_PROPERTY(QObject *itemModel READ itemModel NOTIFY itemModelChanged FINAL)
|
Q_PROPERTY(QObject *itemModel READ itemModel NOTIFY itemModelChanged FINAL)
|
||||||
|
|
||||||
@@ -52,8 +52,9 @@ public:
|
|||||||
|
|
||||||
bool updateItemVisibility(const QString &searchText, bool *changed);
|
bool updateItemVisibility(const QString &searchText, bool *changed);
|
||||||
|
|
||||||
|
void setCategoryVisible(bool isVisible);
|
||||||
bool setVisible(bool isVisible);
|
bool setVisible(bool isVisible);
|
||||||
bool isVisible() const;
|
bool isCategoryVisible() const;
|
||||||
|
|
||||||
void sortItems();
|
void sortItems();
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ signals:
|
|||||||
void itemModelChanged();
|
void itemModelChanged();
|
||||||
void visibilityChanged();
|
void visibilityChanged();
|
||||||
void expandedChanged();
|
void expandedChanged();
|
||||||
|
void categoryVisibilityChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ItemLibraryItemsModel m_itemModel;
|
ItemLibraryItemsModel m_itemModel;
|
||||||
|
|||||||
@@ -116,19 +116,28 @@ bool ItemLibraryImport::updateCategoryVisibility(const QString &searchText, bool
|
|||||||
*changed = false;
|
*changed = false;
|
||||||
|
|
||||||
for (const auto &category : m_categoryModel.categorySections()) {
|
for (const auto &category : m_categoryModel.categorySections()) {
|
||||||
bool categoryChanged = false;
|
category->setCategoryVisible(ItemLibraryModel::loadCategoryVisibleState(category->categoryName()));
|
||||||
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
|
|
||||||
categoryChanged |= category->setVisible(hasVisibleItems);
|
|
||||||
|
|
||||||
*changed |= categoryChanged;
|
if (!searchText.isEmpty() || category->isCategoryVisible()) {
|
||||||
|
bool categoryChanged = false;
|
||||||
|
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
|
||||||
|
categoryChanged |= category->setVisible(hasVisibleItems);
|
||||||
|
|
||||||
if (hasVisibleItems)
|
*changed |= categoryChanged;
|
||||||
hasVisibleCategories = true;
|
|
||||||
|
if (hasVisibleItems)
|
||||||
|
hasVisibleCategories = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasVisibleCategories;
|
return hasVisibleCategories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ItemLibraryImport::showAllCategories(bool show)
|
||||||
|
{
|
||||||
|
m_categoryModel.showAllCategories(show);
|
||||||
|
}
|
||||||
|
|
||||||
Import ItemLibraryImport::importEntry() const
|
Import ItemLibraryImport::importEntry() const
|
||||||
{
|
{
|
||||||
return m_import;
|
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
|
} // namespace QmlDesigner
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class ItemLibraryImport : public QObject
|
|||||||
Q_PROPERTY(bool importExpanded READ importExpanded WRITE setImportExpanded NOTIFY importExpandChanged FINAL)
|
Q_PROPERTY(bool importExpanded READ importExpanded WRITE setImportExpanded NOTIFY importExpandChanged FINAL)
|
||||||
Q_PROPERTY(bool importRemovable READ importRemovable NOTIFY importRemovableChanged FINAL)
|
Q_PROPERTY(bool importRemovable READ importRemovable NOTIFY importRemovableChanged FINAL)
|
||||||
Q_PROPERTY(bool importUnimported READ importUnimported 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)
|
Q_PROPERTY(QObject *categoryModel READ categoryModel NOTIFY categoryModelChanged FINAL)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -64,6 +65,7 @@ public:
|
|||||||
bool importVisible() const;
|
bool importVisible() const;
|
||||||
bool importUsed() const;
|
bool importUsed() const;
|
||||||
bool importRemovable() const;
|
bool importRemovable() const;
|
||||||
|
bool importCatVisibleState() const;
|
||||||
bool hasCategories() const;
|
bool hasCategories() const;
|
||||||
bool hasSingleCategory() const;
|
bool hasSingleCategory() const;
|
||||||
ItemLibraryCategory *getCategorySection(const QString &categoryName) const;
|
ItemLibraryCategory *getCategorySection(const QString &categoryName) const;
|
||||||
@@ -75,7 +77,9 @@ public:
|
|||||||
void setImportUsed(bool importUsed);
|
void setImportUsed(bool importUsed);
|
||||||
void sortCategorySections();
|
void sortCategorySections();
|
||||||
void setImportExpanded(bool expanded = true);
|
void setImportExpanded(bool expanded = true);
|
||||||
|
void setImportCatVisibleState(bool show);
|
||||||
void expandCategories(bool expand = true);
|
void expandCategories(bool expand = true);
|
||||||
|
void showAllCategories(bool show = true);
|
||||||
|
|
||||||
static QString userComponentsTitle();
|
static QString userComponentsTitle();
|
||||||
static QString quick3DAssetsTitle();
|
static QString quick3DAssetsTitle();
|
||||||
@@ -89,6 +93,7 @@ signals:
|
|||||||
void importUsedChanged();
|
void importUsedChanged();
|
||||||
void importExpandChanged();
|
void importExpandChanged();
|
||||||
void importRemovableChanged();
|
void importRemovableChanged();
|
||||||
|
void importCatVisibleStateChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateRemovable();
|
void updateRemovable();
|
||||||
|
|||||||
@@ -59,6 +59,49 @@ bool ItemLibraryModel::loadExpandedState(const QString §ionName)
|
|||||||
return expandedStateHash.value(sectionName, true);
|
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()
|
void ItemLibraryModel::expandAll()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class ItemLibraryImport;
|
|||||||
class ItemLibraryModel : public QAbstractListModel
|
class ItemLibraryModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(bool isAnyCategoryHidden READ isAnyCategoryHidden WRITE setIsAnyCategoryHidden NOTIFY isAnyCategoryHiddenChanged FINAL)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ItemLibraryModel(QObject *parent = nullptr);
|
explicit ItemLibraryModel(QObject *parent = nullptr);
|
||||||
@@ -62,15 +63,25 @@ public:
|
|||||||
void setSearchText(const QString &searchText);
|
void setSearchText(const QString &searchText);
|
||||||
void setFlowMode(bool);
|
void setFlowMode(bool);
|
||||||
|
|
||||||
|
bool isAnyCategoryHidden() const;
|
||||||
|
void setIsAnyCategoryHidden(bool state);
|
||||||
|
|
||||||
static void registerQmlTypes();
|
static void registerQmlTypes();
|
||||||
static void saveExpandedState(bool expanded, const QString §ionName);
|
static void saveExpandedState(bool expanded, const QString §ionName);
|
||||||
static bool loadExpandedState(const QString §ionName);
|
static bool loadExpandedState(const QString §ionName);
|
||||||
|
static void saveCategoryVisibleState(bool isVisible, const QString &categoryName);
|
||||||
|
static bool loadCategoryVisibleState(const QString &categoryName);
|
||||||
|
|
||||||
Q_INVOKABLE void expandAll();
|
Q_INVOKABLE void expandAll();
|
||||||
Q_INVOKABLE void collapseAll();
|
Q_INVOKABLE void collapseAll();
|
||||||
|
Q_INVOKABLE void showHiddenCategories();
|
||||||
|
Q_INVOKABLE bool getIsAnyCategoryHidden() const;
|
||||||
|
|
||||||
Import entryToImport(const ItemLibraryEntry &entry);
|
Import entryToImport(const ItemLibraryEntry &entry);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void isAnyCategoryHiddenChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateVisibility(bool *changed);
|
void updateVisibility(bool *changed);
|
||||||
void addRoleNames();
|
void addRoleNames();
|
||||||
@@ -82,8 +93,10 @@ private:
|
|||||||
|
|
||||||
QString m_searchText;
|
QString m_searchText;
|
||||||
bool m_flowMode = false;
|
bool m_flowMode = false;
|
||||||
|
bool m_isAnyCategoryHidden = false;
|
||||||
|
|
||||||
inline static QHash<QString, bool> expandedStateHash;
|
inline static QHash<QString, bool> expandedStateHash;
|
||||||
|
inline static QHash<QString, bool> categoryVisibleStateHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
|||||||
@@ -126,8 +126,6 @@ QIcon paintPreview(const QColor& background)
|
|||||||
|
|
||||||
QIcon paintPreview(const EasingCurve &curve, const QColor& background, const QColor& curveColor)
|
QIcon paintPreview(const EasingCurve &curve, const QColor& background, const QColor& curveColor)
|
||||||
{
|
{
|
||||||
const QColor curveLine = Theme::getColor(Theme::DStextColor);
|
|
||||||
|
|
||||||
QPixmap pm(iconWidth, iconHeight);
|
QPixmap pm(iconWidth, iconHeight);
|
||||||
pm.fill(background);
|
pm.fill(background);
|
||||||
|
|
||||||
|
|||||||
@@ -328,8 +328,11 @@ void TransitionEditorWidget::init()
|
|||||||
|
|
||||||
if (root.isValid() && root.hasProperty("transitions")) {
|
if (root.isValid() && root.hasProperty("transitions")) {
|
||||||
NodeAbstractProperty transitions = root.nodeAbstractProperty("transitions");
|
NodeAbstractProperty transitions = root.nodeAbstractProperty("transitions");
|
||||||
if (transitions.isValid())
|
if (transitions.isValid()) {
|
||||||
transition = transitions.directSubNodes().constFirst();
|
const QList<ModelNode> directSubNodes = transitions.directSubNodes();
|
||||||
|
if (!directSubNodes.isEmpty())
|
||||||
|
transition = directSubNodes.constFirst();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_graphicsScene->setTransition(transition);
|
m_graphicsScene->setTransition(transition);
|
||||||
|
|||||||
@@ -104,16 +104,26 @@ QStringList globalQtEnums()
|
|||||||
|
|
||||||
QStringList knownEnumScopes()
|
QStringList knownEnumScopes()
|
||||||
{
|
{
|
||||||
static const QStringList list = {
|
static const QStringList list = {"TextInput",
|
||||||
"TextInput", "TextEdit", "Material", "Universal", "Font", "Shape", "ShapePath",
|
"TextEdit",
|
||||||
"AbstractButton", "Text", "ShaderEffectSource", "Grid"
|
"Material",
|
||||||
};
|
"Universal",
|
||||||
|
"Font",
|
||||||
|
"Shape",
|
||||||
|
"ShapePath",
|
||||||
|
"AbstractButton",
|
||||||
|
"Text",
|
||||||
|
"ShaderEffectSource",
|
||||||
|
"Grid",
|
||||||
|
"ItemLayer",
|
||||||
|
"ImageLayer",
|
||||||
|
"SpriteLayer"};
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool supportedQtQuickVersion(const QString &version)
|
bool supportedQtQuickVersion(const QString &version)
|
||||||
{
|
{
|
||||||
return supportedVersionsList().contains(version);
|
return version.isEmpty() || supportedVersionsList().contains(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString stripQuotes(const QString &str)
|
QString stripQuotes(const QString &str)
|
||||||
@@ -787,11 +797,8 @@ void TextToModelMerger::setupImports(const Document::Ptr &doc,
|
|||||||
differenceHandler.modelMissesImport(newImport);
|
differenceHandler.modelMissesImport(newImport);
|
||||||
} else {
|
} else {
|
||||||
QString importUri = toString(import->importUri);
|
QString importUri = toString(import->importUri);
|
||||||
if (importUri == QStringLiteral("Qt") && version == QStringLiteral("4.7")) {
|
if (version.isEmpty())
|
||||||
importUri = QStringLiteral("QtQuick");
|
version = "2.15";
|
||||||
version = QStringLiteral("1.0");
|
|
||||||
}
|
|
||||||
|
|
||||||
const Import newImport =
|
const Import newImport =
|
||||||
Import::createLibraryImport(importUri, version, as, m_rewriterView->importDirectories());
|
Import::createLibraryImport(importUri, version, as, m_rewriterView->importDirectories());
|
||||||
|
|
||||||
@@ -946,9 +953,13 @@ void TextToModelMerger::setupUsedImports()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const QmlJS::Import &import : allImports) {
|
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.name().isEmpty() && usedImportsSet.contains(import.info.name())) {
|
||||||
if (import.info.type() == ImportType::Library)
|
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)
|
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()));
|
usedImports.append(Import::createFileImport(import.info.name(), import.info.version().toString(), import.info.as()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1040,11 +1040,16 @@ QString BaseQtVersionPrivate::findHostBinary(HostBinaries binary) const
|
|||||||
switch (binary) {
|
switch (binary) {
|
||||||
case Designer:
|
case Designer:
|
||||||
case Linguist:
|
case Linguist:
|
||||||
case Rcc:
|
|
||||||
case Uic:
|
|
||||||
case QScxmlc:
|
case QScxmlc:
|
||||||
baseDir = q->hostBinPath().toString();
|
baseDir = q->hostBinPath().toString();
|
||||||
break;
|
break;
|
||||||
|
case Rcc:
|
||||||
|
case Uic:
|
||||||
|
if (q->qtVersion() >= QtVersionNumber(6, 1))
|
||||||
|
baseDir = q->hostLibexecPath().toString();
|
||||||
|
else
|
||||||
|
baseDir = q->hostBinPath().toString();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Can't happen
|
// Can't happen
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
|
|||||||
@@ -305,6 +305,6 @@ Image {
|
|||||||
scale: 0.5
|
scale: 0.5
|
||||||
checked: usageStatisticModel.usageStatisticEnabled
|
checked: usageStatisticModel.usageStatisticEnabled
|
||||||
|
|
||||||
onCheckedChanged: usageStatisticModel.setPluginEnabled(usageStatisticCheckBox.checked)
|
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,36 +49,55 @@
|
|||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFontDatabase>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QFontDatabase>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
#include <QQuickWidget>
|
#include <QQuickWidget>
|
||||||
|
#include <QSettings>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace StudioWelcome {
|
namespace StudioWelcome {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
const char DO_NOT_SHOW_SPLASHSCREEN_AGAIN_KEY[] = "StudioSplashScreen";
|
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;
|
QPointer<QQuickWidget> s_view = nullptr;
|
||||||
static StudioWelcomePlugin *s_pluginInstance = nullptr;
|
static StudioWelcomePlugin *s_pluginInstance = nullptr;
|
||||||
|
|
||||||
static bool isUsageStatistic(const ExtensionSystem::PluginSpec *spec)
|
std::unique_ptr<QSettings> makeUserFeedbackSettings()
|
||||||
{
|
{
|
||||||
if (!spec)
|
QStringList domain = QCoreApplication::organizationDomain().split(QLatin1Char('.'));
|
||||||
return false;
|
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()
|
std::unique_ptr<QSettings> settings(new QSettings(organization, "UserFeedback." + productId));
|
||||||
{
|
settings->beginGroup("UserFeedback");
|
||||||
const auto plugins = ExtensionSystem::PluginManager::plugins();
|
return settings;
|
||||||
return Utils::findOrDefault(plugins, &isUsageStatistic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class UsageStatisticPluginModel : public QObject
|
class UsageStatisticPluginModel : public QObject
|
||||||
@@ -95,27 +114,21 @@ public:
|
|||||||
|
|
||||||
void setupModel()
|
void setupModel()
|
||||||
{
|
{
|
||||||
auto plugin = getUsageStatisticPlugin();
|
auto settings = makeUserFeedbackSettings();
|
||||||
if (plugin)
|
QVariant value = settings->value(STATISTICS_COLLECTION_MODE);
|
||||||
m_usageStatisticEnabled = plugin->isEnabledBySettings();
|
m_usageStatisticEnabled = value.isValid() && value.toString() == DETAILED_USAGE_STATISTICS;
|
||||||
else
|
|
||||||
m_usageStatisticEnabled = false;
|
|
||||||
|
|
||||||
emit usageStatisticChanged();
|
emit usageStatisticChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE void setPluginEnabled(bool b)
|
Q_INVOKABLE void setTelemetryEnabled(bool b)
|
||||||
{
|
{
|
||||||
auto plugin = getUsageStatisticPlugin();
|
if (m_usageStatisticEnabled == b)
|
||||||
|
|
||||||
if (!plugin)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (plugin->isEnabledBySettings() == b)
|
auto settings = makeUserFeedbackSettings();
|
||||||
return;
|
|
||||||
|
|
||||||
plugin->setEnabledBySettings(b);
|
settings->setValue(STATISTICS_COLLECTION_MODE, b ? DETAILED_USAGE_STATISTICS : NO_TELEMETRY);
|
||||||
ExtensionSystem::PluginManager::writeSettings();
|
|
||||||
|
|
||||||
// pause remove splash timer while dialog is open otherwise splash crashes upon removal
|
// pause remove splash timer while dialog is open otherwise splash crashes upon removal
|
||||||
s_pluginInstance->pauseRemoveSplashTimer();
|
s_pluginInstance->pauseRemoveSplashTimer();
|
||||||
@@ -139,9 +152,9 @@ class ProjectModel : public QAbstractListModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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);
|
explicit ProjectModel(QObject *parent = nullptr);
|
||||||
|
|
||||||
@@ -161,16 +174,12 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE void openProjectAt(int row)
|
Q_INVOKABLE void openProjectAt(int row)
|
||||||
{
|
{
|
||||||
const QString projectFile = data(index(row, 0),
|
const QString projectFile = data(index(row, 0), ProjectModel::FilePathRole).toString();
|
||||||
ProjectModel::FilePathRole).toString();
|
|
||||||
if (QFileInfo::exists(projectFile))
|
if (QFileInfo::exists(projectFile))
|
||||||
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(projectFile);
|
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(projectFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE int get(int)
|
Q_INVOKABLE int get(int) { return -1; }
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_INVOKABLE void showHelp()
|
Q_INVOKABLE void showHelp()
|
||||||
{
|
{
|
||||||
@@ -200,8 +209,11 @@ public:
|
|||||||
|
|
||||||
const QString projectFile = Core::ICore::resourcePath() + "/examples/" + example + "/"
|
const QString projectFile = Core::ICore::resourcePath() + "/examples/" + example + "/"
|
||||||
+ example + ".qmlproject";
|
+ example + ".qmlproject";
|
||||||
|
|
||||||
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(projectFile);
|
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);
|
Core::EditorManager::openEditor(qmlFile);
|
||||||
}
|
}
|
||||||
public slots:
|
public slots:
|
||||||
@@ -222,9 +234,9 @@ ProjectModel::ProjectModel(QObject *parent)
|
|||||||
this,
|
this,
|
||||||
&ProjectModel::resetProjects);
|
&ProjectModel::resetProjects);
|
||||||
|
|
||||||
|
|
||||||
if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(),
|
if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(),
|
||||||
Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker"))))
|
Utils::equal(&ExtensionSystem::PluginSpec::name,
|
||||||
|
QString("LicenseChecker"))))
|
||||||
m_communityVersion = true;
|
m_communityVersion = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,8 +247,8 @@ int ProjectModel::rowCount(const QModelIndex &) const
|
|||||||
|
|
||||||
QVariant ProjectModel::data(const QModelIndex &index, int role) const
|
QVariant ProjectModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
QPair<QString,QString> data =
|
QPair<QString, QString> data = ProjectExplorer::ProjectExplorerPlugin::recentProjects().at(
|
||||||
ProjectExplorer::ProjectExplorerPlugin::recentProjects().at(index.row());
|
index.row());
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
return data.second;
|
return data.second;
|
||||||
@@ -275,7 +287,6 @@ public:
|
|||||||
~WelcomeMode() override;
|
~WelcomeMode() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QQuickWidget *m_modeWidget = nullptr;
|
QQuickWidget *m_modeWidget = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -344,22 +355,25 @@ void StudioWelcomePlugin::extensionsInitialized()
|
|||||||
s_view->setWindowFlag(Qt::SplashScreen, true);
|
s_view->setWindowFlag(Qt::SplashScreen, true);
|
||||||
s_view->setWindowModality(Qt::ApplicationModal);
|
s_view->setWindowModality(Qt::ApplicationModal);
|
||||||
s_view->engine()->addImportPath("qrc:/studiofonts");
|
s_view->engine()->addImportPath("qrc:/studiofonts");
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
s_view->engine()->addImportPath(QLatin1String(STUDIO_QML_PATH)
|
s_view->engine()->addImportPath(QLatin1String(STUDIO_QML_PATH) + "splashscreen/imports");
|
||||||
+ "splashscreen/imports");
|
s_view->setSource(
|
||||||
s_view->setSource(QUrl::fromLocalFile(QLatin1String(STUDIO_QML_PATH)
|
QUrl::fromLocalFile(QLatin1String(STUDIO_QML_PATH) + "splashscreen/main.qml"));
|
||||||
+ "splashscreen/main.qml"));
|
#else
|
||||||
#else
|
|
||||||
s_view->engine()->addImportPath("qrc:/qml/splashscreen/imports");
|
s_view->engine()->addImportPath("qrc:/qml/splashscreen/imports");
|
||||||
s_view->setSource(QUrl("qrc:/qml/splashscreen/main.qml"));
|
s_view->setSource(QUrl("qrc:/qml/splashscreen/main.qml"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QTC_ASSERT(s_view->rootObject(),
|
QTC_ASSERT(s_view->rootObject(),
|
||||||
qWarning() << "The StudioWelcomePlugin has a runtime depdendency on qt/qtquicktimeline.";
|
qWarning() << "The StudioWelcomePlugin has a runtime depdendency on "
|
||||||
return);
|
"qt/qtquicktimeline.";
|
||||||
|
return );
|
||||||
|
|
||||||
connect(s_view->rootObject(), SIGNAL(closeClicked()), this, SLOT(closeSplashScreen()));
|
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->show();
|
||||||
s_view->raise();
|
s_view->raise();
|
||||||
@@ -374,7 +388,7 @@ bool StudioWelcomePlugin::delayedInitialize()
|
|||||||
if (s_view.isNull())
|
if (s_view.isNull())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QTC_ASSERT(s_view->rootObject() , return true);
|
QTC_ASSERT(s_view->rootObject(), return true);
|
||||||
|
|
||||||
#ifdef ENABLE_CRASHPAD
|
#ifdef ENABLE_CRASHPAD
|
||||||
const bool crashReportingEnabled = true;
|
const bool crashReportingEnabled = true;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <texteditor/completionsettings.h>
|
#include <texteditor/completionsettings.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QtAlgorithms>
|
#include <QtAlgorithms>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
@@ -297,28 +298,46 @@ void GenericProposalModel::filter(const QString &prefix)
|
|||||||
convertCaseSensitivity(TextEditorSettings::completionSettings().m_caseSensitivity);
|
convertCaseSensitivity(TextEditorSettings::completionSettings().m_caseSensitivity);
|
||||||
const QRegularExpression regExp = FuzzyMatcher::createRegExp(prefix, caseSensitivity);
|
const QRegularExpression regExp = FuzzyMatcher::createRegExp(prefix, caseSensitivity);
|
||||||
|
|
||||||
|
QElapsedTimer timer;
|
||||||
|
timer.start();
|
||||||
|
|
||||||
m_currentItems.clear();
|
m_currentItems.clear();
|
||||||
const QString lowerPrefix = prefix.toLower();
|
const QString lowerPrefix = prefix.toLower();
|
||||||
|
const bool checkInfix = prefix.size() >= 3;
|
||||||
for (const auto &item : qAsConst(m_originalItems)) {
|
for (const auto &item : qAsConst(m_originalItems)) {
|
||||||
const QString &text = item->text();
|
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 QRegularExpressionMatch match = regExp.match(text);
|
||||||
const bool hasPrefixMatch = match.capturedStart() == 0;
|
const bool hasPrefixMatch = match.capturedStart() == 0;
|
||||||
const bool hasInfixMatch = prefix.size() >= 3 && match.hasMatch();
|
const bool hasInfixMatch = checkInfix && match.hasMatch();
|
||||||
if (hasPrefixMatch || hasInfixMatch) {
|
if (hasPrefixMatch || hasInfixMatch)
|
||||||
m_currentItems.append(item);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1999,7 +1999,7 @@ void TextEditorWidgetPrivate::moveLineUpDown(bool up)
|
|||||||
move.setPosition(cursor.selectionStart());
|
move.setPosition(cursor.selectionStart());
|
||||||
move.movePosition(QTextCursor::StartOfBlock);
|
move.movePosition(QTextCursor::StartOfBlock);
|
||||||
move.setPosition(cursor.selectionEnd(), QTextCursor::KeepAnchor);
|
move.setPosition(cursor.selectionEnd(), QTextCursor::KeepAnchor);
|
||||||
move.movePosition(move.atBlockStart() ? QTextCursor::Left: QTextCursor::EndOfBlock,
|
move.movePosition(move.atBlockStart() ? QTextCursor::PreviousCharacter: QTextCursor::EndOfBlock,
|
||||||
QTextCursor::KeepAnchor);
|
QTextCursor::KeepAnchor);
|
||||||
} else {
|
} else {
|
||||||
move.movePosition(QTextCursor::StartOfBlock);
|
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();
|
move.removeSelectedText();
|
||||||
|
|
||||||
if (up) {
|
if (up) {
|
||||||
move.movePosition(QTextCursor::PreviousBlock);
|
move.movePosition(QTextCursor::PreviousBlock);
|
||||||
move.insertBlock();
|
move.insertBlock();
|
||||||
move.movePosition(QTextCursor::Left);
|
move.movePosition(QTextCursor::PreviousCharacter);
|
||||||
} else {
|
} else {
|
||||||
move.movePosition(QTextCursor::EndOfBlock);
|
move.movePosition(QTextCursor::EndOfBlock);
|
||||||
if (move.atBlockStart()) { // empty block
|
if (move.atBlockStart()) { // empty block
|
||||||
move.movePosition(QTextCursor::NextBlock);
|
move.movePosition(QTextCursor::NextBlock);
|
||||||
move.insertBlock();
|
move.insertBlock();
|
||||||
move.movePosition(QTextCursor::Left);
|
move.movePosition(QTextCursor::PreviousCharacter);
|
||||||
} else {
|
} else {
|
||||||
move.insertBlock();
|
move.insertBlock();
|
||||||
}
|
}
|
||||||
|
|||||||