Merge remote-tracking branch 'origin/6.0'
Change-Id: I71b19dd8ecd96a7a2a58622f68283b8635264e48
97
.github/workflows/build_cmake.yml
vendored
@@ -1,6 +1,10 @@
|
||||
name: CMake Build Matrix
|
||||
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
- 'doc/**'
|
||||
|
||||
env:
|
||||
QT_VERSION: 6.2.1
|
||||
@@ -350,34 +354,58 @@ jobs:
|
||||
message("::set-output name=elfutils_dir::${elfutils_dir}")
|
||||
|
||||
- name: Download ccache
|
||||
id: ccache
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
|
||||
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
|
||||
|
||||
- name: Prepare ccache timestamp
|
||||
id: ccache_cache_timestamp
|
||||
- name: Prepare ccache archive name
|
||||
id: ccache
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||
message("::set-output name=timestamp::${current_date}")
|
||||
|
||||
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}" github_workspace)
|
||||
include(${github_workspace}/cmake/QtCreatorIDEBranding.cmake)
|
||||
string(REPLACE "." ";" IDE_VERSION_LIST ${IDE_VERSION_DISPLAY})
|
||||
list(GET IDE_VERSION_LIST 0 IDE_VERSION_MAJOR)
|
||||
message("::set-output name=ide_major_version::${IDE_VERSION_MAJOR}")
|
||||
message("::set-output name=archive_name::ccache-${{ matrix.config.os }}-${{ matrix.config.cc }}-qtc${IDE_VERSION_MAJOR}")
|
||||
|
||||
- name: Download ccache archive
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
file(WRITE $ENV{GITHUB_WORKSPACE}/netrc.txt
|
||||
"default login runneradmin password ${{ secrets.GITHUB_TOKEN }}")
|
||||
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.ide_major_version }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
restore-keys: |
|
||||
${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.ide_major_version }}
|
||||
foreach(page_id RANGE 1 10)
|
||||
file(
|
||||
DOWNLOAD "https://api.github.com/repos/${{ github.repository }}/actions/artifacts?per_page=100&page=${page_id}"
|
||||
HTTPHEADER "Accept: application/vnd.github.v3+json"
|
||||
NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
|
||||
NETRC REQUIRED
|
||||
SHOW_PROGRESS
|
||||
artifacts.json)
|
||||
file(READ artifacts.json artifacts_json)
|
||||
|
||||
string(JSON artifacts_length LENGTH "${artifacts_json}" "artifacts")
|
||||
math(EXPR artifacts_length "${artifacts_length} - 1")
|
||||
foreach(idx RANGE 0 ${artifacts_length})
|
||||
string(JSON artifact_js GET "${artifacts_json}" "artifacts" ${idx})
|
||||
string(JSON name GET "${artifact_js}" "name")
|
||||
if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}")
|
||||
string(JSON download_url GET "${artifact_js}" "archive_download_url")
|
||||
file(DOWNLOAD "${download_url}"
|
||||
"${{ steps.ccache.outputs.archive_name }}.zip"
|
||||
NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
|
||||
NETRC REQUIRED
|
||||
SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip")
|
||||
file(MAKE_DIRECTORY .ccache)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache)
|
||||
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
- name: Install system libs
|
||||
shell: cmake -P {0}
|
||||
@@ -455,8 +483,10 @@ jobs:
|
||||
string(REPLACE "x86" "x64" Python3_EXECUTABLE "${Python3_EXECUTABLE}")
|
||||
|
||||
set(WITH_TESTS "--with-tests")
|
||||
set(NO_DMG "--no-dmg")
|
||||
if (${{github.ref}} MATCHES "tags/v")
|
||||
unset(WITH_TESTS)
|
||||
unset(NO_DMG)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
@@ -472,6 +502,7 @@ jobs:
|
||||
${WITH_TESTS}
|
||||
${CDB_OPTION}
|
||||
${ELFUTILS_OPTION}
|
||||
${NO_DMG}
|
||||
--add-config=-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||
--add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
--add-config=-DIDE_REVISION_URL=https://github.com/$ENV{GITHUB_REPOSITORY}/commits/$ENV{GITHUB_SHA}
|
||||
@@ -534,38 +565,48 @@ jobs:
|
||||
endif()
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: build/qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
|
||||
- name: Upload Devel
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: build/qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}_dev.7z
|
||||
name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}_dev.7z
|
||||
|
||||
- name: Upload wininterrupt
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: build/wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
|
||||
- name: Upload qtcreatorcdbext
|
||||
if: runner.os == 'Windows' && matrix.config.is_msvc
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: build/qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
|
||||
- name: Upload disk image
|
||||
if: runner.os == 'macOS'
|
||||
uses: actions/upload-artifact@v1
|
||||
if: runner.os == 'macOS' && contains(github.ref, 'tags/v')
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: build/qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg
|
||||
name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg
|
||||
|
||||
- name: Create ccache archive
|
||||
working-directory: .ccache
|
||||
run: cmake -E tar cf ../${{ steps.ccache.outputs.archive_name }}.tar .
|
||||
|
||||
- name: Upload ccache archive
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ./${{ steps.ccache.outputs.archive_name }}.tar
|
||||
name: ${{ steps.ccache.outputs.archive_name }}
|
||||
|
||||
release:
|
||||
if: contains(github.ref, 'tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
@@ -587,7 +628,7 @@ jobs:
|
||||
run: |
|
||||
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ./upload_url
|
||||
name: upload_url
|
||||
@@ -620,40 +661,40 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v1
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
path: ./
|
||||
|
||||
- name: Download Devel artifact
|
||||
uses: actions/download-artifact@v1
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: qtcreator-${{ matrix.config.artifact }}-${{ github.run_id }}_dev.7z
|
||||
path: ./
|
||||
|
||||
- name: Download wininterrupt artifact
|
||||
if: contains(matrix.config.artifact, 'Windows')
|
||||
uses: actions/download-artifact@v1
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
path: ./
|
||||
|
||||
- name: Download qtcreatorcdbext artifact
|
||||
if: matrix.config.artifact == 'Windows-MSVC'
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||
path: ./
|
||||
|
||||
- name: Download disk image artifact
|
||||
if: matrix.config.artifact == 'macOS'
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg
|
||||
path: ./
|
||||
|
||||
- name: Download URL
|
||||
uses: actions/download-artifact@v1
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: upload_url
|
||||
path: ./
|
||||
|
19
dist/changes-6.0.0.md
vendored
@@ -47,6 +47,16 @@ Editing
|
||||
* Added option for `Insert header files on completion`
|
||||
* Improved location of generated `compile_commands.json` (QTCREATORBUG-26431)
|
||||
* Fixed missing reparsing after refactorings (QTCREATORBUG-26523)
|
||||
* Fixed that parameters were incorrectly highlighted as output parameters
|
||||
* Fixed highlighting of string literals in macros (QTCREATORBUG-26553)
|
||||
* Fixed icon of signals and slots in completion list (QTCREATORBUG-26555)
|
||||
* Fixed header completion for Qt headers (QTCREATORBUG-26482)
|
||||
* Fixed code model update after UI header change
|
||||
* Fixed that `Find References` could show results for deleted files
|
||||
(QTCREATORBUG-26574)
|
||||
* Fixed that highlighting of current symbol could vanish (QTCREATORBUG-26339)
|
||||
* Fixed that nested items were not synchronized with cursor position in
|
||||
outline (QTCREATORBUG-26509)
|
||||
|
||||
### QML
|
||||
|
||||
@@ -75,6 +85,7 @@ Projects
|
||||
* Fixed that re-detecting compilers removed compilers from kits
|
||||
(QTCREATORBUG-25697)
|
||||
* Fixed GitHub action created by Qt Creator plugin wizard for Qt 6
|
||||
* Fixed crash when canceling device test dialog (QTCREATORBUG-26285)
|
||||
|
||||
### CMake
|
||||
|
||||
@@ -155,10 +166,16 @@ Platforms
|
||||
* Added details to device settings (QTCREATORBUG-23991)
|
||||
* Added filter field for Android SDK manager
|
||||
* Fixed that NDK 22 and later could not be added
|
||||
* Fixed creation of Android template files (QTCREATORBUG-26580)
|
||||
|
||||
### iOS
|
||||
|
||||
* Fixed that no tasks were created for build issues (QTCREATORBUG-26541)
|
||||
|
||||
### WebAssembly
|
||||
|
||||
* Fixed running applications (QTCREATORBUG-25905, QTCREATORBUG-26189)
|
||||
* Fixed running applications (QTCREATORBUG-25905, QTCREATORBUG-26189,
|
||||
QTCREATORBUG-26562)
|
||||
|
||||
### MCU
|
||||
|
||||
|
BIN
doc/qtcreator/images/icons/create-tracepoint.png
Normal file
After Width: | Height: | Size: 183 B |
BIN
doc/qtcreator/images/icons/output-pane-menu.png
Normal file
After Width: | Height: | Size: 110 B |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
doc/qtcreator/images/qml-profiler-start-dialog.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 13 KiB |
BIN
doc/qtcreator/images/qtcreator-kit-selector-run-targets.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 15 KiB |
BIN
doc/qtcreator/images/qtcreator-output-panes-taskbar.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 19 KiB |
BIN
doc/qtcreator/images/qtcreator-performance-analyzer-toolbar.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -72,7 +72,9 @@
|
||||
\li Select the
|
||||
\inlineimage qtcreator-analyze-start-button.png
|
||||
(\uicontrol Start) button to start the application from the
|
||||
Performance Analyzer.
|
||||
\uicontrol {Performance Analyzer}.
|
||||
|
||||
\inlineimage qtcreator-performance-analyzer-toolbar.png "Performance Analyzer toolbar"
|
||||
|
||||
\endlist
|
||||
|
||||
@@ -101,9 +103,21 @@
|
||||
|
||||
To create trace points for profiling memory usage on a target device, select
|
||||
\uicontrol Analyze > \uicontrol {Performance Analyzer Options} >
|
||||
\uicontrol {Create Memory Trace Points}.
|
||||
\uicontrol {Create Memory Trace Points} or select
|
||||
\inlineimage icons/create-tracepoint.png
|
||||
on the \uicontrol {Performance Analyzer} toolbar.
|
||||
|
||||
To add events for the trace points, see \l{Choosing Event Types}
|
||||
In the \uicontrol {Create Memory Trace Points} dialog, you can modify the
|
||||
script to run.
|
||||
|
||||
\image qtcreator-performance-analyzer-create-memory-trace-points.png "Create Memory Trace Points dialog"
|
||||
|
||||
If you need root privileges to run scripts as root, select the privileges to
|
||||
use in the \uicontrol {Elevate privileges using} field.
|
||||
|
||||
Select \uicontrol OK to run the script.
|
||||
|
||||
To add events for the trace points, see \l{Choosing Event Types}.
|
||||
|
||||
You can record a memory trace to view usage graphs in the samples rows of
|
||||
the timeline and to view memory allocations, peaks, and releases in the
|
||||
@@ -418,8 +432,8 @@
|
||||
|
||||
You can load any \c perf.data files generated by recent versions of the
|
||||
Linux Perf tool and view them in \QC. Select \uicontrol Analyze >
|
||||
\uicontrol {Performance Analyzer Options} > \uicontrol {Load perf.data} to
|
||||
load a file.
|
||||
\uicontrol {Performance Analyzer Options} > \uicontrol {Load perf.data File}
|
||||
to load a file.
|
||||
|
||||
\image qtcreator-cpu-usage-analyzer-load-perf-trace.png
|
||||
|
||||
|
@@ -433,7 +433,8 @@
|
||||
|
||||
By default, the splash screen is hidden automatically
|
||||
when an activity is drawn. To keep it visible until
|
||||
\l{QNativeInterface::QAndroidApplication::hideSplashScreen()} is
|
||||
\l{https://doc.qt.io/qt-6/qnativeinterface-qandroidapplication.html#hideSplashScreen}
|
||||
{QNativeInterface::QAndroidApplication::hideSplashScreen()} is
|
||||
called, select the \uicontrol {Sticky splash screen} check box.
|
||||
|
||||
In \uicontrol {Image show mode}, select whether to center the splash screen
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -118,6 +118,8 @@
|
||||
for particular plugins, select \uicontrol Tools > \uicontrol Options >
|
||||
\uicontrol FakeVim > \uicontrol General > \uicontrol {Plugin Emulation}.
|
||||
|
||||
\image qtcreator-fakevim-options-general-plugin-emulation.png "FakeVim Plugin Emulation options"
|
||||
|
||||
Currently emulated plugins:
|
||||
\list
|
||||
\li \l{https://github.com/tpope/vim-commentary}{vim-commentary}: \c gc
|
||||
@@ -129,9 +131,10 @@
|
||||
register \c x.
|
||||
\li ["x]grr to replace the current line.
|
||||
\endlist
|
||||
\li \l{https://github.com/tommcdo/vim-exchange}{vim-exchange}
|
||||
\li \l{https://github.com/vim-scripts/argtextobj.vim}{argtextobj.vim}:
|
||||
Defines the \c ia and \c aa text objects for function parameters.
|
||||
\li \l{https://github.com/tommcdo/vim-exchange}{vim-exchange}:
|
||||
A text exchange operator for vim.
|
||||
\li \l{https://github.com/tpope/vim-surround}{vim-surround}:
|
||||
Adds mappings for deleting, adding and changing surroundings.
|
||||
\endlist
|
||||
@@ -287,15 +290,29 @@
|
||||
|
||||
\section1 Mapping FakeVim Commands
|
||||
|
||||
To map commands entered on the \uicontrol FakeVim command line to actions
|
||||
of the \QC core, select \uicontrol Tools > \uicontrol Options >
|
||||
To map commands entered on the \uicontrol FakeVim command line to
|
||||
\QC functions, select \uicontrol Tools > \uicontrol Options >
|
||||
\uicontrol FakeVim > \uicontrol {Ex Command Mapping}.
|
||||
Enter a string in the \uicontrol Filter field to search for a specific
|
||||
\QC function.
|
||||
|
||||
\image qtcreator-fakevim-options-ex-command-mapping.png "FakeVim Ex Command Mapping options"
|
||||
|
||||
Select a function in the list, and enter a string that will trigger the
|
||||
function in the \uicontrol {Regular expression} field. You can view the
|
||||
trigger expression in the \uicontrol {Ex Trigger Expression} field. To
|
||||
remove the trigger expression, select \uicontrol Reset.
|
||||
|
||||
To reset the trigger expressions for all functions, select
|
||||
\uicontrol {Reset All}.
|
||||
|
||||
To map \e {user commands} to keyboard shortcuts, select \uicontrol Tools >
|
||||
\uicontrol Options > \uicontrol FakeVim >
|
||||
\uicontrol {User Command Mapping}. The user command mapped to the shortcut
|
||||
is executed by FakeVim as if you were typing it (as when replaying a macro).
|
||||
|
||||
\image qtcreator-fakevim-options-user-command-mapping.png "FakeVim User Command Mapping options"
|
||||
|
||||
\section1 Specifying FakeVim Options
|
||||
|
||||
To make changes to the Vim-style settings, select \uicontrol Tools >
|
||||
@@ -319,5 +336,6 @@
|
||||
\uicontrol FakeVim > \uicontrol {Use FakeVim} or press \key {Alt+V,Alt+V}.
|
||||
|
||||
You can temporarily escape FakeVim mode to access the normal \QC keyboard
|
||||
shortcuts like \key {Ctrl-R} for \uicontrol Run by pressing \key {,} first.
|
||||
shortcuts like \key {Ctrl-R} for \uicontrol Run by first pressing the comma
|
||||
key (\key {,}).
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -75,6 +75,11 @@
|
||||
|
||||
\li In \uicontrol {MIME Type}, select a MIME type.
|
||||
|
||||
\li In \uicontrol Handler, double-click the editor name to display a
|
||||
context-menu where you can select another editor to open the file
|
||||
in by default. The menu is available only if alternative suitable
|
||||
editors are available.
|
||||
|
||||
\li In \uicontrol Patterns, add the filename extension for the type of files
|
||||
that you want to identify as having this MIME type.
|
||||
|
||||
@@ -96,12 +101,7 @@
|
||||
\note You are recommended not to change the range and priority,
|
||||
because it might cause problems when opening files in \QC.
|
||||
|
||||
\li In \uicontrol Handler, double-click the editor name to display a
|
||||
context-menu where you can select another editor to open the file
|
||||
in by default. The menu is available only if alternative suitable
|
||||
editors are available.
|
||||
|
||||
\li Click \uicontrol OK.
|
||||
\li Click \uicontrol OK to return to the \uicontrol {MIME Types} tab.
|
||||
|
||||
\endlist
|
||||
|
||||
@@ -119,8 +119,8 @@
|
||||
select \uicontrol {Reset MIME Types}. To revert the changes you have
|
||||
made to the default editors, select \uicontrol {Reset Handlers}.
|
||||
|
||||
\note If you now select \uicontrol OK or \uicontrol Apply, you permanently lose all
|
||||
your own patterns and magic headers. The changes are reverted the next
|
||||
time you start \QC.
|
||||
\note If you select \uicontrol OK or \uicontrol Apply after reverting
|
||||
changes, you permanently lose all your own patterns and magic headers.
|
||||
They are removed the next time you start \QC.
|
||||
|
||||
*/
|
||||
|
@@ -109,3 +109,7 @@
|
||||
\externalpage https://doc.qt.io/qt/qtqml-syntax-imports.html#qml-import-path
|
||||
\title QML Import Path
|
||||
*/
|
||||
/*!
|
||||
\externalpage https://doc.qt.io/QtApplicationManager/
|
||||
\title Qt Application Manager
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -111,35 +111,30 @@
|
||||
|
||||
\section1 Find a specific setting
|
||||
|
||||
To find specific settings you require in \uicontrol{Tools} > \uicontrol{Options}
|
||||
To find specific settings in \uicontrol Tools > \uicontrol Options,
|
||||
use the filter located at the top left of the \uicontrol Options dialog box.
|
||||
|
||||
\section1 Open output panes
|
||||
|
||||
The output panes provide a list of errors and warnings encountered during
|
||||
a build, detailed output from the compiler, status of a program when it is
|
||||
executed and debug output, as well as search results.
|
||||
The \l{Viewing Output}{output panes} provide a list of errors and warnings
|
||||
encountered during a build, detailed output from the compiler, status of a
|
||||
program when it is executed, debug output, and search results.
|
||||
|
||||
To open output panes, use the following shortcuts:
|
||||
|
||||
\list
|
||||
|
||||
\li \uicontrol{Issues} pane Alt+1 (Cmd+1 on \macos)
|
||||
\li \uicontrol{Issues} - \key Alt+1 (\key Cmd+1 on \macos)
|
||||
|
||||
\li \uicontrol{Search Results} pane Alt+2 (Cmd+2 on \macos)
|
||||
\li \uicontrol{Search Results} - \key Alt+2 (\key Cmd+2 on \macos)
|
||||
|
||||
\li \uicontrol{Application Output} pane Alt+3 (Cmd+3 on \macos)
|
||||
\li \uicontrol{Application Output} - \key Alt+3 (\key Cmd+3 on \macos)
|
||||
|
||||
\li \uicontrol{Compile Output} pane Alt+4 (Cmd+4 on \macos)
|
||||
\li \uicontrol{Compile Output} - \key Alt+4 (\key Cmd+4 on \macos)
|
||||
|
||||
\endlist
|
||||
|
||||
To open the other output panes, such as \uicontrol{General Messages} and
|
||||
\uicontrol{Version Control}, select \uicontrol View >
|
||||
\uicontrol {Output Panes}. The menu items also display
|
||||
the keyboard shortcuts that you can use.
|
||||
|
||||
For more information about output panes, see \l{Viewing Output}.
|
||||
For additional ways to open all output panes, see \l{Viewing Output}.
|
||||
|
||||
\section1 Find keyboard shortcuts
|
||||
|
||||
@@ -147,17 +142,17 @@
|
||||
You can see the keyboard shortcut for a menu command in the menu
|
||||
or the tooltip for a button.
|
||||
|
||||
To customize, import or export keyboard shortcuts, select \uicontrol Tools >
|
||||
To customize, import, or export keyboard shortcuts, select \uicontrol Tools >
|
||||
\uicontrol Options > \uicontrol Environment > \uicontrol Keyboard.
|
||||
|
||||
\section1 Run \QC from the command line
|
||||
|
||||
You can launch \QC from command line using the name of an
|
||||
existing session or \c .pro file by giving the name as the command
|
||||
argument.
|
||||
You can launch \QC from the command line using the name of an
|
||||
existing \l{Managing Sessions}{session} or project file by entering
|
||||
the name as the command argument.
|
||||
|
||||
For example, running \tt{qtcreator somesession}, launches \QC and
|
||||
loads session somesession.
|
||||
For example, running \c {qtcreator somesession}, launches \QC and
|
||||
loads the session called \e somesession.
|
||||
|
||||
For more information, see \l{Using Command Line Options}.
|
||||
|
||||
@@ -210,7 +205,7 @@
|
||||
|
||||
If special debugging of Qt objects fails due to data corruption within the
|
||||
debugged objects, you can switch off the debugging helpers. When debugging
|
||||
helpers are switched off low-level structures become visible.
|
||||
helpers are switched off, low-level structures become visible.
|
||||
|
||||
To switch off the debugging helpers:
|
||||
\list 1
|
||||
@@ -250,7 +245,7 @@
|
||||
\section1 Quickly locate files using the keyboard
|
||||
|
||||
The \uicontrol Locator provides one of the easiest ways in \QC to browse
|
||||
through projects, files, classes, functions, documentation and file systems.
|
||||
through projects, files, classes, functions, documentation, and file systems.
|
||||
To quickly access files not directly mentioned in your project, you can
|
||||
create your own locator filters. That way you can locate files in a
|
||||
directory structure you have defined.
|
||||
@@ -307,12 +302,14 @@
|
||||
|
||||
\section1 Enclose selected code in curly braces, parentheses, or double quotes
|
||||
|
||||
Press \key {Shift} and then the opening character.
|
||||
When you have selected code and enter one of the following opening
|
||||
characters, the appropriate closing character is added automatically
|
||||
at the end of the selection:
|
||||
|
||||
\list
|
||||
\li Curly braces: \key {Shift+\{}
|
||||
\li Parentheses: \key {Shift+(}
|
||||
\li Double quotes: \key {Shift+"}
|
||||
\li {
|
||||
\li (
|
||||
\li "
|
||||
\endlist
|
||||
|
||||
\section1 Select the enclosing block in C++
|
||||
|
@@ -123,6 +123,10 @@
|
||||
The QNX Neutrino RTOS should provide a few additional command line tools
|
||||
and services, as described in \l {Qt Creator Target Requirements}.
|
||||
|
||||
\note In Qt 6, Qt for QNX is a part of
|
||||
\l{https://doc.qt.io/QtForDeviceCreation/index.html}{Qt for Device Creation},
|
||||
and the \QC support is considered experimental.
|
||||
|
||||
The following topics contain more information about developing applications
|
||||
for QNX devices:
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -87,7 +87,7 @@
|
||||
\li To deploy applications and run them remotely on devices, specify
|
||||
parameters for accessing the devices:
|
||||
|
||||
\list 1
|
||||
\list a
|
||||
|
||||
\li Select \uicontrol Tools > \uicontrol Options >
|
||||
\uicontrol Devices > \uicontrol Devices > \uicontrol Add >
|
||||
@@ -108,14 +108,23 @@
|
||||
application as.
|
||||
This value will be available in the variable \c %{Device:UserName}.
|
||||
|
||||
\li In the \uicontrol {The authentication type} field, select
|
||||
\uicontrol Default to use the currently displayed private
|
||||
key file for authentication. Select \uicontrol {Specific Key}
|
||||
to use some other key, and enter the path to the file that
|
||||
contains the private key in the field below. This value will
|
||||
be available in the variable \c %{Device:PrivateKeyFile}.
|
||||
\li Select \uicontrol {Next} to open the
|
||||
\uicontrol {Key Deployment} dialog.
|
||||
|
||||
\li Click \uicontrol {Next} to create the connection.
|
||||
\image qtcreator-generic-linux-device-key-deployment.png "Key Deployment dialog"
|
||||
|
||||
\li In \uicontrol {Private key file}, select a private key file
|
||||
to use for authentication. This value will be available in
|
||||
the variable \c %{Device:PrivateKeyFile}.
|
||||
|
||||
\li If you do not have a public-private key pair, select
|
||||
\uicontrol {Create New Key Pair}. For more information,
|
||||
see \l{Generating SSH Keys}.
|
||||
|
||||
\li Select \uicontrol {Deploy Public Key} to copy the public
|
||||
key to the device.
|
||||
|
||||
\li Select \uicontrol {Next} to create the connection.
|
||||
|
||||
\endlist
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
The AutotoolsProjectManager is a plugin for autotools support. It is
|
||||
disabled by default. To enable the plugin, select \uicontrol Help >
|
||||
\uicontrol {About Plugins} > \uicontrol {Build Systems} >
|
||||
\uicontrol AutotoolsProjectManager.Then select \uicontrol {Restart Now}
|
||||
\uicontrol AutotoolsProjectManager. Then select \uicontrol {Restart Now}
|
||||
to restart \QC and load the plugin.
|
||||
|
||||
To work with your Autotools project in \QC:
|
||||
|
@@ -55,10 +55,12 @@
|
||||
|
||||
\image qtcreator-build-environment.png "Build Environment"
|
||||
|
||||
\note The changes are stored in the local project specific \c{.pro.user}
|
||||
file. Therefore, they are not suitable for sharing between developers or
|
||||
development PCs. To share settings, incorporate them into the build system.
|
||||
For example, if you use qmake, make the changes in the \c{.pro} file.
|
||||
The changes are stored in the local project specific \c{CMakeLists.txt.user}
|
||||
or \c{.pro.user} file, depending on the build system you use. Therefore,
|
||||
they are not suitable for sharing between developers or development PCs. To
|
||||
share settings, incorporate them into the build system. For example, if you
|
||||
use CMake, make the changes in the \c {CMakeLists.txt} file, and if you use
|
||||
qmake, make the changes in the \c{.pro} file.
|
||||
|
||||
\section1 Batch Editing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -65,6 +65,18 @@
|
||||
|
||||
\endlist
|
||||
|
||||
If your project has several run targets defined, such as
|
||||
\l{Running Autotests}{tests}, you can select them in the kit selector.
|
||||
|
||||
\image qtcreator-kit-selector-run-targets.png "Run targets in the kit selector"
|
||||
|
||||
If you have connected \l{Mobile Platforms}{mobile devices} or
|
||||
\l{Embedded Platforms}{embedded devices} to the development PC
|
||||
or added virtual devices, such as \l{Managing Android Virtual Devices (AVD)}
|
||||
{Android Virtual Devices (AVD)}, you can select them in the kit selector.
|
||||
Select \uicontrol Manage to manage device settings. For example, you can add
|
||||
AVDs or manually start disconnected AVDs.
|
||||
|
||||
The \uicontrol {Application Output} pane displays the status of the
|
||||
application while it is running. You can select the \uicontrol Run button
|
||||
in the pane to re-run applications without building them first. This is
|
||||
|
@@ -1,13 +1,13 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (C) 2018 Blackberry
|
||||
**
|
||||
** Contact: Blackberry (qt@blackberry.com)
|
||||
** Contact: KDAB (info@kdab.com)
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
@@ -40,6 +40,10 @@
|
||||
a few additional command line tools and services, as described in
|
||||
\l {Qt Creator Target Requirements}.
|
||||
|
||||
\note In Qt 6, Qt for QNX is a part of
|
||||
\l{https://doc.qt.io/QtForDeviceCreation/index.html}{Qt for Device Creation},
|
||||
and the \QC support is considered experimental.
|
||||
|
||||
\section1 Adding a QNX Neutrino Device in \QC
|
||||
|
||||
Adding a QNX Neutrino device is very similar to
|
||||
|
@@ -89,7 +89,7 @@
|
||||
|
||||
\note At the time of this writing, \macos is not supported as a development
|
||||
host for Qt for Device Creation. This means that you cannot preview UIs on
|
||||
devices if you are using \QDS on \macos. For more information about
|
||||
devices if you are using \QC on \macos. For more information about
|
||||
supported development hosts, see
|
||||
\l {https://doc.qt.io/QtForDeviceCreation/qtdc-supported-platforms.html#supported-development-hosts}
|
||||
{Supported Development Hosts}.
|
||||
|
@@ -96,7 +96,7 @@
|
||||
\endif
|
||||
|
||||
\note To profile applications on \l{glossary-device}{devices}, you
|
||||
must install Qt 4.7.4 or later libraries on them.
|
||||
must install Qt libraries on them.
|
||||
|
||||
\li Select \uicontrol Analyze > \uicontrol {QML Profiler} to profile the
|
||||
current application.
|
||||
@@ -131,8 +131,8 @@
|
||||
application is launched. Data collection starts when you select the button
|
||||
again.
|
||||
|
||||
To save all the collected data, right-click any QML Profiler view to open
|
||||
the context menu, and then select \uicontrol {Save QML Trace}. To view the saved
|
||||
To save all the collected data, select \uicontrol Analyze >
|
||||
\uicontrol {QML Profiler Options} > \uicontrol {Save QML Trace}. To view the saved
|
||||
data, select \uicontrol {Load QML Trace}. You can also deliver the saved data to
|
||||
others for examination or load data saved by them.
|
||||
|
||||
@@ -167,13 +167,21 @@
|
||||
|
||||
\section1 Attaching to Running Qt Quick Applications
|
||||
|
||||
To profile Qt Quick applications that are not launched by \QC, select
|
||||
\uicontrol Analyze > \uicontrol {QML Profiler (External)}. You must enable
|
||||
QML debugging and profiling for the application in the project build
|
||||
settings. For more information, see \l{Setting Up QML Debugging}.
|
||||
You can profile Qt Quick applications that are not launched by \QC.
|
||||
However, you must enable QML debugging and profiling for the application
|
||||
in the project build settings. For more information, see
|
||||
\l{Setting Up QML Debugging}.
|
||||
|
||||
In the \uicontrol {QML Profiler} dialog, \uicontrol Port field, specify the port to
|
||||
listen to.
|
||||
To attach to waiting applications:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol Analyze >
|
||||
\uicontrol {QML Profiler (Attach to Waiting Application)}.
|
||||
\image qml-profiler-start-dialog.png "Start QML Profiler dialog"
|
||||
\li In \uicontrol Kit, select the kit used to build the application.
|
||||
\li In \uicontrol Port, specify the port to listen to.
|
||||
\li Select \uicontrol OK.
|
||||
\endlist
|
||||
|
||||
\section1 Analyzing Collected Data
|
||||
|
||||
@@ -578,21 +586,19 @@
|
||||
\section2 Visualizing Statistics as Flame Graphs
|
||||
|
||||
The \uicontrol {Flame Graph} view shows a more concise statistical overview
|
||||
of QML and JavaScript execution. In the \uicontrol {Visualize Total Time}
|
||||
view, the horizontal bars show the amount of
|
||||
of QML and JavaScript execution. In the \uicontrol {Total Time} view, the
|
||||
horizontal bars show the amount of
|
||||
time all invocations of a certain function took together, relative to the
|
||||
total runtime of all JavaScript and QML events. The nesting shows which
|
||||
functions were called by which other ones.
|
||||
|
||||
\image qml-profiler-flamegraph.png "Flame Graph View"
|
||||
|
||||
To view the total amount of memory allocated by the functions in the
|
||||
\uicontrol {Visualize Memory} view, select \uicontrol Memory in the
|
||||
drop-down menu (1).
|
||||
To view the total amount of memory allocated by the functions, select
|
||||
\uicontrol Memory in the drop-down menu.
|
||||
|
||||
To view the the number of memory allocations performed by the functions in
|
||||
the \uicontrol {Visualize Allocations} view, select \uicontrol Allocations
|
||||
in the drop-down menu.
|
||||
To view the the number of memory allocations performed by the functions,
|
||||
select \uicontrol Allocations.
|
||||
|
||||
Double-click an item in a view to zoom into it. Double-click an empty
|
||||
area in the view to zoom out again.
|
||||
|
@@ -384,9 +384,24 @@
|
||||
|
||||
\endlist
|
||||
|
||||
Output panes are available in all \l{Selecting Modes}{modes}. Click the name
|
||||
of an output pane to open the pane. To maximize an open output pane, click
|
||||
the \uicontrol {Maximize Output Pane} button or press \key {Alt+9}.
|
||||
Output panes are available on the taskbar in all \l{Selecting Modes}{modes}.
|
||||
|
||||
\image qtcreator-output-panes-taskbar.png "Output panes on the taskbar"
|
||||
|
||||
You can open output panes in the following ways:
|
||||
|
||||
\list
|
||||
\li Select the output pane on the taskbar.
|
||||
\li Select \key Alt (\key Cmd on \macos) and the number of the pane on
|
||||
the taskbar.
|
||||
\li Select \inlineimage icons/output-pane-menu.png
|
||||
, and then select the pane to open.
|
||||
\li Select \uicontrol View > \uicontrol {Output Panes}.
|
||||
The menu items also display the keyboard shortcuts that you can use.
|
||||
\endlist
|
||||
|
||||
To maximize an open output pane, select the \inlineimage arrowup.png
|
||||
(\uicontrol {Maximize Output Pane}) button or press \key {Alt+Shift+9}.
|
||||
|
||||
|
||||
To increase or decrease the output text size, select \inlineimage plus.png
|
||||
|
@@ -55,7 +55,7 @@
|
||||
To create a project:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\li Select \uicontrol File > \uicontrol {New Project} >
|
||||
\uicontrol General > \uicontrol {Qt Quick Application - Empty} >
|
||||
\uicontrol Choose.
|
||||
\li In the \uicontrol Name field, enter the project name: \e {loginui1}.
|
||||
@@ -308,8 +308,8 @@
|
||||
To create a push button by using the wizard template:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol {Qt Quick Controls} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Controls} >
|
||||
\uicontrol {Custom Button} > \uicontrol Choose.
|
||||
\li In the \uicontrol {Component name} field, enter a name for your
|
||||
button component: \e {EntryField}.
|
||||
|
@@ -46,8 +46,8 @@
|
||||
|
||||
\section1 Creating Reusable Buttons
|
||||
|
||||
We select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol {Qt Quick Controls} >
|
||||
We select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Controls} >
|
||||
\uicontrol {Custom Button} to create a reusable menu bar button
|
||||
that we call \e CustomButton.
|
||||
|
||||
|
@@ -63,7 +63,7 @@
|
||||
We use the \uicontrol {Qt for MCUs Application} project template to create
|
||||
an application for MCUs, which support only a subset of the preset
|
||||
\l{glossary-component}{components}. We select \uicontrol File >
|
||||
\uicontrol {New File or Project} > \uicontrol {Qt for MCUs Application} >
|
||||
\uicontrol {New Project} > \uicontrol {Qt for MCUs Application} >
|
||||
\uicontrol Choose, and follow the instructions of the wizard to create our
|
||||
project.
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
that we use to indicate that a button is pressed.
|
||||
|
||||
Alternatively, you could create the screens from scratch in \QDS
|
||||
by selecting \uicontrol File > \uicontrol {New File or Project} >
|
||||
by selecting \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Files}. While designing the screens, you can
|
||||
move reusable components into separate files. For more information,
|
||||
see \l{Components}.
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
\list 1
|
||||
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\if defined(qtcreator)
|
||||
\uicontrol Qt > \uicontrol {Qt Quick UI File} >
|
||||
\else
|
||||
@@ -124,7 +124,6 @@
|
||||
information, see \l{Creating Scalable Buttons and Borders}.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\previouspage quick-buttons.html
|
||||
\page quick-scalable-image.html
|
||||
@@ -158,7 +157,7 @@
|
||||
\section1 Creating the Button Component
|
||||
|
||||
To create a button component, select \uicontrol File >
|
||||
\uicontrol {New File or Project} >
|
||||
\uicontrol {New File} >
|
||||
\if defined(qtcreator)
|
||||
\uicontrol Qt > \uicontrol {Qt Quick UI File} >
|
||||
\else
|
||||
|
@@ -47,7 +47,7 @@
|
||||
To use wizard templates to create custom components:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\if defined(qtcreator)
|
||||
\uicontrol Qt > \uicontrol {Qt Quick UI File} >
|
||||
\else
|
||||
|
@@ -43,31 +43,12 @@
|
||||
\QBPS is delivered as an Adobe extension (ZXP)
|
||||
package and requires Adobe Photoshop version 20.0.0, or later
|
||||
to be installed. The \QBPS installation process differs depending
|
||||
on whether you use ZXPInstaller and whether you are installing on
|
||||
on whether you are installing on
|
||||
Windows or \macos.
|
||||
|
||||
\section1 Installing with ZXPInstaller
|
||||
\section1 Installing on Windows
|
||||
|
||||
To use ZXPInstaller to install \QBPS:
|
||||
|
||||
\list 1
|
||||
\li Download and install \l{http://zxpinstaller.com/}{ZXPInstaller}.
|
||||
\li Start ZXPInstaller.
|
||||
\li Drag and drop the \QBPS ZXP package from
|
||||
\c {Qt\Tools\QtDesignStudio\photoshop_bridge} on Windows
|
||||
or \c {Qt/QtDesignStudio/photoshop_bridge} on \macos
|
||||
to ZXPInstaller.
|
||||
\li Follow the instructions of the installation program.
|
||||
\endlist
|
||||
|
||||
\section1 Installing Without ZXPInstaller
|
||||
|
||||
The \QBPS installation process differs depending on the platform you
|
||||
are installing on.
|
||||
|
||||
\section2 Installing on Windows
|
||||
|
||||
To install \QBPS on Windows without using ZXPInstaller:
|
||||
To install \QBPS on Windows:
|
||||
|
||||
\list 1
|
||||
\li Copy the \QBPS ZXP package from
|
||||
@@ -83,9 +64,9 @@
|
||||
\endcode
|
||||
\endlist
|
||||
|
||||
\section2 Installing on \macos
|
||||
\section1 Installing on \macos
|
||||
|
||||
To install \QBPS on \macos without using ZXPInstaller:
|
||||
To install \QBPS on \macos:
|
||||
|
||||
\list 1
|
||||
\li Copy the \QBPS ZXP package from
|
||||
|
@@ -92,7 +92,7 @@
|
||||
for it, as described in \l {Creating Projects}.
|
||||
|
||||
To create the flow view, select \uicontrol File >
|
||||
\uicontrol {New File or Project} > \uicontrol {Files and Classes} >
|
||||
\uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Files} > \uicontrol {Flow View}
|
||||
and follow the instructions of the wizard.
|
||||
|
||||
@@ -197,8 +197,8 @@
|
||||
To add flow items:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol {Qt Quick Files} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Files} >
|
||||
\uicontrol {Flow Item} and follow the instructions of the wizard
|
||||
to create flow items for each screen in the UI.
|
||||
\li Add content to the flow item in one of the following ways:
|
||||
@@ -649,8 +649,8 @@
|
||||
\uicontrol Components > \uicontrol {Flow View}.
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol {Qt Quick Files} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Files} >
|
||||
\uicontrol {Flow Item} to create a flow item.
|
||||
\li In \l States, add states to the flow item.
|
||||
\li Open the .ui.qml file that contains the \l{Adding Flow Views}
|
||||
|
@@ -70,7 +70,7 @@
|
||||
To import assets exported in \QB to \QDS projects:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\li Select \uicontrol File > \uicontrol {New Project} >
|
||||
\uicontrol General > \uicontrol {Qt Quick Application - Empty} >
|
||||
\uicontrol Choose, and follow the instructions of the wizard to
|
||||
create an empty project.
|
||||
|
@@ -66,8 +66,8 @@
|
||||
\code
|
||||
importPaths: [ "imports", "backend" ]
|
||||
\endcode
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol {Qt Quick Files} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {Qt Quick Files} >
|
||||
\uicontrol {Qt Quick File} > \uicontrol Choose to add a Qt
|
||||
Quick file that will specify the API of the UI.
|
||||
\li Follow the instructions of the wizard to create the Qt Quick file
|
||||
@@ -75,8 +75,8 @@
|
||||
\e Values.qml.
|
||||
\note Make sure to capitalize the filename, because it will become
|
||||
a custom component.
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol {JavaScript} >
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol {JavaScript} >
|
||||
\uicontrol {JavaScript File} > \uicontrol Choose to create a
|
||||
JavaScript file that generates mock data for the UI.
|
||||
\li Follow the instructions of the wizard to create the JavaScript file
|
||||
|
@@ -111,7 +111,7 @@
|
||||
\section1 Using Project Wizards
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project}.
|
||||
\li Select \uicontrol File > \uicontrol {New Project}.
|
||||
\li Select a wizard template, and then select \uicontrol Choose.
|
||||
\li In the \uicontrol Name field, enter a name for the project.
|
||||
Keep in mind that projects cannot be easily renamed later.
|
||||
|
@@ -193,7 +193,7 @@
|
||||
example, if you create a 3D project, preset 3D components are added to it.
|
||||
You can add more preset components in \uicontrol Library.
|
||||
|
||||
\image studio-project-wizards.png "New File or Project dialog"
|
||||
\image studio-project-wizards.png "New Project dialog"
|
||||
|
||||
Read more about projects:
|
||||
|
||||
|
@@ -36,9 +36,9 @@
|
||||
and dynamic behavior. You can test, preview, and fine-tune your designs to
|
||||
pixel-perfection live on the desktop or target device.
|
||||
|
||||
View \l{All Topics}{all topics} or select a topic from below.
|
||||
|
||||
\table
|
||||
\row
|
||||
\li {4,1} \b {\l{All Topics}}
|
||||
\row
|
||||
\li \inlineimage front-gs.png
|
||||
\li \inlineimage front-ui.png
|
||||
|
@@ -154,7 +154,8 @@ def package(args, paths):
|
||||
common.check_print_call(['7z', 'a', '-mmt2',
|
||||
os.path.join(paths.result, args.name + '_dev.7z'), '*'],
|
||||
paths.dev_install)
|
||||
if args.with_debug_info:
|
||||
# check for existence - the DebugInfo install target doesn't work for telemetry plugin
|
||||
if args.with_debug_info and os.path.exists(paths.debug_install):
|
||||
common.check_print_call(['7z', 'a', '-mmt2',
|
||||
os.path.join(paths.result, args.name + '-debug.7z'), '*'],
|
||||
paths.debug_install)
|
||||
|
@@ -102,11 +102,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
View3D {
|
||||
// Dummy view to hold the context
|
||||
// TODO remove when QTBUG-87678 is fixed
|
||||
}
|
||||
|
||||
Item {
|
||||
id: contentItem
|
||||
anchors.fill: parent
|
||||
|
@@ -998,18 +998,17 @@ void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView()
|
||||
void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
||||
{
|
||||
#ifdef QUICK3D_MODULE
|
||||
m_modelNode3DImageViewAsyncData.cleanup();
|
||||
if (m_modelNode3DImageViewData.rootItem) {
|
||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
|
||||
if (!m_modelNode3DImageViewData.contentItem)
|
||||
m_modelNode3DImageViewData.contentItem = getContentItemForRendering(m_modelNode3DImageViewData.rootItem);
|
||||
|
||||
// Key number is selected so that it is unlikely to conflict other ImageContainer use.
|
||||
auto imgContainer = ImageContainer(m_modelNodePreviewImageCommand.instanceId(), {}, 2100000001);
|
||||
QImage renderImage;
|
||||
if (m_modelNodePreviewImageCache.contains(m_modelNodePreviewImageCommand.componentPath())) {
|
||||
renderImage = m_modelNodePreviewImageCache[m_modelNodePreviewImageCommand.componentPath()];
|
||||
m_modelNode3DImageViewAsyncData.renderImage
|
||||
= m_modelNodePreviewImageCache[m_modelNodePreviewImageCommand.componentPath()];
|
||||
modelNode3DImageViewSendImageToCreator();
|
||||
} else {
|
||||
QObject *instanceObj = nullptr;
|
||||
bool createdFromComponent = false;
|
||||
ServerNodeInstance instance = instanceForId(m_modelNodePreviewImageCommand.instanceId());
|
||||
if (!m_modelNodePreviewImageCommand.componentPath().isEmpty()
|
||||
&& instance.isSubclassOf("QQuick3DNode")) {
|
||||
@@ -1018,14 +1017,15 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
||||
// wouldn't want the children of the Node to appear in the preview.
|
||||
QQmlComponent component(engine());
|
||||
component.loadUrl(QUrl::fromLocalFile(m_modelNodePreviewImageCommand.componentPath()));
|
||||
instanceObj = qobject_cast<QQuick3DObject *>(component.create());
|
||||
if (!instanceObj) {
|
||||
m_modelNode3DImageViewAsyncData.instanceObj = qobject_cast<QQuick3DObject *>(component.create());
|
||||
if (!m_modelNode3DImageViewAsyncData.instanceObj) {
|
||||
qWarning() << "Could not create preview component: " << component.errors();
|
||||
m_modelNode3DImageViewAsyncData.cleanup();
|
||||
return;
|
||||
}
|
||||
createdFromComponent = true;
|
||||
m_modelNode3DImageViewAsyncData.createdFromComponent = true;
|
||||
} else {
|
||||
instanceObj = instance.internalObject();
|
||||
m_modelNode3DImageViewAsyncData.instanceObj = instance.internalObject();
|
||||
}
|
||||
QSize renderSize = m_modelNodePreviewImageCommand.size();
|
||||
if (Internal::QuickItemNodeInstance::unifiedRenderPathOrQt6()) {
|
||||
@@ -1044,16 +1044,43 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
||||
m_modelNode3DImageViewData.window->resize(renderSize);
|
||||
m_modelNode3DImageViewData.rootItem->setSize(renderSize);
|
||||
|
||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "createViewForObject",
|
||||
Q_ARG(QVariant, objectToVariant(instanceObj)));
|
||||
QMetaObject::invokeMethod(
|
||||
m_modelNode3DImageViewData.rootItem, "createViewForObject",
|
||||
Q_ARG(QVariant, objectToVariant(m_modelNode3DImageViewAsyncData.instanceObj)));
|
||||
|
||||
// Selection box geometry updates have an asynchronous step, so we need to do rendering
|
||||
// in asynchronous steps as well, since we are adjusting the selection box geometry
|
||||
// while finding correct zoom level.
|
||||
m_modelNode3DImageViewAsyncData.timer.start();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::modelNode3DImageViewSendImageToCreator()
|
||||
{
|
||||
if (!m_modelNode3DImageViewAsyncData.renderImage.isNull()) {
|
||||
// Key number is selected so that it is unlikely to conflict other ImageContainer use.
|
||||
ImageContainer imgContainer(m_modelNodePreviewImageCommand.instanceId(), {}, 2100000001);
|
||||
imgContainer.setImage(m_modelNode3DImageViewAsyncData.renderImage);
|
||||
|
||||
// send the rendered image to creator process
|
||||
nodeInstanceClient()->handlePuppetToCreatorCommand(
|
||||
{PuppetToCreatorCommand::RenderModelNodePreviewImage,
|
||||
QVariant::fromValue(imgContainer)});
|
||||
|
||||
m_modelNode3DImageViewAsyncData.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::modelNode3DImageViewRenderStep()
|
||||
{
|
||||
++m_modelNode3DImageViewAsyncData.count;
|
||||
|
||||
bool ready = false;
|
||||
int count = 0; // Ensure we don't ever get stuck in an infinite loop
|
||||
while (!ready && ++count < 10) {
|
||||
updateNodesRecursive(m_modelNode3DImageViewData.contentItem);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
|
||||
renderImage = m_modelNode3DImageViewData.window->grabWindow();
|
||||
m_modelNode3DImageViewAsyncData.renderImage = m_modelNode3DImageViewData.window->grabWindow();
|
||||
} else {
|
||||
// Fake render loop signaling to update things like QML items as 3D textures
|
||||
m_modelNode3DImageViewData.window->beforeSynchronizing();
|
||||
@@ -1061,34 +1088,27 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
||||
|
||||
QSizeF size = qobject_cast<QQuickItem *>(m_modelNode3DImageViewData.contentItem)->size();
|
||||
QRectF renderRect(QPointF(0., 0.), size);
|
||||
renderImage = designerSupport()->renderImageForItem(m_modelNode3DImageViewData.contentItem,
|
||||
m_modelNode3DImageViewAsyncData.renderImage
|
||||
= designerSupport()->renderImageForItem(m_modelNode3DImageViewData.contentItem,
|
||||
renderRect, size.toSize());
|
||||
|
||||
m_modelNode3DImageViewData.window->afterRendering();
|
||||
}
|
||||
#else
|
||||
renderImage = grabRenderControl(m_modelNode3DImageViewData);
|
||||
m_modelNode3DImageViewAsyncData.renderImage = grabRenderControl(m_modelNode3DImageViewData);
|
||||
#endif
|
||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "afterRender");
|
||||
ready = QQmlProperty::read(m_modelNode3DImageViewData.rootItem, "ready").value<bool>();
|
||||
}
|
||||
const bool ready = QQmlProperty::read(m_modelNode3DImageViewData.rootItem, "ready").value<bool>();
|
||||
if (ready || m_modelNode3DImageViewAsyncData.count >= 10) {
|
||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
|
||||
if (createdFromComponent) {
|
||||
if (m_modelNode3DImageViewAsyncData.createdFromComponent) {
|
||||
// If component changes, puppet will need a reset anyway, so we can cache the image
|
||||
m_modelNodePreviewImageCache.insert(m_modelNodePreviewImageCommand.componentPath(), renderImage);
|
||||
delete instanceObj;
|
||||
m_modelNodePreviewImageCache.insert(m_modelNodePreviewImageCommand.componentPath(),
|
||||
m_modelNode3DImageViewAsyncData.renderImage);
|
||||
}
|
||||
modelNode3DImageViewSendImageToCreator();
|
||||
} else {
|
||||
m_modelNode3DImageViewAsyncData.timer.start();
|
||||
}
|
||||
|
||||
if (!renderImage.isNull()) {
|
||||
imgContainer.setImage(renderImage);
|
||||
|
||||
// send the rendered image to creator process
|
||||
nodeInstanceClient()->handlePuppetToCreatorCommand({PuppetToCreatorCommand::RenderModelNodePreviewImage,
|
||||
QVariant::fromValue(imgContainer)});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static QRectF itemBoundingRect(QQuickItem *item)
|
||||
@@ -1205,6 +1225,7 @@ Qt5InformationNodeInstanceServer::Qt5InformationNodeInstanceServer(NodeInstanceC
|
||||
m_render3DEditViewTimer.setSingleShot(true);
|
||||
m_inputEventTimer.setSingleShot(true);
|
||||
m_renderModelNodeImageViewTimer.setSingleShot(true);
|
||||
m_modelNode3DImageViewAsyncData.timer.setSingleShot(true);
|
||||
|
||||
#ifdef FPS_COUNTER
|
||||
if (!_fpsTimer) {
|
||||
@@ -1224,11 +1245,12 @@ Qt5InformationNodeInstanceServer::~Qt5InformationNodeInstanceServer()
|
||||
{
|
||||
m_editView3DSetupDone = false;
|
||||
|
||||
m_propertyChangeTimer.stop();
|
||||
m_propertyChangeTimer.stop();
|
||||
m_selectionChangeTimer.stop();
|
||||
m_render3DEditViewTimer.stop();
|
||||
m_inputEventTimer.stop();
|
||||
m_renderModelNodeImageViewTimer.stop();
|
||||
m_modelNode3DImageViewAsyncData.timer.stop();
|
||||
|
||||
if (m_editView3DData.rootItem)
|
||||
m_editView3DData.rootItem->disconnect(this);
|
||||
@@ -1621,6 +1643,8 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
|
||||
this, &Qt5InformationNodeInstanceServer::doRender3DEditView);
|
||||
QObject::connect(&m_inputEventTimer, &QTimer::timeout,
|
||||
this, &Qt5InformationNodeInstanceServer::handleInputEvents);
|
||||
QObject::connect(&m_modelNode3DImageViewAsyncData.timer, &QTimer::timeout,
|
||||
this, &Qt5InformationNodeInstanceServer::modelNode3DImageViewRenderStep);
|
||||
|
||||
QString lastSceneId;
|
||||
auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper);
|
||||
@@ -2089,6 +2113,7 @@ void Qt5InformationNodeInstanceServer::view3DAction(const View3DActionCommand &c
|
||||
|
||||
void Qt5InformationNodeInstanceServer::requestModelNodePreviewImage(const RequestModelNodePreviewImageCommand &command)
|
||||
{
|
||||
m_modelNode3DImageViewAsyncData.timer.stop();
|
||||
m_modelNodePreviewImageCommand = command;
|
||||
renderModelNodeImageView();
|
||||
}
|
||||
|
@@ -138,6 +138,8 @@ private:
|
||||
void renderModelNodeImageView();
|
||||
void doRenderModelNodeImageView();
|
||||
void doRenderModelNode3DImageView();
|
||||
void modelNode3DImageViewSendImageToCreator();
|
||||
void modelNode3DImageViewRenderStep();
|
||||
void doRenderModelNode2DImageView();
|
||||
void updateLockedAndHiddenStates(const QSet<ServerNodeInstance> &instances);
|
||||
void handleInputEvents();
|
||||
@@ -184,6 +186,26 @@ private:
|
||||
QList<InputEventCommand> m_pendingInputEventCommands;
|
||||
QObject *m_3dHelper = nullptr;
|
||||
int m_need3DEditViewRender = 0;
|
||||
|
||||
struct ModelNode3DImageViewAsyncData {
|
||||
QTimer timer;
|
||||
QImage renderImage;
|
||||
int count = 0;
|
||||
bool createdFromComponent = false;
|
||||
QObject *instanceObj = nullptr;
|
||||
|
||||
void cleanup()
|
||||
{
|
||||
timer.stop();
|
||||
count = 0;
|
||||
renderImage = {};
|
||||
if (createdFromComponent)
|
||||
delete instanceObj;
|
||||
instanceObj = nullptr;
|
||||
createdFromComponent = false;
|
||||
}
|
||||
};
|
||||
ModelNode3DImageViewAsyncData m_modelNode3DImageViewAsyncData;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
@@ -417,7 +417,7 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
|
||||
if (instance.isValid())
|
||||
renderBoundingRect = instance.boundingRect();
|
||||
else
|
||||
renderBoundingRect = item->boundingRect();
|
||||
renderBoundingRect = ServerNodeInstance::effectAdjustedBoundingRect(item);
|
||||
|
||||
// Hide immediate children that have instances and are QQuickItems so we get only
|
||||
// the parent item's content, as compositing is handled on creator side.
|
||||
|
@@ -329,11 +329,23 @@ QRectF QuickItemNodeInstance::contentItemBoundingBox() const
|
||||
return QRectF();
|
||||
}
|
||||
|
||||
static bool layerEnabledAndEffect(QQuickItem *item)
|
||||
{
|
||||
QQuickItemPrivate *pItem = QQuickItemPrivate::get(item);
|
||||
|
||||
if (pItem && pItem->layer() && pItem->layer()->enabled() && pItem->layer()->effect())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QRectF QuickItemNodeInstance::boundingRect() const
|
||||
{
|
||||
if (quickItem()) {
|
||||
if (quickItem()->clip()) {
|
||||
return quickItem()->boundingRect();
|
||||
} else if (layerEnabledAndEffect(quickItem())) {
|
||||
return ServerNodeInstance::effectAdjustedBoundingRect(quickItem());
|
||||
} else {
|
||||
QSize maximumSize(4000, 4000);
|
||||
auto isValidSize = [maximumSize] (const QRectF& rect) {
|
||||
|
@@ -135,6 +135,13 @@ bool ServerNodeInstance::isSubclassOf(QObject *object, const QByteArray &superTy
|
||||
return Internal::QmlPrivateGate::isSubclassOf(object, superTypeName);
|
||||
}
|
||||
|
||||
QRectF ServerNodeInstance::effectAdjustedBoundingRect(QQuickItem *item)
|
||||
{
|
||||
if (item)
|
||||
return item->boundingRect().adjusted(-40, -40, 40, 40);
|
||||
return {};
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setModifiedFlag(bool b)
|
||||
{
|
||||
m_nodeInstance->setModifiedFlag(b);
|
||||
|
@@ -180,6 +180,7 @@ public:
|
||||
QStringList allStates() const;
|
||||
|
||||
static bool isSubclassOf(QObject *object, const QByteArray &superTypeName);
|
||||
static QRectF effectAdjustedBoundingRect(QQuickItem *item);
|
||||
|
||||
void setModifiedFlag(bool b);
|
||||
void updateDirtyNodeRecursive();
|
||||
|
@@ -57,7 +57,7 @@ QtObject {
|
||||
readonly property string darkPaneColor: StudioTheme.Values.themeBackgroundColorNormal
|
||||
readonly property string lightPaneColor: StudioTheme.Values.themeBackgroundColorAlternate
|
||||
|
||||
readonly property string textColor: StudioTheme.Values.themeTabInactiveText
|
||||
readonly property string textColor: StudioTheme.Values.themeTextColor
|
||||
readonly property string textColorInteraction: StudioTheme.Values.themeInteraction
|
||||
readonly property string dividerlineColor: StudioTheme.Values.themeTextColorDisabled
|
||||
readonly property string textError: StudioTheme.Values.themeError
|
||||
|
@@ -35,67 +35,58 @@ GridView {
|
||||
|
||||
required property Item loader
|
||||
|
||||
header: TabBar {
|
||||
id: tabBar
|
||||
readonly property int animDur: 500
|
||||
|
||||
header: Rectangle {
|
||||
width: parent.width
|
||||
height: DialogValues.projectViewHeaderHeight
|
||||
|
||||
background: Rectangle {
|
||||
color: DialogValues.lightPaneColor
|
||||
}
|
||||
|
||||
Row {
|
||||
id: row
|
||||
spacing: 20
|
||||
property int currIndex: 0
|
||||
|
||||
Repeater {
|
||||
model: categoryModel
|
||||
|
||||
TabButton {
|
||||
padding: 0
|
||||
|
||||
width: headerText.contentWidth + 36
|
||||
|
||||
background: Item { // TabButton background
|
||||
Rectangle { // bottom strip
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: headerText.contentWidth
|
||||
height: 6
|
||||
radius: 10
|
||||
color: tabBar.currentIndex === index ? DialogValues.textColorInteraction
|
||||
: "transparent"
|
||||
}
|
||||
} // TabButton background
|
||||
|
||||
implicitHeight: headerText.height + DialogValues.defaultPadding - 7
|
||||
|
||||
contentItem: Item {
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
|
||||
Text {
|
||||
id: headerText
|
||||
color: tabBar.currentIndex == index ? DialogValues.textColorInteraction
|
||||
: DialogValues.textColor
|
||||
text: name
|
||||
width: parent.width
|
||||
font.weight: Font.DemiBold
|
||||
font.pixelSize: DialogValues.viewHeaderPixelSize
|
||||
lineHeight: DialogValues.viewHeaderLineHeight
|
||||
lineHeightMode: Text.FixedHeight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
Item { width: parent.width; height: 11; }
|
||||
} // Column
|
||||
} // Item
|
||||
color: row.currIndex === index ? DialogValues.textColorInteraction
|
||||
: DialogValues.textColor
|
||||
Behavior on color { ColorAnimation { duration: animDur } }
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
row.currIndex = index
|
||||
projectModel.setPage(index)
|
||||
projectView.currentIndex = 0
|
||||
projectView.currentIndexChanged()
|
||||
|
||||
strip.x = parent.x
|
||||
strip.width = parent.width
|
||||
}
|
||||
} // TabButton
|
||||
}
|
||||
|
||||
} // Text
|
||||
} // Repeater
|
||||
} // Header - TabBar
|
||||
} // Row
|
||||
|
||||
Rectangle {
|
||||
id: strip
|
||||
width: row.children[0].width
|
||||
height: 5
|
||||
radius: 2
|
||||
color: DialogValues.textColorInteraction
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
Behavior on x { SmoothedAnimation { duration: animDur } }
|
||||
Behavior on width { SmoothedAnimation { duration: strip.width === 0 ? 0 : animDur } } // do not animate initial width
|
||||
}
|
||||
} // Rectangle
|
||||
|
||||
cellWidth: DialogValues.projectItemWidth
|
||||
cellHeight: DialogValues.projectItemHeight
|
||||
|
@@ -110,7 +110,7 @@ DStitleBarIcon=ffffffff
|
||||
DStitleBarButtonHover=40ffffff
|
||||
DStitleBarButtonPress=60ffffff
|
||||
|
||||
DStabContainerBackground=ff0000ff
|
||||
DStabContainerBackground=ff1f1f1f
|
||||
DStabSplitter=ff595959
|
||||
|
||||
DStabInactiveBackground=ff1f1f1f
|
||||
|
@@ -101,7 +101,7 @@ DStitleBarIcon=ff4f5052
|
||||
DStitleBarButtonHover=40ffffff
|
||||
DStitleBarButtonPress=60ffffff
|
||||
|
||||
DStabContainerBackground=ff0000ff
|
||||
DStabContainerBackground=ff999999
|
||||
DStabSplitter=ff595959
|
||||
|
||||
DStabInactiveBackground=ff999999
|
||||
|
@@ -115,7 +115,7 @@ DStitleBarIcon=ff4f5052
|
||||
DStitleBarButtonHover=40ffffff
|
||||
DStitleBarButtonPress=60ffffff
|
||||
|
||||
DStabContainerBackground=ff0000ff
|
||||
DStabContainerBackground=ffdadada
|
||||
DStabSplitter=ff595959
|
||||
|
||||
DStabInactiveBackground=ff999999
|
||||
|
@@ -112,7 +112,7 @@ DStitleBarIcon=ffffffff
|
||||
DStitleBarButtonHover=40ffffff
|
||||
DStitleBarButtonPress=60ffffff
|
||||
|
||||
DStabContainerBackground=ff0000ff
|
||||
DStabContainerBackground=ff1f1f1f
|
||||
DStabSplitter=ff595959
|
||||
|
||||
DStabInactiveBackground=ff1f1f1f
|
||||
|
@@ -114,7 +114,7 @@ DStitleBarIcon=ffffffff
|
||||
DStitleBarButtonHover=40ffffff
|
||||
DStitleBarButtonPress=60ffffff
|
||||
|
||||
DStabContainerBackground=ff0000ff
|
||||
DStabContainerBackground=ff1f1f1f
|
||||
DStabSplitter=ff595959
|
||||
|
||||
DStabInactiveBackground=ff1f1f1f
|
||||
|
@@ -110,7 +110,7 @@ DStitleBarIcon=ff4f5052
|
||||
DStitleBarButtonHover=40ffffff
|
||||
DStitleBarButtonPress=60ffffff
|
||||
|
||||
DStabContainerBackground=ff0000ff
|
||||
DStabContainerBackground=ffdadada
|
||||
DStabSplitter=ff595959
|
||||
|
||||
DStabInactiveBackground=ff999999
|
||||
|
@@ -31,6 +31,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qlitehtml/src/CMakeLists.txt)
|
||||
set(QLITEHTML_DEVEL_EXCLUDE_FROM_ALL ON)
|
||||
set(QLITEHTML_HEADER_PATH "${IDE_HEADER_INSTALL_PATH}/src/lib/qlitehtml")
|
||||
set(QT_VERSION_MAJOR ${Qt5_VERSION_MAJOR})
|
||||
set(BUILD_TESTING OFF) # otherwise litehtml downloads googletest
|
||||
add_subdirectory(qlitehtml/src)
|
||||
endif()
|
||||
if(TARGET qlitehtml)
|
||||
|
@@ -31,6 +31,13 @@
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef QTCREATOR_PCH_H
|
||||
#define CALLBACK WINAPI
|
||||
#endif
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Utils {
|
||||
@@ -83,6 +90,26 @@ bool Reaper::isFinished() const
|
||||
return !m_process;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
static BOOL sendMessage(UINT message, HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
DWORD dwProcessID;
|
||||
GetWindowThreadProcessId(hwnd, &dwProcessID);
|
||||
if ((DWORD)lParam == dwProcessID) {
|
||||
SendNotifyMessage(hwnd, message, 0, 0);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK sendShutDownMessageToAllWindowsOfProcess_enumWnd(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
static UINT uiShutDownMessage = RegisterWindowMessage(L"qtcctrlcstub_shutdown");
|
||||
return sendMessage(uiShutDownMessage, hwnd, lParam);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void Reaper::nextIteration()
|
||||
{
|
||||
QProcess::ProcessState state = m_process ? m_process->state() : QProcess::NotRunning;
|
||||
@@ -96,11 +123,16 @@ void Reaper::nextIteration()
|
||||
if (m_lastState == QProcess::Starting)
|
||||
m_process->kill();
|
||||
} else if (state == QProcess::Running) {
|
||||
if (m_lastState == QProcess::Running)
|
||||
if (m_lastState == QProcess::Running) {
|
||||
m_process->kill();
|
||||
else
|
||||
} else if (m_process->program().endsWith(QLatin1String("qtcreator_ctrlc_stub.exe"))) {
|
||||
#ifdef Q_OS_WIN
|
||||
EnumWindows(sendShutDownMessageToAllWindowsOfProcess_enumWnd, m_process->processId());
|
||||
#endif
|
||||
} else {
|
||||
m_process->terminate();
|
||||
}
|
||||
}
|
||||
|
||||
m_lastState = state;
|
||||
m_iterationTimer.start();
|
||||
@@ -149,10 +181,7 @@ void ProcessReaper::reap(QProcess *process, int timeoutMs)
|
||||
if (process->state() == QProcess::NotRunning) {
|
||||
process->deleteLater();
|
||||
return;
|
||||
} else {
|
||||
process->kill();
|
||||
}
|
||||
|
||||
// Neither can move object with a parent into a different thread
|
||||
// nor reaping the process with a parent makes any sense.
|
||||
process->setParent(nullptr);
|
||||
|
@@ -3703,7 +3703,13 @@ void ExtraHighlightingResultsCollector::visitNode(const AstNode &node)
|
||||
|
||||
bool ClangdClient::FollowSymbolData::defLinkIsAmbiguous() const
|
||||
{
|
||||
// If we have up-to-date highlighting info, we can give a definite answer.
|
||||
// Even if the call is to a virtual function, it might not be ambiguous:
|
||||
// class A { virtual void f(); }; class B : public A { void f() override { A::f(); } };
|
||||
if (!cursorNode->mightBeAmbiguousVirtualCall() && !cursorNode->isPureVirtualDeclaration())
|
||||
return false;
|
||||
|
||||
// If we have up-to-date highlighting info, we know whether we are dealing with
|
||||
// a virtual call.
|
||||
if (editorWidget) {
|
||||
const auto virtualRanges = q->d->virtualRanges.constFind(editorWidget->textDocument());
|
||||
if (virtualRanges != q->d->virtualRanges.constEnd()
|
||||
@@ -3715,8 +3721,9 @@ bool ClangdClient::FollowSymbolData::defLinkIsAmbiguous() const
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise, we have to rely on AST-based heuristics.
|
||||
return cursorNode->mightBeAmbiguousVirtualCall() || cursorNode->isPureVirtualDeclaration();
|
||||
// Otherwise, we accept potentially doing more work than needed rather than not catching
|
||||
// possible overrides.
|
||||
return true;
|
||||
}
|
||||
|
||||
class MemoryTree : public JsonObject
|
||||
|
@@ -149,6 +149,7 @@ void CMakeManager::updateCmakeActions(Node *node)
|
||||
auto project = qobject_cast<CMakeProject *>(SessionManager::startupProject());
|
||||
const bool visible = project && !BuildManager::isBuilding(project);
|
||||
m_runCMakeAction->setVisible(visible);
|
||||
m_runCMakeActionContextMenu->setEnabled(visible);
|
||||
m_clearCMakeCacheAction->setVisible(visible);
|
||||
m_rescanProjectAction->setVisible(visible);
|
||||
enableBuildFileMenus(node);
|
||||
|
@@ -607,7 +607,7 @@ QList<IDocument *> DocumentManager::modifiedDocuments()
|
||||
}
|
||||
|
||||
/*!
|
||||
Treats any subsequent change to \a fileName as an expected file change.
|
||||
Treats any subsequent change to \a filePath as an expected file change.
|
||||
|
||||
\sa unexpectFileChange()
|
||||
*/
|
||||
@@ -631,7 +631,7 @@ static void updateExpectedState(const FilePath &filePathKey)
|
||||
}
|
||||
|
||||
/*!
|
||||
Considers all changes to \a fileName unexpected again.
|
||||
Considers all changes to \a filePath unexpected again.
|
||||
|
||||
\sa expectFileChange()
|
||||
*/
|
||||
|
@@ -258,29 +258,13 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class EditorManager::FilePathInfo
|
||||
\inheaderfile coreplugin/editormanager/editormanager.h
|
||||
\inmodule QtCreator
|
||||
|
||||
\brief The FilePathInfo class contains information about a file path's
|
||||
special segments.
|
||||
|
||||
File names can have an additional postfix, optionally specifying a line and
|
||||
column number, when opening a file in \QC from the command line or locator.
|
||||
The FilePathInfo class contains the file name, the complete postfix string,
|
||||
and the parsed line and column numbers.
|
||||
|
||||
\sa EditorManager::splitLineAndColumnNumber()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::currentEditorChanged(IEditor *editor)
|
||||
\fn void Core::EditorManager::currentEditorChanged(Core::IEditor *editor)
|
||||
|
||||
This signal is emitted after the current editor changed to \a editor.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::currentDocumentStateChanged()
|
||||
\fn void Core::EditorManager::currentDocumentStateChanged()
|
||||
|
||||
This signal is emitted when the meta data of the current document, for
|
||||
example file name or modified state, changed.
|
||||
@@ -289,7 +273,7 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::documentStateChanged(IDocument *document)
|
||||
\fn void Core::EditorManager::documentStateChanged(Core::IDocument *document)
|
||||
|
||||
This signal is emitted when the meta data of the \a document, for
|
||||
example file name or modified state, changed.
|
||||
@@ -298,13 +282,13 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::editorCreated(IEditor *editor, const QString &fileName)
|
||||
\fn void Core::EditorManager::editorCreated(Core::IEditor *editor, const QString &fileName)
|
||||
|
||||
This signal is emitted after an \a editor was created for \a fileName, but
|
||||
before it was opened in an editor view.
|
||||
*/
|
||||
/*!
|
||||
\fn void EditorManager::editorOpened(IEditor *editor)
|
||||
\fn void Core::EditorManager::editorOpened(Core::IEditor *editor)
|
||||
|
||||
This signal is emitted after a new \a editor was opened in an editor view.
|
||||
|
||||
@@ -312,14 +296,14 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::documentOpened(IDocument *document)
|
||||
\fn void Core::EditorManager::documentOpened(Core::IDocument *document)
|
||||
|
||||
This signal is emitted after the first editor for \a document opened in an
|
||||
editor view.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::editorAboutToClose(IEditor *editor)
|
||||
\fn void Core::EditorManager::editorAboutToClose(Core::IEditor *editor)
|
||||
|
||||
This signal is emitted before \a editor is closed. This can be used to free
|
||||
resources that were allocated for the editor separately from the editor
|
||||
@@ -332,7 +316,7 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::editorsClosed(QList<IEditor *> editors)
|
||||
\fn void Core::EditorManager::editorsClosed(QList<Core::IEditor *> editors)
|
||||
|
||||
This signal is emitted after the \a editors closed, but before they are
|
||||
deleted.
|
||||
@@ -341,7 +325,7 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void EditorManager::documentClosed(IDocument *document)
|
||||
\fn void Core::EditorManager::documentClosed(Core::IDocument *document)
|
||||
|
||||
This signal is emitted after the \a document closed, but before it is deleted.
|
||||
*/
|
||||
@@ -351,22 +335,22 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
|
||||
\internal
|
||||
*/
|
||||
/*!
|
||||
\fn void EditorManager::aboutToSave(IDocument *document)
|
||||
\fn void Core::EditorManager::aboutToSave(Core::IDocument *document)
|
||||
|
||||
This signal is emitted before the \a document is saved.
|
||||
*/
|
||||
/*!
|
||||
\fn void EditorManager::saved(IDocument *document)
|
||||
\fn void Core::EditorManager::saved(Core::IDocument *document)
|
||||
|
||||
This signal is emitted after the \a document was saved.
|
||||
*/
|
||||
/*!
|
||||
\fn void EditorManager::autoSaved()
|
||||
\fn void Core::EditorManager::autoSaved()
|
||||
|
||||
This signal is emitted after auto-save was triggered.
|
||||
*/
|
||||
/*!
|
||||
\fn void EditorManager::currentEditorAboutToChange(IEditor *editor)
|
||||
\fn void Core::EditorManager::currentEditorAboutToChange(Core::IEditor *editor)
|
||||
|
||||
This signal is emitted before the current editor changes to \a editor.
|
||||
*/
|
||||
@@ -3092,10 +3076,10 @@ IEditor *EditorManager::openEditor(const FilePath &filePath, Id editorId,
|
||||
}
|
||||
|
||||
/*!
|
||||
Opens the document specified by \a filePath using the editor type \a
|
||||
Opens the document specified by \a link using the editor type \a
|
||||
editorId and the specified \a flags.
|
||||
|
||||
Moves the text cursor to the \a line and \a column.
|
||||
Moves the text cursor to the \e line and \e column specified in \a link.
|
||||
|
||||
If \a editorId is \c Id(), the editor type is derived from the file's MIME
|
||||
type.
|
||||
@@ -3157,7 +3141,7 @@ void EditorManager::openEditorAtSearchResult(const SearchResultItem &item,
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns whether \a fileName is an auto-save file created by \QC.
|
||||
Returns whether \a filePath is an auto-save file created by \QC.
|
||||
*/
|
||||
bool EditorManager::isAutoSaveFile(const QString &filePath)
|
||||
{
|
||||
@@ -3209,7 +3193,7 @@ void EditorManager::addCloseEditorListener(const std::function<bool (IEditor *)>
|
||||
/*!
|
||||
Asks the user for a list of files to open and returns the choice.
|
||||
|
||||
\sa DocumentManager::getOpenFilePaths()
|
||||
\sa DocumentManager::getOpenFileNames()
|
||||
*/
|
||||
FilePaths EditorManager::getOpenFilePaths()
|
||||
{
|
||||
|
@@ -162,7 +162,7 @@ const EditorFactoryList IEditorFactory::defaultEditorFactories(const Utils::Mime
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the available editor factories for \a fileName in order of
|
||||
Returns the available editor factories for \a filePath in order of
|
||||
preference. That is the default order for the document's MIME type but with
|
||||
a user overridden default editor first, and the binary editor as the very
|
||||
first item if a text document is too large to be opened as a text file.
|
||||
|
@@ -55,8 +55,7 @@ namespace Core {
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
||||
\fn bool Core::IExternalEditor::startEditor(const QString &fileName, QString *errorMessage) = 0;
|
||||
\fn bool Core::IExternalEditor::startEditor(const Utils::FilePath &fileName, QString *errorMessage)
|
||||
|
||||
Opens the editor with \a fileName. Returns \c true on success or \c false
|
||||
on failure along with the error in \a errorMessage.
|
||||
|
@@ -186,7 +186,7 @@ QIcon FileIconProviderImplementation::icon(const FilePath &filePath) const
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the icon associated with the file suffix in \a info. If there is none,
|
||||
Returns the icon associated with the file suffix in \a filePath. If there is none,
|
||||
the default icon of the operating system is returned.
|
||||
*/
|
||||
|
||||
|
@@ -859,7 +859,7 @@ void SearchResult::setTextToReplace(const QString &textToReplace)
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets whether replace is enabled and can be triggered by the user
|
||||
Sets whether replace is \a enabled and can be triggered by the user.
|
||||
*/
|
||||
void SearchResult::setReplaceEnabled(bool enabled)
|
||||
{
|
||||
|
@@ -426,7 +426,7 @@ static QString pathHelper(const QString &rel)
|
||||
return '/' + rel;
|
||||
}
|
||||
/*!
|
||||
Returns the absolute path that is used for resources like
|
||||
Returns the absolute path for the relative path \a rel that is used for resources like
|
||||
project templates and the debugger macros.
|
||||
|
||||
This abstraction is needed to avoid platform-specific code all over
|
||||
@@ -443,7 +443,7 @@ FilePath ICore::resourcePath(const QString &rel)
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the absolute path in the users directory that is used for
|
||||
Returns the absolute path for the relative path \a rel in the users directory that is used for
|
||||
resources like project templates.
|
||||
|
||||
Use this function for finding the place for resources that the user may
|
||||
@@ -468,7 +468,7 @@ FilePath ICore::userResourcePath(const QString &rel)
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a writable path that can be used for persistent cache files.
|
||||
Returns a writable path for the relative path \a rel that can be used for persistent cache files.
|
||||
*/
|
||||
FilePath ICore::cacheResourcePath(const QString &rel)
|
||||
{
|
||||
@@ -477,8 +477,8 @@ FilePath ICore::cacheResourcePath(const QString &rel)
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the path to resources written by the installer, for example
|
||||
pre-defined kits and toolchains.
|
||||
Returns the path, based on the relative path \a rel, to resources written by the installer,
|
||||
for example pre-defined kits and toolchains.
|
||||
*/
|
||||
FilePath ICore::installerResourcePath(const QString &rel)
|
||||
{
|
||||
@@ -516,8 +516,8 @@ QString ICore::userPluginPath()
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the path to the command line tools that are included in the \QC
|
||||
installation.
|
||||
Returns the path, based on the relative path \a rel, to the command line tools that are
|
||||
included in the \QC installation.
|
||||
*/
|
||||
FilePath ICore::libexecPath(const QString &rel)
|
||||
{
|
||||
|
@@ -61,11 +61,11 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn Core::IVersionControl::TopicCache::trackFile(const QString &repository)
|
||||
\fn Utils::FilePath Core::IVersionControl::TopicCache::trackFile(const Utils::FilePath &repository)
|
||||
Returns the path to the file that invalidates the cache for \a repository when
|
||||
the file is modified.
|
||||
|
||||
\fn Core::IVersionControl::TopicCache::refreshTopic(const QString &repository)
|
||||
\fn QString Core::IVersionControl::TopicCache::refreshTopic(const Utils::FilePath &repository)
|
||||
Returns the current topic for \a repository.
|
||||
*/
|
||||
|
||||
|
@@ -180,7 +180,7 @@ static QString defaultCommand()
|
||||
return "locate";
|
||||
}
|
||||
|
||||
/*!
|
||||
/*
|
||||
For the tools es [1] and locate [2], interpret space as AND operator.
|
||||
|
||||
Currently doesn't support fine picking a file with a space in the path by escaped space.
|
||||
|
@@ -81,6 +81,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Range range() const { return m_range; }
|
||||
Position pos() const { return m_range.start(); }
|
||||
bool contains(const Position &pos) const { return m_range.contains(pos); }
|
||||
|
||||
@@ -345,8 +346,14 @@ void OutlineComboBox::updateModel(const DocumentUri &resultUri, const DocumentSy
|
||||
void OutlineComboBox::updateEntry()
|
||||
{
|
||||
const Position pos(m_editorWidget->textCursor());
|
||||
LanguageClientOutlineItem *itemForCursor = m_model.findNonRootItem(
|
||||
[&](const LanguageClientOutlineItem *item) { return item->contains(pos); });
|
||||
LanguageClientOutlineItem *itemForCursor = nullptr;
|
||||
m_model.forAllItems([&](LanguageClientOutlineItem *candidate){
|
||||
if (!candidate->contains(pos))
|
||||
return;
|
||||
if (itemForCursor && candidate->range().contains(itemForCursor->range()))
|
||||
return; // skip item if the range is equal or bigger than the previous found range
|
||||
itemForCursor = candidate;
|
||||
});
|
||||
if (itemForCursor)
|
||||
setCurrentIndex(m_model.indexForItem(itemForCursor));
|
||||
}
|
||||
|
@@ -60,6 +60,7 @@ SemanticTokenSupport::SemanticTokenSupport(Client *client)
|
||||
|
||||
void SemanticTokenSupport::refresh()
|
||||
{
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "refresh all semantic highlights for" << m_client->name();
|
||||
m_tokens.clear();
|
||||
for (Core::IEditor *editor : Core::EditorManager::visibleEditors())
|
||||
onCurrentEditorChanged(editor);
|
||||
@@ -95,6 +96,8 @@ void SemanticTokenSupport::reloadSemanticTokens(TextDocument *textDocument)
|
||||
params.setTextDocument(docId);
|
||||
SemanticTokensFullRequest request(params);
|
||||
request.setResponseCallback(responseCallback);
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "Requesting all tokens for" << filePath << "with version"
|
||||
<< m_client->documentVersion(filePath);
|
||||
m_client->sendContent(request);
|
||||
}
|
||||
}
|
||||
@@ -107,19 +110,22 @@ void SemanticTokenSupport::updateSemanticTokens(TextDocument *textDocument)
|
||||
const VersionedTokens versionedToken = m_tokens.value(filePath);
|
||||
const QString &previousResultId = versionedToken.tokens.resultId().value_or(QString());
|
||||
if (!previousResultId.isEmpty()) {
|
||||
if (m_client->documentVersion(filePath) == versionedToken.version)
|
||||
const int documentVersion = m_client->documentVersion(filePath);
|
||||
if (documentVersion == versionedToken.version)
|
||||
return;
|
||||
SemanticTokensDeltaParams params;
|
||||
params.setTextDocument(TextDocumentIdentifier(DocumentUri::fromFilePath(filePath)));
|
||||
params.setPreviousResultId(previousResultId);
|
||||
SemanticTokensFullDeltaRequest request(params);
|
||||
request.setResponseCallback(
|
||||
[this, filePath, documentVersion = m_client->documentVersion(filePath)](
|
||||
[this, filePath, documentVersion](
|
||||
const SemanticTokensFullDeltaRequest::Response &response) {
|
||||
handleSemanticTokensDelta(filePath,
|
||||
response.result().value_or(nullptr),
|
||||
documentVersion);
|
||||
});
|
||||
qCDebug(LOGLSPHIGHLIGHT)
|
||||
<< "Requesting delta for" << filePath << "with version" << documentVersion;
|
||||
m_client->sendContent(request);
|
||||
return;
|
||||
}
|
||||
@@ -288,8 +294,10 @@ void SemanticTokenSupport::handleSemanticTokensDelta(
|
||||
const LanguageServerProtocol::SemanticTokensDeltaResult &result,
|
||||
int documentVersion)
|
||||
{
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "Handle Tokens for " << filePath;
|
||||
if (auto tokens = Utils::get_if<SemanticTokens>(&result)) {
|
||||
m_tokens[filePath] = {*tokens, documentVersion};
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "New Data " << tokens->data();
|
||||
} else if (auto tokensDelta = Utils::get_if<SemanticTokensDelta>(&result)) {
|
||||
m_tokens[filePath].version = documentVersion;
|
||||
QList<SemanticTokensEdit> edits = tokensDelta->edits();
|
||||
@@ -311,7 +319,7 @@ void SemanticTokenSupport::handleSemanticTokensDelta(
|
||||
|
||||
auto it = data.begin();
|
||||
const auto end = data.end();
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "Edit Tokens for " << filePath;
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "Edit Tokens";
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "Data before edit " << data;
|
||||
for (const SemanticTokensEdit &edit : qAsConst(edits)) {
|
||||
if (edit.start() > data.size()) // prevent edits after the previously reported data
|
||||
@@ -346,6 +354,7 @@ void SemanticTokenSupport::handleSemanticTokensDelta(
|
||||
tokens.setResultId(tokensDelta->resultId());
|
||||
} else {
|
||||
m_tokens.remove(filePath);
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "Data cleared";
|
||||
return;
|
||||
}
|
||||
highlight(filePath);
|
||||
@@ -353,6 +362,7 @@ void SemanticTokenSupport::handleSemanticTokensDelta(
|
||||
|
||||
void SemanticTokenSupport::highlight(const Utils::FilePath &filePath, bool force)
|
||||
{
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "highlight" << filePath;
|
||||
TextDocument *doc = TextDocument::textDocumentForFilePath(filePath);
|
||||
if (!doc || LanguageClientManager::clientForDocument(doc) != m_client)
|
||||
return;
|
||||
@@ -363,6 +373,7 @@ void SemanticTokenSupport::highlight(const Utils::FilePath &filePath, bool force
|
||||
const QList<SemanticToken> tokens = versionedTokens.tokens
|
||||
.toTokens(m_tokenTypes, m_tokenModifiers);
|
||||
if (m_tokensHandler) {
|
||||
qCDebug(LOGLSPHIGHLIGHT) << "use tokens handler" << filePath;
|
||||
int line = 1;
|
||||
int column = 1;
|
||||
QList<ExpandedSemanticToken> expandedTokens;
|
||||
|
@@ -50,8 +50,8 @@ static const QHash<QString, QString> &envVarToCMakeVarMapping()
|
||||
{"IMXRT595_FREERTOS_DIR","FREERTOS_DIR"},
|
||||
{"STM32F7_FREERTOS_DIR", "FREERTOS_DIR"},
|
||||
{"eFlashLoad_PATH","eFlashLoad_PATH"},
|
||||
{"RenesasFlashProgrammer_PATH", "RenesasFlashProgrammer_PATH"},
|
||||
{"MCUXpressoIDE_PATH", "MCUXpressoIDE_PATH"},
|
||||
{"RenesasFlashProgrammer_PATH", "RENESAS_FLASH_PROGRAMMER_PATH"},
|
||||
{"MCUXpressoIDE_PATH", "MCUXPRESSO_IDE_PATH"},
|
||||
{"JLINK_PATH", "JLINK_PATH"},
|
||||
{"TVII_GRAPHICS_DRIVER_DIR", "TVII_GRAPHICS_DRIVER_DIR"},
|
||||
{"CYPRESS_AUTO_FLASH_UTILITY_DIR", "CYPRESS_AUTO_FLASH_UTILITY_DIR"},
|
||||
|
@@ -104,8 +104,6 @@ static McuToolChainPackage *createArmGccPackage()
|
||||
defaultPath = subDirs.first();
|
||||
}
|
||||
}
|
||||
if (defaultPath.isEmpty())
|
||||
defaultPath = FileUtils::homePath();
|
||||
|
||||
const QString detectionPath = Utils::HostOsInfo::withExecutableSuffix("bin/arm-none-eabi-g++");
|
||||
const auto versionDetector = new McuPackageExecutableVersionDetector(
|
||||
@@ -129,8 +127,7 @@ static McuToolChainPackage *createGhsToolchainPackage()
|
||||
{
|
||||
const char envVar[] = "GHS_COMPILER_DIR";
|
||||
|
||||
const FilePath defaultPath = qEnvironmentVariableIsSet(envVar)
|
||||
? FilePath::fromUserInput(qEnvironmentVariable(envVar)) : FileUtils::homePath();
|
||||
const FilePath defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||
|
||||
const auto versionDetector = new McuPackageExecutableVersionDetector(
|
||||
Utils::HostOsInfo::withExecutableSuffix("as850"),
|
||||
@@ -153,8 +150,7 @@ static McuToolChainPackage *createGhsArmToolchainPackage()
|
||||
{
|
||||
const char envVar[] = "GHS_ARM_COMPILER_DIR";
|
||||
|
||||
const FilePath defaultPath = qEnvironmentVariableIsSet(envVar)
|
||||
? FilePath::fromUserInput(qEnvironmentVariable(envVar)) : FileUtils::homePath();
|
||||
const FilePath defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||
|
||||
const auto versionDetector = new McuPackageExecutableVersionDetector(
|
||||
Utils::HostOsInfo::withExecutableSuffix("asarm"),
|
||||
@@ -189,8 +185,6 @@ static McuToolChainPackage *createIarToolChainPackage()
|
||||
const FilePath compilerExecPath = tc->compilerCommand();
|
||||
defaultPath = compilerExecPath.parentDir().parentDir();
|
||||
}
|
||||
else
|
||||
defaultPath = FileUtils::homePath();
|
||||
}
|
||||
|
||||
const QString detectionPath = Utils::HostOsInfo::withExecutableSuffix("bin/iccarm");
|
||||
@@ -219,8 +213,9 @@ static McuPackage *createRGLPackage()
|
||||
if (qEnvironmentVariableIsSet(envVar)) {
|
||||
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||
} else if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
defaultPath = FilePath::fromUserInput(QDir::rootPath() + "Renesas_Electronics/D1x_RGL");
|
||||
if (defaultPath.exists()) {
|
||||
const FilePath rglPath = FilePath::fromString(QDir::rootPath()) / "Renesas_Electronics/D1x_RGL";
|
||||
if (rglPath.exists()) {
|
||||
defaultPath = rglPath;
|
||||
const FilePaths subDirs =
|
||||
defaultPath.dirEntries({QLatin1String("rgl_ghs_D1Mx_*")},
|
||||
QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
@@ -240,7 +235,7 @@ static McuPackage *createRGLPackage()
|
||||
|
||||
static McuPackage *createStm32CubeProgrammerPackage()
|
||||
{
|
||||
FilePath defaultPath = FileUtils::homePath();
|
||||
FilePath defaultPath;
|
||||
const QString cubePath = "STMicroelectronics/STM32Cube/STM32CubeProgrammer";
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
const FilePath programPath = findInProgramFiles(cubePath);
|
||||
@@ -272,8 +267,9 @@ static McuPackage *createMcuXpressoIdePackage()
|
||||
if (qEnvironmentVariableIsSet(envVar)) {
|
||||
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||
} else if (HostOsInfo::isWindowsHost()) {
|
||||
defaultPath = FilePath::fromString(QDir::rootPath() + "nxp");
|
||||
if (defaultPath.exists()) {
|
||||
const FilePath programPath = FilePath::fromString(QDir::rootPath()) / "nxp";
|
||||
if (programPath.exists()) {
|
||||
defaultPath = programPath;
|
||||
// If default dir has exactly one sub dir that could be the IDE path, pre-select that.
|
||||
const FilePaths subDirs =
|
||||
defaultPath.dirEntries({QLatin1String("MCUXpressoIDE*")},
|
||||
@@ -282,7 +278,9 @@ static McuPackage *createMcuXpressoIdePackage()
|
||||
defaultPath = subDirs.first();
|
||||
}
|
||||
} else {
|
||||
defaultPath = "/usr/local/mcuxpressoide/";
|
||||
const FilePath programPath = FilePath::fromString("/usr/local/mcuxpressoide/");
|
||||
if (programPath.exists())
|
||||
defaultPath = programPath;
|
||||
}
|
||||
|
||||
auto result = new McuPackage(
|
||||
@@ -303,16 +301,10 @@ static McuPackage *createCypressProgrammerPackage()
|
||||
if (qEnvironmentVariableIsSet(envVar)) {
|
||||
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||
} else if (HostOsInfo::isWindowsHost()) {
|
||||
FilePath candidate = findInProgramFiles("Cypress/Cypress Auto Flash Utility 1.0");
|
||||
if (candidate.exists()) {
|
||||
const FilePath candidate = findInProgramFiles("Cypress/Cypress Auto Flash Utility 1.0");
|
||||
if (candidate.exists())
|
||||
defaultPath = candidate;
|
||||
}
|
||||
} else {
|
||||
defaultPath = "/usr";
|
||||
}
|
||||
|
||||
if (defaultPath.isEmpty())
|
||||
defaultPath = FileUtils::homePath();
|
||||
|
||||
auto result = new McuPackage(
|
||||
"Cypress Auto Flash Utility",
|
||||
@@ -393,7 +385,7 @@ static McuPackage *createBoardSdkPackage(const McuTargetDescription& desc)
|
||||
if (defaultPath.exists())
|
||||
return defaultPath;
|
||||
}
|
||||
return FileUtils::homePath();
|
||||
return FilePath();
|
||||
}();
|
||||
|
||||
const auto versionDetector = generatePackageVersionDetector(desc.boardSdk.envVar);
|
||||
@@ -418,8 +410,6 @@ static McuPackage *createFreeRTOSSourcesPackage(const QString &envVar, const Fil
|
||||
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar.toLatin1()));
|
||||
else if (!boardSdkDir.isEmpty() && !freeRTOSBoardSdkSubDir.isEmpty())
|
||||
defaultPath = boardSdkDir / freeRTOSBoardSdkSubDir;
|
||||
else
|
||||
defaultPath = FileUtils::homePath();
|
||||
|
||||
auto result = new McuPackage(
|
||||
QString::fromLatin1("FreeRTOS Sources (%1)").arg(envVarPrefix),
|
||||
@@ -634,7 +624,7 @@ static QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescrip
|
||||
|
||||
Utils::FilePath kitsPath(const Utils::FilePath &dir)
|
||||
{
|
||||
return dir + "/kits/";
|
||||
return dir / "kits/";
|
||||
}
|
||||
|
||||
static QFileInfoList targetDescriptionFiles(const Utils::FilePath &dir)
|
||||
|
@@ -255,8 +255,10 @@ void DeviceSettingsWidget::testDevice()
|
||||
{
|
||||
const IDevice::ConstPtr &device = currentDevice();
|
||||
QTC_ASSERT(device && device->hasDeviceTester(), return);
|
||||
DeviceTestDialog dlg(m_deviceManager->mutableDevice(device->id()), this);
|
||||
dlg.exec();
|
||||
auto dlg = new DeviceTestDialog(m_deviceManager->mutableDevice(device->id()), this);
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dlg->setModal(true);
|
||||
dlg->show();
|
||||
}
|
||||
|
||||
void DeviceSettingsWidget::handleDeviceUpdated(Id id)
|
||||
|
@@ -521,6 +521,19 @@ void JsonWizardFactory::registerGeneratorFactory(JsonWizardGeneratorFactory *fac
|
||||
s_generatorFactories.append(factory);
|
||||
}
|
||||
|
||||
static QString qmlProjectName(const FilePath &folder)
|
||||
{
|
||||
FilePath currentFolder = folder;
|
||||
while (!currentFolder.isEmpty()) {
|
||||
const QList<FilePath> fileList = currentFolder.dirEntries({"*.qmlproject"});
|
||||
if (!fileList.isEmpty())
|
||||
return fileList.first().baseName();
|
||||
currentFolder = currentFolder.parentDir();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Wizard *JsonWizardFactory::runWizardImpl(const FilePath &path, QWidget *parent,
|
||||
Id platform,
|
||||
const QVariantMap &variables, bool showWizard)
|
||||
@@ -545,6 +558,7 @@ Wizard *JsonWizardFactory::runWizardImpl(const FilePath &path, QWidget *parent,
|
||||
wizard->setValue(i.key(), i.value());
|
||||
|
||||
wizard->setValue(QStringLiteral("InitialPath"), path.toString());
|
||||
wizard->setValue(QStringLiteral("QmlProjectName"), qmlProjectName(path));
|
||||
wizard->setValue(QStringLiteral("Platform"), platform.toString());
|
||||
|
||||
QString kindStr = QLatin1String(Core::Constants::WIZARD_KIND_UNKNOWN);
|
||||
|
@@ -83,9 +83,18 @@ bool Navigation2dFilter::gestureEvent(QGestureEvent *event)
|
||||
bool Navigation2dFilter::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
if (event->modifiers().testFlag(Qt::ControlModifier)) {
|
||||
if (QPointF delta = event->pixelDelta(); !delta.isNull()) {
|
||||
double dist = std::abs(delta.x()) > std::abs(delta.y()) ? -delta.x() : delta.y();
|
||||
emit zoomChanged(dist/200.0, event->position());
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
emit panChanged(QPointF(event->pixelDelta()));
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
} else if (event->source() == Qt::MouseEventNotSynthesized) {
|
||||
|
||||
auto zoomInSignal = QMetaMethod::fromSignal(&Navigation2dFilter::zoomIn);
|
||||
|
@@ -279,7 +279,10 @@ bool DesignDocument::isDocumentLoaded() const
|
||||
|
||||
void DesignDocument::resetToDocumentModel()
|
||||
{
|
||||
plainTextEdit()->document()->clearUndoRedoStacks();
|
||||
const QPlainTextEdit *edit = plainTextEdit();
|
||||
if (edit)
|
||||
edit->document()->clearUndoRedoStacks();
|
||||
|
||||
m_inFileComponentModel.reset();
|
||||
}
|
||||
|
||||
@@ -311,7 +314,9 @@ void DesignDocument::changeToDocumentModel()
|
||||
viewManager().detachRewriterView();
|
||||
viewManager().detachViewsExceptRewriterAndComponetView();
|
||||
|
||||
plainTextEdit()->document()->clearUndoRedoStacks();
|
||||
const QPlainTextEdit *edit = plainTextEdit();
|
||||
if (edit)
|
||||
edit->document()->clearUndoRedoStacks();
|
||||
|
||||
m_inFileComponentModel.reset();
|
||||
m_inFileComponentTextModifier.reset();
|
||||
@@ -348,7 +353,9 @@ void DesignDocument::changeToInFileComponentModel(ComponentTextModifier *textMod
|
||||
viewManager().detachRewriterView();
|
||||
viewManager().detachViewsExceptRewriterAndComponetView();
|
||||
|
||||
plainTextEdit()->document()->clearUndoRedoStacks();
|
||||
const QPlainTextEdit *edit = plainTextEdit();
|
||||
if (edit)
|
||||
edit->document()->clearUndoRedoStacks();
|
||||
|
||||
m_inFileComponentModel.reset(createInFileComponentModel());
|
||||
m_inFileComponentModel->setTextModifier(m_inFileComponentTextModifier.data());
|
||||
|
@@ -102,11 +102,15 @@ bool ItemLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
// For drag to be handled correctly, we must have the component properly imported
|
||||
// beforehand, so we import the module immediately when the drag starts
|
||||
if (!entry.requiredImport().isEmpty()) {
|
||||
Import import = Import::createLibraryImport(entry.requiredImport());
|
||||
if (!m_model->hasImport(import, true, true)) {
|
||||
// We don't know if required import is library of file import, so try both.
|
||||
Import libImport = Import::createLibraryImport(entry.requiredImport());
|
||||
Import fileImport = Import::createFileImport(entry.requiredImport());
|
||||
if (!m_model->hasImport(libImport, true, true)
|
||||
&& !m_model->hasImport(fileImport, true, true)) {
|
||||
const QList<Import> possImports = m_model->possibleImports();
|
||||
for (const auto &possImport : possImports) {
|
||||
if (possImport.url() == import.url()) {
|
||||
if ((!possImport.url().isEmpty() && possImport.url() == libImport.url())
|
||||
|| (!possImport.file().isEmpty() && possImport.file() == fileImport.file())) {
|
||||
m_model->changeImports({possImport}, {});
|
||||
break;
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "navigatorwidget.h"
|
||||
#include "qmldesignerconstants.h"
|
||||
#include "qmldesignericons.h"
|
||||
#include "qmldesignerplugin.h"
|
||||
|
||||
#include "nameitemdelegate.h"
|
||||
#include "iconcheckboxitemdelegate.h"
|
||||
@@ -166,9 +167,14 @@ void NavigatorView::modelAttached(Model *model)
|
||||
const QHash<QString, bool> localExpandMap = m_expandMap[AbstractView::model()->fileUrl()];
|
||||
auto it = localExpandMap.constBegin();
|
||||
while (it != localExpandMap.constEnd()) {
|
||||
const QModelIndex index = indexForModelNode(modelNodeForId(it.key()));
|
||||
const ModelNode node = modelNodeForId(it.key());
|
||||
// When editing subcomponent, the current root node may be marked collapsed in the
|
||||
// full file view, but we never want to actually collapse it, so skip it.
|
||||
if (!node.isRootNode()) {
|
||||
const QModelIndex index = indexForModelNode(node);
|
||||
if (index.isValid())
|
||||
treeWidget()->setExpanded(index, it.value());
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -200,11 +206,18 @@ void NavigatorView::addNodeAndSubModelNodesToList(const ModelNode &node, QList<M
|
||||
|
||||
void NavigatorView::modelAboutToBeDetached(Model *model)
|
||||
{
|
||||
m_expandMap.remove(model->fileUrl());
|
||||
QHash<QString, bool> &localExpandMap = m_expandMap[model->fileUrl()];
|
||||
|
||||
// If detaching full document model, recreate expand map from scratch to remove stale entries.
|
||||
// Otherwise just update it (subcomponent edit case).
|
||||
bool fullUpdate = true;
|
||||
if (DesignDocument *document = QmlDesignerPlugin::instance()->currentDesignDocument())
|
||||
fullUpdate = !document->inFileComponentModelActive();
|
||||
if (fullUpdate)
|
||||
localExpandMap.clear();
|
||||
|
||||
if (currentModel()) {
|
||||
// Store expand state of the navigator tree
|
||||
QHash<QString, bool> localExpandMap;
|
||||
const ModelNode rootNode = rootModelNode();
|
||||
const QModelIndex rootIndex = indexForModelNode(rootNode);
|
||||
|
||||
@@ -215,15 +228,18 @@ void NavigatorView::modelAboutToBeDetached(Model *model)
|
||||
for (int i = 0; i < rowCount; ++i) {
|
||||
const QModelIndex childIndex = currentModel()->index(i, 0, index);
|
||||
const ModelNode node = modelNodeForIndex(childIndex);
|
||||
if (node.isValid()) {
|
||||
// Just store collapsed states as everything is expanded by default
|
||||
if (node.isValid() && !treeWidget()->isExpanded(childIndex))
|
||||
if (!treeWidget()->isExpanded(childIndex))
|
||||
localExpandMap.insert(node.id(), false);
|
||||
else if (!fullUpdate)
|
||||
localExpandMap.remove(node.id());
|
||||
}
|
||||
gatherExpandedState(childIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
gatherExpandedState(rootIndex);
|
||||
m_expandMap[model->fileUrl()] = localExpandMap;
|
||||
}
|
||||
|
||||
AbstractView::modelAboutToBeDetached(model);
|
||||
|
@@ -63,13 +63,14 @@ enum ProjectDirectoryError {
|
||||
NoError = 0,
|
||||
MissingContentDir = 1<<1,
|
||||
MissingImportDir = 1<<2,
|
||||
MissingCppDir = 1<<3,
|
||||
MissingMainCMake = 1<<4,
|
||||
MissingMainQml = 1<<5,
|
||||
MissingAppMainQml = 1<<6,
|
||||
MissingQmlModules = 1<<7,
|
||||
MissingMainCpp = 1<<8,
|
||||
MissingMainCppHeader = 1<<9
|
||||
MissingAssetImportDir = 1<<3,
|
||||
MissingCppDir = 1<<4,
|
||||
MissingMainCMake = 1<<5,
|
||||
MissingMainQml = 1<<6,
|
||||
MissingAppMainQml = 1<<7,
|
||||
MissingQmlModules = 1<<8,
|
||||
MissingMainCpp = 1<<9,
|
||||
MissingMainCppHeader = 1<<10
|
||||
};
|
||||
|
||||
QVector<GeneratableFile> queuedFiles;
|
||||
@@ -131,6 +132,8 @@ int isProjectCorrectlyFormed(const FilePath &rootDir)
|
||||
|
||||
if (!rootDir.pathAppended(DIRNAME_IMPORT).exists())
|
||||
errors |= MissingImportDir;
|
||||
if (!rootDir.pathAppended(DIRNAME_ASSET).exists())
|
||||
errors |= MissingAssetImportDir;
|
||||
|
||||
if (!rootDir.pathAppended(DIRNAME_CPP).exists())
|
||||
errors |= MissingCppDir;
|
||||
@@ -159,7 +162,7 @@ void removeUnconfirmedQueuedFiles(const Utils::FilePaths confirmedFiles)
|
||||
const QString WARNING_MISSING_STRUCTURE_FATAL = QCoreApplication::translate("QmlDesigner::GenerateCmake",
|
||||
"The project is not properly structured for automatically generating CMake files.\n\nAborting process.\n\nThe following files or directories are missing:\n\n%1");
|
||||
const QString WARNING_MISSING_STRUCTURE_NONFATAL = QCoreApplication::translate("QmlDesigner::GenerateCmake",
|
||||
"The project is not properly structured for automatically generating CMake files.\n\nThe following files will be created:\n\n%1");
|
||||
"The project is not properly structured for automatically generating CMake files.\n\nThe following files or directories are missing and may be created:\n\n%1");
|
||||
const QString WARNING_TITLE_FATAL = QCoreApplication::translate("QmlDesigner::GenerateCmake",
|
||||
"Cannot Generate CMake Files");
|
||||
const QString WARNING_TITLE_NONFATAL = QCoreApplication::translate("QmlDesigner::GenerateCmake",
|
||||
@@ -182,6 +185,8 @@ void showProjectDirErrorDialog(int error)
|
||||
if (error & MissingImportDir)
|
||||
fatalList.append(QString(DIRNAME_IMPORT) + "\n");
|
||||
|
||||
if (error & MissingAssetImportDir)
|
||||
nonFatalList.append(QString(DIRNAME_ASSET) + "\n");
|
||||
if (error & MissingMainCMake)
|
||||
nonFatalList.append(QString(FILENAME_CMAKELISTS) + "\n");
|
||||
if (error & MissingQmlModules)
|
||||
@@ -290,16 +295,21 @@ bool generateCmakes(const FilePath &rootDir)
|
||||
{
|
||||
moduleNames.clear();
|
||||
|
||||
FilePath contentDir = rootDir.pathAppended("content");
|
||||
FilePath importDir = rootDir.pathAppended("imports");
|
||||
FilePath contentDir = rootDir.pathAppended(DIRNAME_CONTENT);
|
||||
FilePath importDir = rootDir.pathAppended(DIRNAME_IMPORT);
|
||||
FilePath assetDir = rootDir.pathAppended(DIRNAME_ASSET);
|
||||
|
||||
generateModuleCmake(contentDir);
|
||||
generateImportCmake(importDir);
|
||||
generateImportCmake(assetDir);
|
||||
generateMainCmake(rootDir);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const char DO_NOT_EDIT_FILE_COMMENT[] = "### This file is automatically generated by Qt Design Studio.\n### Do not change\n\n";
|
||||
const char ADD_SUBDIR[] = "add_subdirectory(%1)\n";
|
||||
|
||||
void generateMainCmake(const FilePath &rootDir)
|
||||
{
|
||||
//TODO startupProject() may be a terrible way to try to get "current project". It's not necessarily the same thing at all.
|
||||
@@ -309,27 +319,47 @@ void generateMainCmake(const FilePath &rootDir)
|
||||
QString cmakeFileContent = GenerateCmake::readTemplate(MAIN_CMAKEFILE_TEMPLATE_PATH).arg(appName);
|
||||
queueCmakeFile(rootDir, cmakeFileContent);
|
||||
|
||||
QString subdirIncludes;
|
||||
subdirIncludes.append(QString(ADD_SUBDIR).arg(DIRNAME_CONTENT));
|
||||
subdirIncludes.append(QString(ADD_SUBDIR).arg(DIRNAME_IMPORT));
|
||||
if (rootDir.pathAppended(DIRNAME_ASSET).exists())
|
||||
subdirIncludes.append(QString(ADD_SUBDIR).arg(DIRNAME_ASSET));
|
||||
|
||||
QString modulesAsPlugins;
|
||||
for (const QString &moduleName : moduleNames)
|
||||
modulesAsPlugins.append(" " + moduleName + "plugin\n");
|
||||
|
||||
QString moduleFileContent = GenerateCmake::readTemplate(QMLMODULES_FILE_TEMPLATE_PATH).arg(appName).arg(modulesAsPlugins);
|
||||
QString moduleFileContent = GenerateCmake::readTemplate(QMLMODULES_FILE_TEMPLATE_PATH)
|
||||
.arg(appName)
|
||||
.arg(subdirIncludes)
|
||||
.arg(modulesAsPlugins);
|
||||
|
||||
GenerateCmake::queueFile(rootDir.pathAppended(FILENAME_MODULES), moduleFileContent);
|
||||
}
|
||||
|
||||
const char DO_NOT_EDIT_FILE_COMMENT[] = "### This file is automatically generated by Qt Design Studio.\n### Do not change\n\n";
|
||||
const char ADD_SUBDIR[] = "add_subdirectory(%1)\n";
|
||||
|
||||
void generateImportCmake(const FilePath &dir)
|
||||
void generateImportCmake(const FilePath &dir, const QString &modulePrefix)
|
||||
{
|
||||
if (!dir.exists())
|
||||
return;
|
||||
|
||||
QString fileContent;
|
||||
|
||||
fileContent.append(DO_NOT_EDIT_FILE_COMMENT);
|
||||
|
||||
FilePaths subDirs = dir.dirEntries(DIRS_ONLY);
|
||||
for (FilePath &subDir : subDirs) {
|
||||
if (isDirBlacklisted(subDir))
|
||||
continue;
|
||||
if (getDirectoryTreeQmls(subDir).isEmpty() && getDirectoryTreeResources(subDir).isEmpty())
|
||||
continue;
|
||||
fileContent.append(QString(ADD_SUBDIR).arg(subDir.fileName()));
|
||||
generateModuleCmake(subDir);
|
||||
QString prefix = modulePrefix.isEmpty() ?
|
||||
modulePrefix % subDir.fileName() :
|
||||
QString(modulePrefix + '.') + subDir.fileName();
|
||||
if (getDirectoryQmls(subDir).isEmpty()) {
|
||||
generateImportCmake(subDir, prefix);
|
||||
} else {
|
||||
generateModuleCmake(subDir, prefix);
|
||||
}
|
||||
}
|
||||
|
||||
queueCmakeFile(dir, fileContent);
|
||||
@@ -339,13 +369,12 @@ const char MODULEFILE_PROPERTY_SINGLETON[] = "QT_QML_SINGLETON_TYPE";
|
||||
const char MODULEFILE_PROPERTY_SET[] = "set_source_files_properties(%1\n PROPERTIES\n %2 %3\n)\n\n";
|
||||
const char MODULEFILE_TEMPLATE_PATH[] = ":/boilerplatetemplates/qmlprojectmodulecmakelists.tpl";
|
||||
|
||||
void generateModuleCmake(const FilePath &dir)
|
||||
void generateModuleCmake(const FilePath &dir, const QString &uri)
|
||||
{
|
||||
QString fileTemplate = GenerateCmake::readTemplate(MODULEFILE_TEMPLATE_PATH);
|
||||
const QStringList qmldirFilesOnly(FILENAME_QMLDIR);
|
||||
|
||||
QString singletonContent;
|
||||
FilePaths qmldirFileList = dir.dirEntries(qmldirFilesOnly, FILES_ONLY);
|
||||
FilePaths qmldirFileList = dir.dirEntries(QStringList(FILENAME_QMLDIR), FILES_ONLY);
|
||||
if (!qmldirFileList.isEmpty()) {
|
||||
QStringList singletons = getSingletonsFromQmldirFile(qmldirFileList.first());
|
||||
for (QString &singleton : singletons) {
|
||||
@@ -371,12 +400,14 @@ void generateModuleCmake(const FilePath &dir)
|
||||
moduleContent.append(QString(" RESOURCES\n%1").arg(resourceFiles));
|
||||
}
|
||||
|
||||
QString moduleName = dir.fileName();
|
||||
|
||||
QString moduleUri = uri.isEmpty() ?
|
||||
dir.fileName() :
|
||||
uri;
|
||||
QString moduleName = QString(moduleUri).remove('.');
|
||||
moduleNames.append(moduleName);
|
||||
|
||||
QString fileContent;
|
||||
fileContent.append(fileTemplate.arg(singletonContent).arg(moduleName).arg(moduleContent));
|
||||
fileContent.append(fileTemplate.arg(singletonContent, moduleName, moduleUri, moduleContent));
|
||||
queueCmakeFile(dir, fileContent);
|
||||
}
|
||||
|
||||
@@ -403,6 +434,22 @@ QStringList getSingletonsFromQmldirFile(const FilePath &filePath)
|
||||
return singletons;
|
||||
}
|
||||
|
||||
FilePaths getDirectoryQmls(const FilePath &dir)
|
||||
{
|
||||
const QStringList qmlFilesOnly("*.qml");
|
||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
FilePaths allFiles = dir.dirEntries(qmlFilesOnly, FILES_ONLY);
|
||||
FilePaths moduleFiles;
|
||||
for (FilePath &file : allFiles) {
|
||||
if (!isFileBlacklisted(file.fileName()) &&
|
||||
project->isKnownFile(file)) {
|
||||
moduleFiles.append(file);
|
||||
}
|
||||
}
|
||||
|
||||
return moduleFiles;
|
||||
}
|
||||
|
||||
QStringList getDirectoryTreeQmls(const FilePath &dir)
|
||||
{
|
||||
const QStringList qmlFilesOnly("*.qml");
|
||||
@@ -419,6 +466,8 @@ QStringList getDirectoryTreeQmls(const FilePath &dir)
|
||||
|
||||
FilePaths subDirsList = dir.dirEntries(DIRS_ONLY);
|
||||
for (FilePath &subDir : subDirsList) {
|
||||
if (isDirBlacklisted(subDir))
|
||||
continue;
|
||||
QStringList subDirQmlFiles = getDirectoryTreeQmls(subDir);
|
||||
for (QString &qmlFile : subDirQmlFiles) {
|
||||
qmlFileList.append(subDir.fileName().append('/').append(qmlFile));
|
||||
@@ -444,6 +493,8 @@ QStringList getDirectoryTreeResources(const FilePath &dir)
|
||||
|
||||
FilePaths subDirsList = dir.dirEntries(DIRS_ONLY);
|
||||
for (FilePath &subDir : subDirsList) {
|
||||
if (isDirBlacklisted(subDir))
|
||||
continue;
|
||||
QStringList subDirResources = getDirectoryTreeResources(subDir);
|
||||
for (QString &resource : subDirResources) {
|
||||
resourceFileList.append(subDir.fileName().append('/').append(resource));
|
||||
@@ -466,6 +517,11 @@ bool isFileBlacklisted(const QString &fileName)
|
||||
!fileName.compare(FILENAME_CMAKELISTS));
|
||||
}
|
||||
|
||||
bool isDirBlacklisted(const FilePath &dir)
|
||||
{
|
||||
return (!dir.fileName().compare(DIRNAME_DESIGNER));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace GenerateEntryPoints {
|
||||
|
@@ -54,13 +54,15 @@ QString readTemplate(const QString &templatePath);
|
||||
namespace GenerateCmakeLists {
|
||||
bool generateCmakes(const Utils::FilePath &rootDir);
|
||||
void generateMainCmake(const Utils::FilePath &rootDir);
|
||||
void generateImportCmake(const Utils::FilePath &dir);
|
||||
void generateModuleCmake(const Utils::FilePath &dir);
|
||||
void generateImportCmake(const Utils::FilePath &dir, const QString &modulePrefix = QString());
|
||||
void generateModuleCmake(const Utils::FilePath &dir, const QString &moduleUri = QString());
|
||||
Utils::FilePaths getDirectoryQmls(const Utils::FilePath &dir);
|
||||
QStringList getSingletonsFromQmldirFile(const Utils::FilePath &filePath);
|
||||
QStringList getDirectoryTreeQmls(const Utils::FilePath &dir);
|
||||
QStringList getDirectoryTreeResources(const Utils::FilePath &dir);
|
||||
void queueCmakeFile(const Utils::FilePath &filePath, const QString &content);
|
||||
bool isFileBlacklisted(const QString &fileName);
|
||||
bool isDirBlacklisted(const Utils::FilePath &dir);
|
||||
}
|
||||
namespace GenerateEntryPoints {
|
||||
bool generateEntryPointFiles(const Utils::FilePath &dir);
|
||||
|
@@ -34,7 +34,9 @@ namespace Constants {
|
||||
|
||||
const char DIRNAME_CONTENT[] = "content";
|
||||
const char DIRNAME_IMPORT[] = "imports";
|
||||
const char DIRNAME_ASSET[] = "asset_imports";
|
||||
const char DIRNAME_CPP[] = "src";
|
||||
const char DIRNAME_DESIGNER[] = "designer";
|
||||
|
||||
const char FILENAME_CMAKELISTS[] = "CMakeLists.txt";
|
||||
const char FILENAME_APPMAINQML[] = "App.qml";
|
||||
|