Merge "Merge remote-tracking branch 'origin/11.0'"
BIN
doc/qtcreator/images/extraimages/images/EhJ1eV_6RH8.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/qtcreator/images/extraimages/images/FTSvDmcAgPI.jpg
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
doc/qtcreator/images/extraimages/images/LnVjI0I7cKs.jpg
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/qtcreator/images/extraimages/images/hOx3dod5-1A.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
@@ -1,3 +1,7 @@
|
||||
{HTML.extraimages,qhp.QtCreator.extraFiles} += \
|
||||
images/commercial.png \
|
||||
images/5OiIqFTjUZI.jpg
|
||||
images/5OiIqFTjUZI.jpg \
|
||||
images/EhJ1eV_6RH8.jpg \
|
||||
images/FTSvDmcAgPI.jpg \
|
||||
images/hOx3dod5-1A.jpg \
|
||||
images/LnVjI0I7cKs.jpg
|
||||
|
BIN
doc/qtcreator/images/qtcreator-preferences.webp
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
doc/qtcreator/images/qtcreator-scratch-buffer.webp
Normal file
After Width: | Height: | Size: 2.1 KiB |
@@ -781,6 +781,10 @@
|
||||
the display text might do something wrong. You can step through the code and
|
||||
examine changes to the variable to find out where the error occurs.
|
||||
|
||||
The following video shows how to examine variable values:
|
||||
|
||||
\youtube EhJ1eV_6RH8
|
||||
|
||||
\section1 Showing Tooltips for Simple Values
|
||||
|
||||
To display the value of a simple variable, hover the mouse pointer over its
|
||||
|
36
doc/qtcreator/src/howto/creator-how-to-macos.qdoc
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page creator-how-to-macos.html
|
||||
\if defined(qtcreator)
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\endif
|
||||
\ingroup creator-how-to-ui
|
||||
\ingroup studio-how-to
|
||||
|
||||
\title Find menu items on \macos
|
||||
|
||||
\QC uses standard names and locations for standard features, such as
|
||||
\e preferences. In this manual, the names and locations on
|
||||
Windows and Linux are usually used to keep the instructions short. Here are
|
||||
some places to check if you cannot find a function, dialog, or keyboard
|
||||
shortcut on \macos when following the instructions:
|
||||
|
||||
\table
|
||||
\header
|
||||
\li For
|
||||
\li Look In
|
||||
\row
|
||||
\li \uicontrol Edit > \uicontrol Preferences
|
||||
\li \uicontrol {\QC} > \uicontrol Preferences
|
||||
\row
|
||||
\li \uicontrol Help > \uicontrol {About Plugins}
|
||||
\li \uicontrol {\QC} > \uicontrol {About Plugins}
|
||||
\row
|
||||
\li Keyboard shortcuts
|
||||
\li \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Environment >
|
||||
\uicontrol Keyboard
|
||||
\endtable
|
||||
*/
|
@@ -0,0 +1,38 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page creator-how-to-set-high-dpi-scaling.html
|
||||
\if defined(qtcreator)
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\endif
|
||||
\ingroup creator-how-to-ui
|
||||
\ingroup studio-how-to
|
||||
|
||||
\title Set high DPI scaling
|
||||
|
||||
The operating systems that \QC supports implement high dots-per-inch (DPI)
|
||||
scaling at varying levels. Therefore, \QC handles high DPI scaling
|
||||
differently on different operating systems:
|
||||
|
||||
\list
|
||||
\li On \macos, \QC forces high DPI scaling, which means that it allows
|
||||
Qt to use the system scaling factor as the \QC scaling factor.
|
||||
\li On Windows, if you do not set \l{High DPI}
|
||||
{scaling environment variables}, \QC instructs Qt to detect the
|
||||
scaling factor and use it as the \QC scaling factor.
|
||||
\li On Linux, \QC leaves it to the user to enable high DPI scaling
|
||||
because the process varies so much on different distributions
|
||||
and windowing systems that it cannot be reliably done automatically.
|
||||
\endlist
|
||||
|
||||
To override the default approach and always enable high DPI scaling:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol Edit > \uicontrol Preferences >
|
||||
\uicontrol Environment > \uicontrol Interface.
|
||||
\li Select \uicontrol {Enable high DPI scaling}.
|
||||
\li Restart \QC to have the change take effect.
|
||||
\endlist
|
||||
*/
|
26
doc/qtcreator/src/howto/creator-how-to-switch-ui-themes.qdoc
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page creator-how-to-switch-ui-themes.html
|
||||
\if defined(qtcreator)
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\endif
|
||||
\ingroup creator-how-to-ui
|
||||
\ingroup studio-how-to
|
||||
|
||||
\title Switch UI themes
|
||||
|
||||
Themes enable you to change the appearance of the UI from dark to light,
|
||||
for example.
|
||||
|
||||
To switch themes:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol Edit > \uicontrol Preferences >
|
||||
\uicontrol Environment > \uicontrol Interface.
|
||||
\image qtcreator-preferences-environment-interface.webp {Interface preferences}
|
||||
\li In \uicontrol Theme, select a theme.
|
||||
\endlist
|
||||
*/
|
66
doc/qtcreator/src/howto/creator-how-to-view-images.qdoc
Normal file
@@ -0,0 +1,66 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page creator-how-to-view-images.html
|
||||
\if defined(qtcreator)
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\endif
|
||||
\ingroup creator-how-to-design
|
||||
\ingroup studio-how-to-image-viewer
|
||||
|
||||
\title View images
|
||||
|
||||
\QC opens image files in the image viewer.
|
||||
|
||||
\image qtcreator-image-viewer.png {Image viewer}
|
||||
|
||||
Use the toolbar buttons or \l{Keyboard Shortcuts}{keyboard shortcuts} to:
|
||||
|
||||
\list
|
||||
\li \inlineimage icons/export.png
|
||||
- Export SVG images to pixmaps or copy an image as a data URL, which
|
||||
enables you to include it in web pages as if it were an external
|
||||
resource
|
||||
\li \inlineimage icons/original-size.png
|
||||
- Return images to their original size
|
||||
\li \inlineimage icons/zoom-in.png
|
||||
- Zoom in and out (\inlineimage icons/zoom-out.png
|
||||
)
|
||||
\li \inlineimage icons/run_small.png
|
||||
- Play and pause animated GIF and MNG images
|
||||
\li \inlineimage icons/qtcreator-desktopdevice-button.png
|
||||
- Show and hide the image background
|
||||
\li \inlineimage icons/switch-outline.png
|
||||
- Show and hide the image outline
|
||||
\li \inlineimage icons/fittoview.png
|
||||
- Fit images to screen
|
||||
\endlist
|
||||
|
||||
Select \uicontrol {Set as Default} to use the current settings for the
|
||||
background and outline modes and fitting images to screen as default
|
||||
values for the image viewer.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page creator-how-to-export-svg-images.html
|
||||
\if defined(qtcreator)
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\endif
|
||||
\ingroup creator-how-to-design
|
||||
\ingroup studio-how-to-image-viewer
|
||||
|
||||
\title Export SVG images
|
||||
|
||||
If you have a freely scalable icon in the SVG format, you can open it in the
|
||||
\l{View images}{image viewer} to export it to several images of different
|
||||
sizes to create a set of pixmaps.
|
||||
|
||||
Select \inlineimage icons/export.png
|
||||
on the toolbar.
|
||||
|
||||
You can then use QIcon::addPixmap() to add the pixmaps to icons in
|
||||
different modes and states.
|
||||
*/
|
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\page creator-how-to-find-settings-files.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-use
|
||||
|
||||
\title Find settings files
|
||||
|
||||
\QC creates the following files and directories:
|
||||
|
||||
\list
|
||||
\li QtCreator.db
|
||||
\li QtCreator.ini
|
||||
\li qtversion.xml
|
||||
\li qtcreator
|
||||
\endlist
|
||||
|
||||
The location of the above files and directories depends on the platform:
|
||||
|
||||
\list
|
||||
\li On Linux and other Unix platforms, look in
|
||||
\c {~/.config/QtProject} and
|
||||
\c {~/.local/share/data/QtProject/qtcreator}.
|
||||
\li On \macos, look in \c {~/.config/QtProject} and
|
||||
\c {~/Library/Application Support/QtProject/Qt Creator}.
|
||||
\li On Windows, look in
|
||||
\c {%appdata%\QtProject} and \c {%localappdata%\QtProject}.
|
||||
\endlist
|
||||
*/
|
@@ -12,35 +12,70 @@
|
||||
\page creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
|
||||
\title How-tos
|
||||
\title How-to
|
||||
|
||||
How do I:
|
||||
The following topics describe how to use \QC to perform a particular task.
|
||||
|
||||
\section1 Use the UI
|
||||
|
||||
\list
|
||||
\li \l {Switch between modes}
|
||||
\li \l {Move between open files}
|
||||
\li \l {Switch to Edit mode}
|
||||
\li \l {Find a specific setting}
|
||||
\li \l {View output}
|
||||
\li \l {Find keyboard shortcuts}
|
||||
\li \l {Run \QC from the command line}
|
||||
\li \l {Show and hide sidebars}
|
||||
\li \l {Move to symbols}
|
||||
\li \l {Quickly locate files using the keyboard}
|
||||
\li \l {Perform calculations}
|
||||
\li \l {Jump to a function in QML code}
|
||||
\li \l {Add a license header template for C++ code}
|
||||
\li \l {Paste text from my clipboard history}
|
||||
\li \l {Sort lines alphabetically}
|
||||
\li \l {Enclose selected code in curly braces, parentheses, or double quotes}
|
||||
\li \l {Select the enclosing block in C++}
|
||||
\li \l {Add my own code snippets to the auto-complete menu}
|
||||
\li \l {Quickly write down notes somewhere}
|
||||
\li \l {Configure the amount of recent files shown}
|
||||
\li \l {Search and replace across files using a regular expression}
|
||||
\li \l {Find a particular preference}
|
||||
\li \l {Find keyboard shortcuts}
|
||||
\li \l {Find menu items on \macos}
|
||||
\li \l {Set high DPI scaling}
|
||||
\li \l {Set the number of recent files shown}
|
||||
\li \l {Show and hide sidebars}
|
||||
\li \l {Switch between modes}
|
||||
\li \l {Switch UI themes}
|
||||
\li \l {View output}
|
||||
\endlist
|
||||
|
||||
\section1 Switch between modes
|
||||
\section1 Edit Code
|
||||
|
||||
\list
|
||||
\li \l {Add code snippets to the auto-complete menu}
|
||||
\li \l {Enclose selected code in curly braces, parentheses, or double quotes}
|
||||
\li \l {Jump to a function in QML code}
|
||||
\li \l {Locate files using the keyboard}
|
||||
\li \l {Move between open files}
|
||||
\li \l {Move to symbols}
|
||||
\li \l {Paste text from clipboard history}
|
||||
\li \l {Perform calculations}
|
||||
\li \l {Search and replace across files using a regular expression}
|
||||
\li \l {Select the enclosing block in C++}
|
||||
\li \l {Sort lines alphabetically}
|
||||
\li \l {Switch to Edit mode}
|
||||
\li \l {Write down notes}
|
||||
\endlist
|
||||
|
||||
\section1 Design UIs
|
||||
|
||||
\list
|
||||
\li \l {Export SVG images}
|
||||
\li \l {View images}
|
||||
\endlist
|
||||
|
||||
\section1 Manage Projects
|
||||
|
||||
\list
|
||||
\li \l {Add a license header template for C++ code}
|
||||
\endlist
|
||||
|
||||
\section1 Use \QC
|
||||
|
||||
\list
|
||||
\li \l {Find settings files}
|
||||
\li \l {Run \QC from the command line}
|
||||
\endlist
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page creator-how-to-switch-between-modes.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-ui
|
||||
|
||||
\title Switch between modes
|
||||
|
||||
\QC uses different modes for different purposes. You can quickly
|
||||
switch between these modes with the following keyboard shortcuts:
|
||||
@@ -57,8 +92,15 @@
|
||||
\endlist
|
||||
|
||||
For more information about \QC modes, see \l {Selecting Modes}.
|
||||
*/
|
||||
|
||||
\section1 Move between open files
|
||||
/*!
|
||||
\page creator-how-to-move-between-open-files.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Move between open files
|
||||
|
||||
To quickly move between currently open files, press
|
||||
\key Ctrl+Tab.
|
||||
@@ -68,8 +110,15 @@
|
||||
(\key {Cmd+Opt+Left} on \macos). For example, if you use the \uicontrol Locator
|
||||
to jump to a symbol in the same file, you can jump back to your original
|
||||
location in that file by pressing \key {Alt+Left}.
|
||||
*/
|
||||
|
||||
\section1 Switch to Edit mode
|
||||
/*!
|
||||
\page creator-how-to-switch-to-edit-mode.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Switch to Edit mode
|
||||
|
||||
To move to the \uicontrol Edit mode and currently active file, press
|
||||
\key Esc.
|
||||
@@ -83,13 +132,29 @@
|
||||
\li The second press closes secondary windows
|
||||
|
||||
\endlist
|
||||
*/
|
||||
|
||||
\section1 Find a specific setting
|
||||
/*!
|
||||
\page creator-how-to-find-preferences.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-ui
|
||||
|
||||
To find specific settings in \uicontrol Edit > \uicontrol Preferences,
|
||||
\title Find a particular preference
|
||||
|
||||
To find a particular preference in \uicontrol Edit > \uicontrol Preferences,
|
||||
use the filter located at the top left of the \uicontrol Preferences dialog.
|
||||
|
||||
\section1 View output
|
||||
\image qtcreator-preferences.webp {Filtering preferences}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page creator-how-to-view-output.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-ui
|
||||
|
||||
\title View output
|
||||
|
||||
The \l{Viewing Output}{taskbar} shows output from
|
||||
several sources, such as a list of errors and warnings encountered during
|
||||
@@ -113,8 +178,15 @@
|
||||
\endlist
|
||||
|
||||
For additional ways to view other types of output, see \l{Viewing Output}.
|
||||
*/
|
||||
|
||||
\section1 Find keyboard shortcuts
|
||||
/*!
|
||||
\page creator-how-to-find-keyboard-shortcuts.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-ui
|
||||
|
||||
\title Find keyboard shortcuts
|
||||
|
||||
\QC has \l{Keyboard Shortcuts}{many useful keyboard shortcuts}.
|
||||
You can see the keyboard shortcut for a menu command in the menu
|
||||
@@ -124,8 +196,15 @@
|
||||
\uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard.
|
||||
|
||||
\image qtcreator-keyboard-shortcuts.png "Keyboard preferences"
|
||||
*/
|
||||
|
||||
\section1 Run \QC from the command line
|
||||
/*!
|
||||
\page creator-how-to-run-from-cli.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-use
|
||||
|
||||
\title Run \QC from the command line
|
||||
|
||||
You can launch \QC from the command line using the name of an
|
||||
existing \l{Managing Sessions}{session} or project file by entering
|
||||
@@ -135,8 +214,15 @@
|
||||
loads the session called \e somesession.
|
||||
|
||||
For more information, see \l{Using Command Line Options}.
|
||||
*/
|
||||
|
||||
\section1 Show and hide sidebars
|
||||
/*!
|
||||
\page creator-how-to-show-and-hide-sidebars.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-ui
|
||||
|
||||
\title Show and hide sidebars
|
||||
|
||||
You can toggle the left and right sidebar in some \QC modes.
|
||||
|
||||
@@ -150,8 +236,15 @@
|
||||
|
||||
For more information on using the sidebars, see
|
||||
\l {Browsing Project Contents}.
|
||||
*/
|
||||
|
||||
\section1 Move to symbols
|
||||
/*!
|
||||
\page creator-how-to-move-to-symbols.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Move to symbols
|
||||
|
||||
To move straight to a symbol used in a project, select the symbol in the
|
||||
\uicontrol Editor toolbar drop-down menu. For more information on the editor
|
||||
@@ -166,8 +259,15 @@
|
||||
the definition or the declaration of the symbol. You can also move the
|
||||
cursor on the symbol and press \key {F2}. For more information, see
|
||||
\l{Moving to Symbol Definition or Declaration}.
|
||||
*/
|
||||
|
||||
\section1 Quickly locate files using the keyboard
|
||||
/*!
|
||||
\page creator-how-to-locate-files-using-keyboard.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Locate files using the keyboard
|
||||
|
||||
Use the \uicontrol Locator to browse
|
||||
through projects, files, classes, functions, documentation, and file systems.
|
||||
@@ -184,8 +284,15 @@
|
||||
\image qtcreator-locator-customize.webp "Locator preferences"
|
||||
|
||||
For more information, see \l{Creating Locator Filters}.
|
||||
*/
|
||||
|
||||
\section1 Perform calculations
|
||||
/*!
|
||||
\page creator-how-to-perform-calculations.html
|
||||
\previouspage creator-how-to-move-between-open-files.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Perform calculations
|
||||
|
||||
Open the \uicontrol Locator with \key {Ctrl+K} and type =, followed by a space.
|
||||
You can now do basic calculations, with options to copy the results to the clipboard
|
||||
@@ -194,13 +301,27 @@
|
||||
\image qtcreator-locator.webp "List of locator filters"
|
||||
|
||||
For more information, see \l{Executing JavaScript}.
|
||||
*/
|
||||
|
||||
\section1 Jump to a function in QML code
|
||||
/*!
|
||||
\page creator-how-to-jump-to-functions-in-qml-code.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Jump to a function in QML code
|
||||
|
||||
Open the \uicontrol Locator with \key {Ctrl+K} and type m, followed by a space.
|
||||
You can now go directly to any QML method in the file.
|
||||
*/
|
||||
|
||||
\section1 Add a license header template for C++ code
|
||||
/*!
|
||||
\page creator-how-to-add-license-header-templates.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-projects
|
||||
|
||||
\title Add a license header template for C++ code
|
||||
|
||||
Specify a file that has a license header for C++ in \uicontrol Edit >
|
||||
\uicontrol Preferences > \uicontrol C++ > \uicontrol {File Naming} >
|
||||
@@ -223,20 +344,41 @@
|
||||
\li \c %$VARIABLE%: Contents of environment variable \c{VARIABLE}.
|
||||
|
||||
\endlist
|
||||
*/
|
||||
|
||||
\section1 Paste text from my clipboard history
|
||||
/*!
|
||||
\page creator-how-to-paste-text-from-clipboard-history.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Paste text from clipboard history
|
||||
|
||||
\QC stores copied text in clipboard history. To retrieve clips from the
|
||||
history, press \key {Ctrl+Shift+V} until the clip appears.
|
||||
The number of clips in the history is fixed to 10.
|
||||
*/
|
||||
|
||||
\section1 Sort lines alphabetically
|
||||
/*!
|
||||
\page creator-how-to-sort-lines-alphabetically.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Sort lines alphabetically
|
||||
|
||||
To sort selected lines alphabetically, select \uicontrol Edit >
|
||||
\uicontrol Advanced > \uicontrol {Sort Selected Lines} or press
|
||||
\key {Alt+Shift+S} (or \key Ctrl+Shift+S on \macos).
|
||||
*/
|
||||
|
||||
\section1 Enclose selected code in curly braces, parentheses, or double quotes
|
||||
/*!
|
||||
\page creator-enclose-code-in-characters.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Enclose selected code in curly braces, parentheses, or double quotes
|
||||
|
||||
When you have selected code and enter one of the following opening
|
||||
characters, the matching closing character is added automatically
|
||||
@@ -253,45 +395,87 @@
|
||||
\uicontrol {Text Editor} > \uicontrol Completion.
|
||||
|
||||
\image qtcreator-options-texteditor-completion.png "Completion preferences"
|
||||
*/
|
||||
|
||||
\section1 Select the enclosing block in C++
|
||||
/*!
|
||||
\page creator-how-to-select-enclosing-block.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Select the enclosing block in C++
|
||||
|
||||
Press \key {Ctrl+U}.
|
||||
*/
|
||||
|
||||
\section1 Add my own code snippets to the auto-complete menu
|
||||
/*!
|
||||
\page creator-how-to-add-code-snippets.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
You can add, modify, and remove snippets in the snippet editor.
|
||||
\title Add code snippets to the auto-complete menu
|
||||
|
||||
Add, modify, and remove snippets in the snippet editor.
|
||||
To open the editor, select \uicontrol Edit > \uicontrol Preferences
|
||||
> \uicontrol {Text Editor} > \uicontrol Snippets.
|
||||
|
||||
\image qtcreator-snippet-modifiers.png "Snippets preferences"
|
||||
|
||||
For more information, see \l {Adding and Editing Snippets}.
|
||||
*/
|
||||
|
||||
\section1 Quickly write down notes somewhere
|
||||
/*!
|
||||
\page creator-how-to-write-notes.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol General > \uicontrol {Scratch Buffer}.
|
||||
Alternatively, \key {Ctrl+N} can be used to open this dialog, which is
|
||||
fully navigable via keyboard by using the up and down arrow keys and the
|
||||
tab key.
|
||||
\title Write down notes
|
||||
|
||||
This creates a new empty text file and saves it to the temporary directory
|
||||
on your machine. You can use it to write down notes without having to worry
|
||||
about deleting the file afterwards. The operating system will eventually
|
||||
remove the file automatically. If you want to keep the file, you can easily
|
||||
save it as a new file somewhere else. If you accidentally close the file,
|
||||
you can find it in the \uicontrol File > \uicontrol {Recent Files} menu.
|
||||
To write down notes without having to worry about deleting the file
|
||||
later, create a new empty text file and save it to a temporary directory
|
||||
on your machine.
|
||||
|
||||
\section1 Configure the amount of recent files shown
|
||||
\image qtcreator-scratch-buffer.webp {Scratch file open in the text editor}
|
||||
|
||||
To create a scratch file and open it in the text editor:
|
||||
|
||||
\list
|
||||
\li Select \uicontrol File > \uicontrol {New File} > \uicontrol General >
|
||||
\uicontrol {Scratch Buffer}.
|
||||
\li Press \key {Ctrl+N}.
|
||||
\endlist
|
||||
|
||||
Use the up and down arrow keys and the tab key to navigate in the editor.
|
||||
|
||||
The operating system will eventually remove the file automatically. To keep
|
||||
the file, save it as a new file somewhere else. If you accidentally close the
|
||||
file, find it in \uicontrol File > \uicontrol {Recent Files}.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page creator-how-to-set-recent-files.html
|
||||
\previouspage creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-ui
|
||||
|
||||
\title Set the number of recent files shown
|
||||
|
||||
Set the value of \uicontrol Edit > \uicontrol Preferences >
|
||||
\uicontrol Environment > \uicontrol System
|
||||
> \uicontrol {Maximum number of entries in "Recent Files"}.
|
||||
|
||||
\image qtcreator-options-environment-system.png "System preferences"
|
||||
*/
|
||||
|
||||
\section1 Search and replace across files using a regular expression
|
||||
/*!
|
||||
\page creator-how-to-search-and-replace-using-regexp.html
|
||||
\previouspage creator-how-to-move-between-open-files.html
|
||||
\nextpage creator-known-issues.html
|
||||
\ingroup creator-how-to-edit
|
||||
|
||||
\title Search and replace across files using a regular expression
|
||||
|
||||
As an example, say you want to replace equality checks (\c {foo == bar})
|
||||
with a function (\c {foo.equals(bar)}):
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
This section has answers to some frequently asked questions about \QC.
|
||||
You might also find answers to your questions in the
|
||||
\l{Known Issues} and \l{How-tos} sections, or the Troubleshooting
|
||||
\l{Known Issues} and \l{How-to} sections, or the Troubleshooting
|
||||
sections for a special area, such as
|
||||
\l{Troubleshooting Debugger}{debugging}.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
Remove the settings files created by \QC.
|
||||
|
||||
For more information about where the files are located on each supported
|
||||
platform, see \l {Location of Settings Files}.
|
||||
platform, see \l {Find settings files}.
|
||||
|
||||
\b {\QC comes with \MinGW, should I use this version with Qt?}
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
Has answers to some frequently asked questions about \QC.
|
||||
|
||||
\li \l{How-tos}
|
||||
\li \l{How-to}
|
||||
|
||||
Lists useful \QC features.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
// **********************************************************************
|
||||
@@ -80,21 +80,18 @@
|
||||
For more information, see \l{Building and Running}.
|
||||
\li \b {\l{Testing}}
|
||||
|
||||
\QC integrates several external native debuggers: GNU
|
||||
Symbolic Debugger (GDB), Microsoft Console Debugger (CDB), and
|
||||
internal JavaScript debugger. In the \uicontrol Debug mode, you
|
||||
can inspect the state of your application while debugging.
|
||||
\QC integrates several external native debuggers that you can use
|
||||
to inspect the state of your application while debugging.
|
||||
|
||||
Devices have limited memory and CPU power, so
|
||||
you should use them carefully. \QC integrates Valgrind code
|
||||
analysis tools for detecting memory leaks and profiling function
|
||||
execution. In addition, the QML Profiler enables you to profile
|
||||
Qt Quick applications.
|
||||
Devices have limited memory and CPU power, so you should use them
|
||||
carefully. \QC integrates code analysis tools for detecting
|
||||
memory leaks, profiling function execution, analyzing CPU use,
|
||||
and eliminating unnecessary complexity of code. Other tools
|
||||
provide code coverage and visualize trace events.
|
||||
|
||||
\QC integrates the \l{Qt Test}, Boost.Test, Catch 2 test,
|
||||
and Google C++ Testing frameworks for unit testing applications
|
||||
and libraries. You can use \QC to create, build, and run
|
||||
autotests.
|
||||
\QC integrates several testing frameworks for unit testing
|
||||
applications and libraries. You can use \QC to create, build,
|
||||
and run autotests.
|
||||
|
||||
For more information, see \l{Testing}.
|
||||
\li \b {Publishing}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2019 The Qt Company Ltd.
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
// **********************************************************************
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
\li \l{Analyzing Code}
|
||||
|
||||
\QC integrates Valgrind code analysis tools for detecting memory
|
||||
leaks and profiling function execution. You must download and
|
||||
install them separately to use them from \QC. The QML Profiler is
|
||||
installed as part of \QC. It enables you to profile your Qt Quick
|
||||
applications.
|
||||
Use tools for analyzing C++ and QML code to identify issues in
|
||||
memory management, CPU usage, coding constructs, and so on. You
|
||||
must install and configure the tools on your system to use them
|
||||
from \QC. However, the QML Profiler is installed as part of \QC
|
||||
for profiling Qt Quick applications.
|
||||
|
||||
\li \l{Running Autotests}
|
||||
|
||||
|
@@ -123,6 +123,10 @@
|
||||
|
||||
\endtable
|
||||
|
||||
The following video shows how to create a Qt Widgets application project:
|
||||
|
||||
\youtube FTSvDmcAgPI
|
||||
|
||||
For examples of creating different types of projects, see
|
||||
\l{Tutorials}.
|
||||
|
||||
|
@@ -255,7 +255,7 @@
|
||||
\list
|
||||
\li \l{Using the Help Mode}
|
||||
\li \l{FAQ}
|
||||
\li \l{How-tos}
|
||||
\li \l{How-to}
|
||||
\li \l{Known Issues}
|
||||
\li \l{Glossary}
|
||||
\li \l{Technical Support}
|
||||
|
@@ -103,7 +103,7 @@
|
||||
\list
|
||||
\li \l{Using the Help Mode}
|
||||
\li \l{FAQ}
|
||||
\li \l{How-tos}
|
||||
\li \l{How-to}
|
||||
\li \l{Known Issues}
|
||||
\li \l{Glossary}
|
||||
\endlist
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
// **********************************************************************
|
||||
@@ -18,102 +18,85 @@
|
||||
|
||||
\title User Interface
|
||||
|
||||
When you start \QC, it opens to the \uicontrol Welcome mode, where you can:
|
||||
|
||||
\list
|
||||
\if defined(qtcreator)
|
||||
\li Open recent sessions
|
||||
\endif
|
||||
|
||||
\li Open recent projects
|
||||
|
||||
\li Create and open projects
|
||||
|
||||
\li Open tutorials and example projects
|
||||
|
||||
\if defined(qtcreator)
|
||||
\li Browse Qt extensions in the \l{https://marketplace.qt.io/}
|
||||
{Qt Marketplace}
|
||||
\li Download the Qt Installer
|
||||
\endif
|
||||
|
||||
\li Read news from the online community and Qt blogs
|
||||
|
||||
\li Create or manage a Qt Account
|
||||
|
||||
\endlist
|
||||
|
||||
\if defined(qtcreator)
|
||||
\image qtcreator-breakdown.png
|
||||
\else
|
||||
\image studio-welcome-mode.png
|
||||
\endif
|
||||
When you start \QC, it opens to the \uicontrol Welcome mode.
|
||||
|
||||
\if defined(qtcreator)
|
||||
Do you want to perform a particular task, such as designing the UI,
|
||||
writing code, or debugging the application? Select the appropriate mode in
|
||||
the \l{Selecting Modes}{mode selector} (1).
|
||||
\image qtcreator-breakdown.png {Welcome mode}
|
||||
|
||||
Are you ready to build the application for particular hardware or (5)
|
||||
run (3) or debug (4) it on a device? Use the kit selector (2) to select
|
||||
the appropriate \l{glossary-buildandrun-kit}{kit}. The task bar (7)
|
||||
displays output from these actions.
|
||||
\table
|
||||
\header
|
||||
\li Number
|
||||
\li UI Control
|
||||
\li Purpose
|
||||
\li Read More
|
||||
\row
|
||||
\li \inlineimage numbers/01.png
|
||||
\li Mode selector
|
||||
\li Perform a particular task, such as designing the UI, writing code, or
|
||||
debugging the application.
|
||||
\li \l{Selecting Modes}
|
||||
\row
|
||||
\li \inlineimage numbers/02.png
|
||||
\li Kit selector
|
||||
\li Select the appropriate \l{glossary-buildandrun-kit}{kit} for building
|
||||
the project and running it on particular hardware.
|
||||
\li \l{Activating Kits for a Project}
|
||||
\row
|
||||
\li \inlineimage numbers/03.png
|
||||
\li Run button
|
||||
\li Run the application on the selected target platform.
|
||||
\li \l{Running on Multiple Platforms}
|
||||
\row
|
||||
\li \inlineimage numbers/04.png
|
||||
\li Debug button
|
||||
\li Debug the application on the selected target platform.
|
||||
\li \l{Debugging}
|
||||
\row
|
||||
\li \inlineimage numbers/05.png
|
||||
\li Build button
|
||||
\li Build the application using the selected kit.
|
||||
\li \l{Building for Multiple Platforms}
|
||||
\row
|
||||
\li \inlineimage numbers/06.png
|
||||
\li Locator
|
||||
\li Find a particular project, file, class, or function.
|
||||
\li \l{Searching with the Locator}
|
||||
\row
|
||||
\li \inlineimage numbers/07.png
|
||||
\li Output
|
||||
\li View output from building, running, and other actions.
|
||||
\li \l{Viewing Output}
|
||||
\endtable
|
||||
|
||||
Are you looking for a particular project, file, class, or function?
|
||||
Start typing its name in the \l{Searching with the Locator}{locator} (6).
|
||||
|
||||
To see where the above controls are in the user interface, select
|
||||
To see where the above controls are in the UI, select
|
||||
\uicontrol Help > \uicontrol {UI Tour}.
|
||||
|
||||
The following sections describe some \QC controls in more detail:
|
||||
The following video shows the parts of the UI and the \uicontrol Welcome
|
||||
mode:
|
||||
|
||||
\list
|
||||
\li \l{Selecting Modes}{Mode selector}
|
||||
\li \l{Working with Sidebars}{Sidebars}
|
||||
\li \l{Browsing Project Contents}{Views}
|
||||
\li \l{Viewing Output}{Output}
|
||||
\endlist
|
||||
|
||||
\else
|
||||
You can use the \l{Selecting Modes}{mode selector} to switch to the
|
||||
\l{Design Views}{Design mode} (1), where you will do
|
||||
most of your work and the \l{Using the Help Mode}{Help} (2) mode, where
|
||||
you can read the product documentation. The other modes are for more
|
||||
advanced use, and you are likely to need them less often.
|
||||
|
||||
Below the mode selector, you can find shortcuts to some more advanced
|
||||
functions, such as running the application or finding problems in the
|
||||
QML code by debugging or profiling it.
|
||||
\endif
|
||||
\youtube hOx3dod5-1A
|
||||
|
||||
\section1 What's New?
|
||||
|
||||
For information about new features and bug fixes in each \QC release,
|
||||
select \uicontrol Help > \uicontrol {Change Log}.
|
||||
|
||||
\section1 For \macos Users
|
||||
\sa {Working with Sidebars}, {Browsing Project Contents}
|
||||
\sa {Use the UI}{How-to: Use the UI}
|
||||
\else
|
||||
When you start \QC, it opens to the \uicontrol Welcome mode, where you can:
|
||||
|
||||
\QC uses standard names and locations for standard features, such as
|
||||
\e preferences. In this manual, the names and locations on
|
||||
Windows and Linux are usually used to keep the instructions short. Here are
|
||||
some places to check if you cannot find a function, dialog, or keyboard
|
||||
shortcut on \macos when following the instructions:
|
||||
\list
|
||||
\li Open recent projects
|
||||
\li Create and open projects
|
||||
\li Open tutorials and example projects
|
||||
\li Read news from the online community and Qt blogs
|
||||
\li Create or manage a Qt Account
|
||||
\endlist
|
||||
|
||||
\table
|
||||
\header
|
||||
\li For
|
||||
\li Look In
|
||||
\row
|
||||
\li \uicontrol Edit > \uicontrol Preferences
|
||||
\li \uicontrol {\QC} > \uicontrol Preferences
|
||||
\row
|
||||
\li \uicontrol Help > \uicontrol {About Plugins}
|
||||
\li \uicontrol {\QC} > \uicontrol {About Plugins}
|
||||
\row
|
||||
\li Keyboard shortcuts
|
||||
\li \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Environment >
|
||||
\uicontrol Keyboard
|
||||
\endtable
|
||||
\image studio-welcome-mode.webp {Welcome mode}
|
||||
|
||||
\endif
|
||||
|
||||
\if defined(qtdesignstudio)
|
||||
\section1 Customizing the Menu
|
||||
@@ -134,143 +117,26 @@
|
||||
|
||||
You need to restart \QDS to apply changes made to these settings.
|
||||
|
||||
\endif
|
||||
\section1 Customizing the UI
|
||||
|
||||
\section1 Switching UI Themes
|
||||
|
||||
Themes enable you to change the appearance of the UI from dark to light,
|
||||
for example. To switch themes, select \uicontrol Edit > \uicontrol Preferences
|
||||
> \uicontrol Environment, and then select a theme in the \uicontrol Theme
|
||||
field.
|
||||
|
||||
\image qtcreator-preferences-environment-interface.webp {Interface preferences}
|
||||
|
||||
\section1 Changing Languages
|
||||
|
||||
\QC has several language versions. If the system language
|
||||
is one of the supported languages, \QC selects it automatically. To
|
||||
change the language, select \uicontrol Edit > \uicontrol Preferences >
|
||||
\uicontrol Environment and select a language in the \uicontrol Language
|
||||
field. Select \uicontrol {Restart Now} to restart \QC and have the change
|
||||
take effect.
|
||||
|
||||
\section1 High DPI Scaling
|
||||
|
||||
The operating systems that \QC supports implement high dots-per-inch (DPI)
|
||||
scaling at varying levels. Therefore, \QC handles high DPI scaling
|
||||
differently on different operating systems:
|
||||
The following topics describe how to customize the UI:
|
||||
|
||||
\list
|
||||
\li On \macos, \QC forces high DPI scaling, which means that it allows
|
||||
Qt to use the system scaling factor as the \QC scaling factor.
|
||||
\li On Windows, if you do not set \l{High DPI}
|
||||
{scaling environment variables}, \QC instructs Qt to detect the
|
||||
scaling factor and use it as the \QC scaling factor.
|
||||
\li On Linux, \QC leaves it to the user to enable high DPI scaling
|
||||
because the process varies so much on different distributions
|
||||
and windowing systems that it cannot be reliably done automatically.
|
||||
\li \l {Find menu items on \macos}
|
||||
\li \l {Set high DPI scaling}
|
||||
\li \l {Switch UI themes}
|
||||
\endlist
|
||||
|
||||
To override the default approach and always enable high-DPI scaling, select
|
||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol Environment >
|
||||
\uicontrol {Enable high DPI scaling}. The changes will take effect after you
|
||||
restart \QC.
|
||||
|
||||
\section1 Navigating with Keyboard
|
||||
|
||||
\QC caters not only to those users who like to use the mouse, but also
|
||||
to those who are more comfortable with the keyboard. A wide range of
|
||||
\l{keyboard-shortcuts}{keyboard} and \l{Searching with the Locator}
|
||||
{navigation} shortcuts are available to help you work faster.
|
||||
|
||||
\if defined(qtcreator)
|
||||
\section1 Useful Features
|
||||
|
||||
For a list of useful \QC features described in other parts of the
|
||||
documentation, see \l{How-tos}.
|
||||
\endif
|
||||
|
||||
\section1 Viewing Images
|
||||
|
||||
\QC opens image files in the image viewer.
|
||||
The following topics describe how to use the image viewer:
|
||||
|
||||
\image qtcreator-image-viewer.png "Image viewer"
|
||||
|
||||
Use the toolbar buttons or \l{Keyboard Shortcuts}{keyboard shortcuts} to:
|
||||
|
||||
\list
|
||||
\li \inlineimage icons/export.png
|
||||
- Export SVG images to pixmaps or copy an image as a data URL, which
|
||||
enables you to include it in web pages as if it were an external
|
||||
resource
|
||||
\li \inlineimage icons/original-size.png
|
||||
- Return images to their original size
|
||||
\li \inlineimage icons/zoom-in.png
|
||||
- Zoom in and out (\inlineimage icons/zoom-out.png
|
||||
)
|
||||
\li \inlineimage icons/run_small.png
|
||||
- Play and pause animated GIF and MNG images
|
||||
\li \inlineimage icons/qtcreator-desktopdevice-button.png
|
||||
- Show and hide the image background
|
||||
\li \inlineimage icons/switch-outline.png
|
||||
- Show and hide the image outline
|
||||
\li \inlineimage icons/fittoview.png
|
||||
- Fit images to screen
|
||||
\list
|
||||
\li \l {Export SVG images}
|
||||
\li \l {View images}
|
||||
\endlist
|
||||
|
||||
Select \uicontrol {Set as Default} to use the current settings for the
|
||||
background and outline modes and fitting images to screen as default
|
||||
values for the image viewer.
|
||||
|
||||
\section2 Exporting SVG Images
|
||||
|
||||
If you have a freely scalable icon in the SVG format,
|
||||
you can export it to several images of different sizes to create a set of
|
||||
pixmaps.
|
||||
\if defined(qtcreator)
|
||||
You can then use QIcon::addPixmap() to add the pixmaps to icons in
|
||||
different modes and states.
|
||||
\endif
|
||||
|
||||
\if defined(qtcreator)
|
||||
\section1 Location of Settings Files
|
||||
|
||||
\QC creates the following files and directories:
|
||||
|
||||
\list
|
||||
|
||||
\li QtCreator.db
|
||||
|
||||
\li QtCreator.ini
|
||||
|
||||
\li qtversion.xml
|
||||
|
||||
\li toolChains.xml
|
||||
|
||||
\li qtcreator
|
||||
|
||||
\li qtc-qmldump
|
||||
|
||||
\endlist
|
||||
|
||||
The location of the above files and directories depends on the platform:
|
||||
|
||||
\list
|
||||
|
||||
\li On Linux and other Unix platforms, look in
|
||||
\c {~/.config/QtProject} and
|
||||
\c {~/.local/share/data/QtProject/qtcreator}.
|
||||
|
||||
\li On \macos, look in \c {~/.config/QtProject} and
|
||||
\c {~/Library/Application Support/QtProject/Qt Creator}.
|
||||
|
||||
\li On Windows, look in
|
||||
\c {%appdata%\QtProject} and \c {%localappdata%\QtProject}.
|
||||
|
||||
\endlist
|
||||
\endif
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@@ -24,6 +24,11 @@
|
||||
Generally, the integrated \QD has the same functions as the standalone
|
||||
\QD. The following sections describe the differences.
|
||||
|
||||
The following video shows how to use the integrated \QD to create a small Qt
|
||||
Widgets-based application:
|
||||
|
||||
\youtube LnVjI0I7cKs
|
||||
|
||||
\section1 Code Editor Integration
|
||||
|
||||
To switch between forms (\uicontrol Design mode) and code (\uicontrol Edit mode),
|
||||
|
@@ -87,19 +87,75 @@
|
||||
element. You can also add descriptive text to the UI that is always
|
||||
visible.
|
||||
|
||||
Consider adding tooltips for all UI elements that are not obvious from
|
||||
the context. The tooltips should help users understand what the UI controls
|
||||
do, so try to make them as clear as possible, even if they get a bit long.
|
||||
|
||||
\section3 Tooltips for Icons
|
||||
|
||||
For an icon, you can use the command name as a tool tip. In that
|
||||
case, use book style capitalization and do not add a period after the tool
|
||||
tip.
|
||||
|
||||
\image qtcreator-tooltip.png {Tooltip}
|
||||
|
||||
Tooltips can also contain full sentences. Try to make them as short and
|
||||
concise as possible, while still making them grammatically correct. Use
|
||||
sentence style capitalization and punctuation as you would for any
|
||||
sentence.
|
||||
\section3 Other Tooltips
|
||||
|
||||
Tooltips can also contain full sentences.
|
||||
|
||||
\image qtcreator-tooltip-long.png {Sentence as a tooltip}
|
||||
|
||||
Follow these guidelines:
|
||||
|
||||
\list
|
||||
\li Write useful tooltips, but keep them as short and concise as
|
||||
possible.
|
||||
\li To help people who localize and people for whom English is a second
|
||||
language, make tooltips as grammatically clear as possible. Use the
|
||||
articles a, an, and the, prepositions, such as of, and demonstrative
|
||||
pronouns, such as this and that, wherever possible.
|
||||
\li Use sentence style capitalization and punctuation as you would for
|
||||
any sentence.
|
||||
\li For input fields, describe the value of the field. Tell users what
|
||||
they can enter in the field, such as a name or a path, unless it is
|
||||
obvious from the context. Use a noun phrase, such as \e {The name of
|
||||
the user account.} Describe limitations and special requirements.
|
||||
\li For actions, such as most check boxes, radio buttons, push buttons,
|
||||
and menu items, describe what happens when users select them. Use a
|
||||
verb phrase, such as \e {Removes trailing whitespace upon saving.}
|
||||
\li For combo boxes, describe when to pick each option.
|
||||
\li Describe what the UI control does, not how to use it. If the control
|
||||
does not work as users would expect it to, check your design, as you
|
||||
most likely chose the wrong type of control.
|
||||
\li Do not describe the default value or the minimum and maximum values,
|
||||
as users can see them in the field.
|
||||
\endlist
|
||||
|
||||
\section3 Examples
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Control
|
||||
\li Do
|
||||
\li Don't
|
||||
\row
|
||||
\li Button - \uicontrol {Download Definitions}
|
||||
\li Download missing and update existing syntax definition files.
|
||||
\li You can select this button to download syntax definition files.
|
||||
\row
|
||||
\li Check box - \uicontrol {Clean whitespace}
|
||||
\li Removes trailing whitespace upon saving.
|
||||
\li Enable this check box to remove trailing whitespace upon saving.
|
||||
\row
|
||||
\li Combo box - \uicontrol Size
|
||||
\li The font size used in the terminal (in points).
|
||||
\li Use the up and down arrows to set the font size between 1 and 100.
|
||||
\row
|
||||
\li Field - \uicontrol {Shell arguments}
|
||||
\li The arguments to be passed to the shell.
|
||||
\li Sets the arguments to be passed to the shell.
|
||||
\endtable
|
||||
|
||||
\section3 Writing Tooltips in Design Mode
|
||||
|
||||
In Qt Designer, use plain text for tooltips. For extra formatting, write
|
||||
@@ -166,9 +222,11 @@
|
||||
|
||||
\section3 Checking Book Style Capitalization
|
||||
|
||||
You can use the to-title-case.js script in the \c{\doc\titlecase}
|
||||
folder to check book style capitalization of UI text or headings in
|
||||
documentation:
|
||||
If necessary, use an online \l{https://titlecaseconverter.com/}
|
||||
{Title Case Converter} to check book style capitalization
|
||||
of UI text or headings in documentation.
|
||||
|
||||
Or, use the to-title-case.js script in the \c{\doc\titlecase} folder:
|
||||
|
||||
\list 1
|
||||
|
||||
|
Before Width: | Height: | Size: 102 KiB |
BIN
doc/qtdesignstudio/images/studio-welcome-mode.webp
Normal file
After Width: | Height: | Size: 48 KiB |
@@ -1386,7 +1386,7 @@ class DumperBase():
|
||||
self.putExpandable()
|
||||
return
|
||||
|
||||
if DisplayFormat.Array10 <= displayFormat and displayFormat <= DisplayFormat.Array1000:
|
||||
if DisplayFormat.Array10 <= displayFormat and displayFormat <= DisplayFormat.Array10000:
|
||||
n = (10, 100, 1000, 10000)[displayFormat - DisplayFormat.Array10]
|
||||
self.putType(typeName)
|
||||
self.putItemCount(n)
|
||||
|
@@ -1518,7 +1518,15 @@ void BoolAspect::setLabelPlacement(BoolAspect::LabelPlacement labelPlacement)
|
||||
d->m_labelPlacement = labelPlacement;
|
||||
}
|
||||
|
||||
CheckableDecider BoolAspect::checkableDecider()
|
||||
CheckableDecider BoolAspect::askAgainCheckableDecider()
|
||||
{
|
||||
return CheckableDecider(
|
||||
[this] { return value(); },
|
||||
[this] { setValue(true); }
|
||||
);
|
||||
}
|
||||
|
||||
CheckableDecider BoolAspect::doNotAskAgainCheckableDecider()
|
||||
{
|
||||
return CheckableDecider(
|
||||
[this] { return !value(); },
|
||||
|
@@ -325,7 +325,9 @@ public:
|
||||
|
||||
void addToLayout(Layouting::LayoutItem &parent) override;
|
||||
std::function<void(QObject *)> groupChecker();
|
||||
Utils::CheckableDecider checkableDecider();
|
||||
|
||||
Utils::CheckableDecider askAgainCheckableDecider();
|
||||
Utils::CheckableDecider doNotAskAgainCheckableDecider();
|
||||
|
||||
QAction *action() override;
|
||||
|
||||
|
@@ -305,6 +305,8 @@ static void addItemToFlowLayout(FlowLayout *layout, const ResultItem &item)
|
||||
// layout->addStretch(item.stretch);
|
||||
// } else if (item.space != -1) {
|
||||
// layout->addSpacing(item.space);
|
||||
} else if (item.empty) {
|
||||
// Nothing to do, but no reason to warn, either
|
||||
} else if (!item.text.isEmpty()) {
|
||||
layout->addWidget(createLabel(item.text));
|
||||
} else {
|
||||
|
@@ -280,8 +280,10 @@ void TerminalInterface::sendCommand(char c)
|
||||
void TerminalInterface::killInferiorProcess()
|
||||
{
|
||||
sendCommand('k');
|
||||
if (d->stubSocket)
|
||||
if (d->stubSocket) {
|
||||
d->stubSocket->waitForReadyRead();
|
||||
emitFinished(-1, QProcess::CrashExit);
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalInterface::killStubProcess()
|
||||
|
@@ -27,6 +27,7 @@ const char ANDROID_KIT_NDK[] = "Android.NDK";
|
||||
const char ANDROID_KIT_SDK[] = "Android.SDK";
|
||||
|
||||
const char ANDROID_BUILD_DIRECTORY[] = "android-build";
|
||||
const char ANDROID_APP_PROCESS_DIRECTORY[] = "android-app-process";
|
||||
const char JAVA_EDITOR_ID[] = "java.editor";
|
||||
const char JLS_SETTINGS_ID[] = "Java::JLSSettingsID";
|
||||
const char JAVA_MIMETYPE[] = "text/x-java";
|
||||
|
@@ -138,7 +138,7 @@ void AndroidDebugSupport::start()
|
||||
FilePath::removeDuplicates(solibSearchPath);
|
||||
setSolibSearchPath(solibSearchPath);
|
||||
qCDebug(androidDebugSupportLog).noquote() << "SoLibSearchPath: " << solibSearchPath;
|
||||
setSymbolFile(buildDir.pathAppended("app_process"));
|
||||
setSymbolFile(AndroidManager::androidAppProcessDir(target).pathAppended("app_process"));
|
||||
setSkipExecutableValidation(true);
|
||||
setUseExtendedRemote(true);
|
||||
QString devicePreferredAbi = AndroidManager::apkDevicePreferredAbi(target);
|
||||
|
@@ -512,6 +512,13 @@ void AndroidDeployQtStep::runImpl(QPromise<bool> &promise)
|
||||
itr.value().removeFile();
|
||||
|
||||
for (auto itr = m_filesToPull.constBegin(); itr != m_filesToPull.constEnd(); ++itr) {
|
||||
const FilePath parentDir = itr.value().parentDir();
|
||||
if (!parentDir.ensureWritableDir()) {
|
||||
const QString error = QString("Package deploy: Unable to create directory %1.")
|
||||
.arg(parentDir.nativePath());
|
||||
reportWarningOrError(error, Task::Error);
|
||||
}
|
||||
|
||||
runCommand({m_adbPath,
|
||||
AndroidDeviceInfo::adbSelector(m_serialNumber)
|
||||
<< "pull" << itr.key() << itr.value().nativePath()});
|
||||
@@ -528,7 +535,7 @@ void AndroidDeployQtStep::runImpl(QPromise<bool> &promise)
|
||||
void AndroidDeployQtStep::gatherFilesToPull()
|
||||
{
|
||||
m_filesToPull.clear();
|
||||
const FilePath buildDir = AndroidManager::buildDirectory(target());
|
||||
const FilePath appProcessDir = AndroidManager::androidAppProcessDir(target());
|
||||
|
||||
if (!m_deviceInfo.isValid())
|
||||
return;
|
||||
@@ -538,16 +545,16 @@ void AndroidDeployQtStep::gatherFilesToPull()
|
||||
const QString preferredAbi = AndroidManager::apkDevicePreferredAbi(target());
|
||||
if (preferredAbi == ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A
|
||||
|| preferredAbi == ProjectExplorer::Constants::ANDROID_ABI_X86_64) {
|
||||
m_filesToPull["/system/bin/app_process64"] = buildDir / "app_process";
|
||||
m_filesToPull["/system/bin/app_process64"] = appProcessDir / "app_process";
|
||||
libDirName = "lib64";
|
||||
linkerName = "linker64";
|
||||
} else {
|
||||
m_filesToPull["/system/bin/app_process32"] = buildDir / "app_process";
|
||||
m_filesToPull["/system/bin/app_process"] = buildDir / "app_process";
|
||||
m_filesToPull["/system/bin/app_process32"] = appProcessDir / "app_process";
|
||||
m_filesToPull["/system/bin/app_process"] = appProcessDir / "app_process";
|
||||
}
|
||||
|
||||
m_filesToPull["/system/bin/" + linkerName] = buildDir / linkerName;
|
||||
m_filesToPull["/system/" + libDirName + "/libc.so"] = buildDir / "libc.so";
|
||||
m_filesToPull["/system/bin/" + linkerName] = appProcessDir / linkerName;
|
||||
m_filesToPull["/system/" + libDirName + "/libc.so"] = appProcessDir / "libc.so";
|
||||
|
||||
for (auto itr = m_filesToPull.constBegin(); itr != m_filesToPull.constEnd(); ++itr)
|
||||
qCDebug(deployStepLog).noquote() << "Pulling file from device:" << itr.key()
|
||||
|
@@ -229,6 +229,11 @@ FilePath AndroidManager::androidBuildDirectory(const Target *target)
|
||||
return buildDirectory(target) / Constants::ANDROID_BUILD_DIRECTORY;
|
||||
}
|
||||
|
||||
FilePath AndroidManager::androidAppProcessDir(const Target *target)
|
||||
{
|
||||
return buildDirectory(target) / Constants::ANDROID_APP_PROCESS_DIRECTORY;
|
||||
}
|
||||
|
||||
bool AndroidManager::isQt5CmakeProject(const ProjectExplorer::Target *target)
|
||||
{
|
||||
const QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit());
|
||||
|
@@ -74,6 +74,7 @@ public:
|
||||
static bool isQt5CmakeProject(const ProjectExplorer::Target *target);
|
||||
|
||||
static Utils::FilePath androidBuildDirectory(const ProjectExplorer::Target *target);
|
||||
static Utils::FilePath androidAppProcessDir(const ProjectExplorer::Target *target);
|
||||
static Utils::FilePath buildDirectory(const ProjectExplorer::Target *target);
|
||||
static Utils::FilePath manifestPath(const ProjectExplorer::Target *target);
|
||||
static void setManifestPath(ProjectExplorer::Target *target, const Utils::FilePath &path);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "testresultmodel.h"
|
||||
|
||||
#include "autotesticons.h"
|
||||
#include "testresultspane.h"
|
||||
#include "testrunner.h"
|
||||
#include "testsettings.h"
|
||||
#include "testtreeitem.h"
|
||||
@@ -15,6 +16,7 @@
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QIcon>
|
||||
#include <QToolButton>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -185,6 +187,17 @@ TestResultItem *TestResultItem::createAndAddIntermediateFor(const TestResultItem
|
||||
result.setResult(ResultType::TestStart);
|
||||
TestResultItem *intermediate = new TestResultItem(result);
|
||||
appendChild(intermediate);
|
||||
// FIXME: make the expand button's state easier accessible
|
||||
auto widgets = TestResultsPane::instance()->toolBarWidgets();
|
||||
if (!widgets.empty()) {
|
||||
if (QToolButton *expand = qobject_cast<QToolButton *>(widgets.at(0))) {
|
||||
if (expand->isChecked()) {
|
||||
QMetaObject::invokeMethod(TestResultsPane::instance(),
|
||||
[intermediate] { intermediate->expand(); },
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
}
|
||||
return intermediate;
|
||||
}
|
||||
|
||||
|
@@ -978,6 +978,12 @@ MessageId ClangdClient::requestSymbolInfo(const Utils::FilePath &filePath, const
|
||||
return symReq.id();
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
ClangdFollowSymbol *ClangdClient::currentFollowSymbolOperation()
|
||||
{
|
||||
return d->followSymbol;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ClangdClient::followSymbol(TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
@@ -990,8 +996,8 @@ void ClangdClient::followSymbol(TextDocument *document,
|
||||
{
|
||||
QTC_ASSERT(documentOpen(document), openDocument(document));
|
||||
|
||||
delete d->followSymbol;
|
||||
d->followSymbol = nullptr;
|
||||
if (d->followSymbol)
|
||||
d->followSymbol->cancel();
|
||||
|
||||
const QTextCursor adjustedCursor = d->adjustedCursor(cursor, document);
|
||||
if (followTo == FollowTo::SymbolDef && !resolveTarget) {
|
||||
@@ -1001,12 +1007,14 @@ void ClangdClient::followSymbol(TextDocument *document,
|
||||
|
||||
qCDebug(clangdLog) << "follow symbol requested" << document->filePath()
|
||||
<< adjustedCursor.blockNumber() << adjustedCursor.positionInBlock();
|
||||
d->followSymbol = new ClangdFollowSymbol(this, adjustedCursor, editorWidget, document, callback,
|
||||
followTo, openInSplit);
|
||||
connect(d->followSymbol, &ClangdFollowSymbol::done, this, [this] {
|
||||
d->followSymbol->deleteLater();
|
||||
d->followSymbol = nullptr;
|
||||
auto clangdFollowSymbol = new ClangdFollowSymbol(this, adjustedCursor, editorWidget, document,
|
||||
callback, followTo, openInSplit);
|
||||
connect(clangdFollowSymbol, &ClangdFollowSymbol::done, this, [this, clangdFollowSymbol] {
|
||||
clangdFollowSymbol->deleteLater();
|
||||
if (clangdFollowSymbol == d->followSymbol)
|
||||
d->followSymbol = nullptr;
|
||||
});
|
||||
d->followSymbol = clangdFollowSymbol;
|
||||
}
|
||||
|
||||
void ClangdClient::switchDeclDef(TextDocument *document, const QTextCursor &cursor,
|
||||
|
@@ -37,6 +37,8 @@ void setupClangdConfigFile();
|
||||
|
||||
enum class FollowTo { SymbolDef, SymbolType };
|
||||
|
||||
class ClangdFollowSymbol;
|
||||
|
||||
class ClangdClient : public LanguageClient::Client
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -117,6 +119,10 @@ public:
|
||||
const LanguageServerProtocol::Position &position,
|
||||
const SymbolInfoHandler &handler);
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
ClangdFollowSymbol *currentFollowSymbolOperation();
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void indexingFinished();
|
||||
void foundReferences(const Utils::SearchResultItems &items);
|
||||
|
@@ -90,6 +90,7 @@ public:
|
||||
void closeTempDocuments();
|
||||
bool addOpenFile(const FilePath &filePath);
|
||||
bool defLinkIsAmbiguous() const;
|
||||
void cancel();
|
||||
|
||||
ClangdFollowSymbol * const q;
|
||||
ClangdClient * const client;
|
||||
@@ -169,18 +170,17 @@ ClangdFollowSymbol::ClangdFollowSymbol(ClangdClient *client, const QTextCursor &
|
||||
|
||||
ClangdFollowSymbol::~ClangdFollowSymbol()
|
||||
{
|
||||
d->closeTempDocuments();
|
||||
if (d->virtualFuncAssistProcessor)
|
||||
d->virtualFuncAssistProcessor->resetData(false);
|
||||
for (const MessageId &id : std::as_const(d->pendingSymbolInfoRequests))
|
||||
d->client->cancelRequest(id);
|
||||
for (const MessageId &id : std::as_const(d->pendingGotoImplRequests))
|
||||
d->client->cancelRequest(id);
|
||||
for (const MessageId &id : std::as_const(d->pendingGotoDefRequests))
|
||||
d->client->cancelRequest(id);
|
||||
d->cancel();
|
||||
delete d;
|
||||
}
|
||||
|
||||
void ClangdFollowSymbol::cancel()
|
||||
{
|
||||
d->cancel();
|
||||
clear();
|
||||
emitDone();
|
||||
}
|
||||
|
||||
void ClangdFollowSymbol::clear()
|
||||
{
|
||||
d->openedFiles.clear();
|
||||
@@ -221,6 +221,19 @@ bool ClangdFollowSymbol::Private::defLinkIsAmbiguous() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void ClangdFollowSymbol::Private::cancel()
|
||||
{
|
||||
closeTempDocuments();
|
||||
if (virtualFuncAssistProcessor)
|
||||
virtualFuncAssistProcessor->resetData(false);
|
||||
for (const MessageId &id : std::as_const(pendingSymbolInfoRequests))
|
||||
client->cancelRequest(id);
|
||||
for (const MessageId &id : std::as_const(pendingGotoImplRequests))
|
||||
client->cancelRequest(id);
|
||||
for (const MessageId &id : std::as_const(pendingGotoDefRequests))
|
||||
client->cancelRequest(id);
|
||||
}
|
||||
|
||||
bool ClangdFollowSymbol::Private::addOpenFile(const FilePath &filePath)
|
||||
{
|
||||
return openedFiles.insert(filePath).second;
|
||||
|
@@ -28,6 +28,7 @@ public:
|
||||
TextEditor::TextDocument *document, const Utils::LinkHandler &callback,
|
||||
FollowTo followTo, bool openInSplit);
|
||||
~ClangdFollowSymbol();
|
||||
void cancel();
|
||||
void clear();
|
||||
|
||||
signals:
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "clangdtests.h"
|
||||
|
||||
#include "../clangdclient.h"
|
||||
#include "../clangdfollowsymbol.h"
|
||||
#include "../clangmodelmanagersupport.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
@@ -428,6 +429,37 @@ void ClangdTestFollowSymbol::test()
|
||||
QCOMPARE(actualLink.targetColumn + 1, targetColumn);
|
||||
}
|
||||
|
||||
// Make sure it is safe to call follow symbol in a follow symbol handler. Since follow symbol
|
||||
// potentially opens a file that gets loaded in chunks which handles user events inbetween
|
||||
// the chunks we can potentially call a follow symbol while currently handling another one.
|
||||
void ClangdTestFollowSymbol::testFollowSymbolInHandler()
|
||||
{
|
||||
TextEditor::TextDocument *const doc = document("header.h");
|
||||
QVERIFY(doc);
|
||||
QTimer timer;
|
||||
timer.setSingleShot(true);
|
||||
QEventLoop loop;
|
||||
QTextCursor cursor(doc->document());
|
||||
const int pos = Text::positionInText(doc->document(), 48, 9);
|
||||
cursor.setPosition(pos);
|
||||
QObject::connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||
|
||||
bool deleted = false;
|
||||
|
||||
const auto handler = [&](const Link &) {
|
||||
client()->followSymbol(doc, cursor, nullptr, [&](const Link &) { loop.quit(); }, true,
|
||||
FollowTo::SymbolDef, false);
|
||||
QVERIFY(!deleted);
|
||||
};
|
||||
|
||||
client()->followSymbol(doc, cursor, nullptr, handler, true, FollowTo::SymbolDef, false);
|
||||
QVERIFY(client()->currentFollowSymbolOperation());
|
||||
connect(client()->currentFollowSymbolOperation(), &QObject::destroyed, [&] { deleted = true; });
|
||||
timer.start(10000);
|
||||
loop.exec();
|
||||
QVERIFY(timer.isActive());
|
||||
timer.stop();
|
||||
}
|
||||
|
||||
ClangdTestLocalReferences::ClangdTestLocalReferences()
|
||||
{
|
||||
|
@@ -86,6 +86,7 @@ public:
|
||||
private slots:
|
||||
void test_data();
|
||||
void test();
|
||||
void testFollowSymbolInHandler();
|
||||
};
|
||||
|
||||
class ClangdTestLocalReferences : public ClangdTest
|
||||
|
@@ -594,7 +594,7 @@ void CMakeBuildSettingsWidget::reconfigureWithInitialParameters()
|
||||
Core::ICore::dialogParent(),
|
||||
Tr::tr("Re-configure with Initial Parameters"),
|
||||
Tr::tr("Clear CMake configuration and configure with initial parameters?"),
|
||||
settings->askBeforeReConfigureInitialParams.checkableDecider(),
|
||||
settings->askBeforeReConfigureInitialParams.askAgainCheckableDecider(),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::Yes);
|
||||
|
||||
|
@@ -238,7 +238,7 @@ void CMakeManager::reloadCMakePresets()
|
||||
Tr::tr("Reload CMake Presets"),
|
||||
Tr::tr("Re-generates the kits that were created for CMake presets. All manual "
|
||||
"modifications to the CMake project settings will be lost."),
|
||||
settings->askBeforePresetsReload.checkableDecider(),
|
||||
settings->askBeforePresetsReload.askAgainCheckableDecider(),
|
||||
QMessageBox::Yes | QMessageBox::Cancel,
|
||||
QMessageBox::Yes,
|
||||
QMessageBox::Yes,
|
||||
|
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeprojectmanagertr.h"
|
||||
#include "cmakeprojectplugin.h"
|
||||
#include "cmakespecificsettings.h"
|
||||
#include "fileapiparser.h"
|
||||
#include "projecttreehelper.h"
|
||||
@@ -21,6 +20,7 @@
|
||||
#include <projectexplorer/projecttree.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -342,7 +342,6 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
||||
{
|
||||
RawProjectParts rpps;
|
||||
|
||||
int counter = 0;
|
||||
for (const TargetDetails &t : input.targetDetails) {
|
||||
QDir sourceDir(sourceDirectory.toString());
|
||||
bool needPostfix = t.compileGroups.size() > 1;
|
||||
@@ -375,7 +374,6 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
||||
qtcPchFile = "qtc_cmake_pch.hxx";
|
||||
}
|
||||
|
||||
++counter;
|
||||
RawProjectPart rpp;
|
||||
rpp.setProjectFileLocation(t.sourceDir.pathAppended("CMakeLists.txt").toString());
|
||||
rpp.setBuildSystemTarget(t.name);
|
||||
|
@@ -36,7 +36,9 @@ CopilotSettings::CopilotSettings()
|
||||
const FilePath nodeFromPath = FilePath("node").searchInPath();
|
||||
|
||||
const FilePaths searchDirs
|
||||
= {FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/copilot/dist/agent.js"),
|
||||
|
||||
= {FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/agent.js"),
|
||||
FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/copilot/dist/agent.js"),
|
||||
FilePath::fromUserInput(
|
||||
"~/.config/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js"),
|
||||
FilePath::fromUserInput(
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -100,23 +101,20 @@ void IOptionsPage::setWidgetCreator(const WidgetCreator &widgetCreator)
|
||||
|
||||
QStringList IOptionsPage::keywords() const
|
||||
{
|
||||
if (!m_keywordsInitialized) {
|
||||
auto that = const_cast<IOptionsPage *>(this);
|
||||
QWidget *widget = that->widget();
|
||||
if (!widget)
|
||||
return {};
|
||||
// find common subwidgets
|
||||
for (const QLabel *label : widget->findChildren<QLabel *>())
|
||||
m_keywords << Utils::stripAccelerator(label->text());
|
||||
for (const QCheckBox *checkbox : widget->findChildren<QCheckBox *>())
|
||||
m_keywords << Utils::stripAccelerator(checkbox->text());
|
||||
for (const QPushButton *pushButton : widget->findChildren<QPushButton *>())
|
||||
m_keywords << Utils::stripAccelerator(pushButton->text());
|
||||
for (const QGroupBox *groupBox : widget->findChildren<QGroupBox *>())
|
||||
m_keywords << Utils::stripAccelerator(groupBox->title());
|
||||
auto that = const_cast<IOptionsPage *>(this);
|
||||
QWidget *widget = that->widget();
|
||||
if (!widget)
|
||||
return {};
|
||||
// find common subwidgets
|
||||
for (const QLabel *label : widget->findChildren<QLabel *>())
|
||||
m_keywords << label->text();
|
||||
for (const QCheckBox *checkbox : widget->findChildren<QCheckBox *>())
|
||||
m_keywords << checkbox->text();
|
||||
for (const QPushButton *pushButton : widget->findChildren<QPushButton *>())
|
||||
m_keywords << pushButton->text();
|
||||
for (const QGroupBox *groupBox : widget->findChildren<QGroupBox *>())
|
||||
m_keywords << groupBox->title();
|
||||
|
||||
m_keywordsInitialized = true;
|
||||
}
|
||||
return m_keywords;
|
||||
}
|
||||
|
||||
@@ -271,7 +269,12 @@ const QList<IOptionsPage *> IOptionsPage::allOptionsPages()
|
||||
*/
|
||||
bool IOptionsPage::matches(const QRegularExpression ®exp) const
|
||||
{
|
||||
for (const QString &keyword : keywords())
|
||||
if (!m_keywordsInitialized) {
|
||||
m_keywords = Utils::transform(keywords(), Utils::stripAccelerator);
|
||||
m_keywordsInitialized = true;
|
||||
}
|
||||
|
||||
for (const QString &keyword : m_keywords)
|
||||
if (keyword.contains(regexp))
|
||||
return true;
|
||||
return false;
|
||||
|
@@ -59,14 +59,15 @@ public:
|
||||
using WidgetCreator = std::function<IOptionsPageWidget *()>;
|
||||
void setWidgetCreator(const WidgetCreator &widgetCreator);
|
||||
|
||||
QStringList keywords() const;
|
||||
|
||||
virtual bool matches(const QRegularExpression ®exp) const;
|
||||
virtual QWidget *widget();
|
||||
virtual void apply();
|
||||
virtual void finish();
|
||||
|
||||
virtual bool matches(const QRegularExpression ®exp) const;
|
||||
|
||||
protected:
|
||||
virtual QStringList keywords() const;
|
||||
|
||||
void setId(Utils::Id id) { m_id = id; }
|
||||
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
||||
void setCategory(Utils::Id category) { m_category = category; }
|
||||
|
@@ -214,7 +214,7 @@ int ManhattanStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
|
||||
switch (metric) {
|
||||
#ifdef Q_OS_MACOS
|
||||
case PM_MenuButtonIndicator:
|
||||
if (widget && option->type == QStyleOption::SO_ToolButton)
|
||||
if (widget && option && option->type == QStyleOption::SO_ToolButton)
|
||||
return 12;
|
||||
break;
|
||||
#endif
|
||||
|
@@ -775,6 +775,20 @@ MimeTypeSettings::~MimeTypeSettings()
|
||||
delete d;
|
||||
}
|
||||
|
||||
QStringList MimeTypeSettings::keywords() const
|
||||
{
|
||||
return {
|
||||
Tr::tr("Reset MIME Types"),
|
||||
Tr::tr("Reset Handlers"),
|
||||
Tr::tr("Registered MIME Types"),
|
||||
Tr::tr("Patterns:"),
|
||||
Tr::tr("Add..."),
|
||||
Tr::tr("Edit..."),
|
||||
Tr::tr("Remove"),
|
||||
Tr::tr("Details")
|
||||
};
|
||||
}
|
||||
|
||||
void MimeTypeSettings::restoreSettings()
|
||||
{
|
||||
MimeTypeSettingsPrivate::UserMimeTypeHash mimetypes
|
||||
|
@@ -15,6 +15,8 @@ public:
|
||||
MimeTypeSettings();
|
||||
~MimeTypeSettings() override;
|
||||
|
||||
QStringList keywords() const override;
|
||||
|
||||
static void restoreSettings();
|
||||
|
||||
private:
|
||||
|
@@ -753,6 +753,8 @@ bool DockerDevicePrivate::startContainer()
|
||||
"or restart Qt Creator."));
|
||||
});
|
||||
|
||||
QTC_ASSERT(m_shell, return false);
|
||||
|
||||
if (m_shell->start())
|
||||
return true;
|
||||
|
||||
|
@@ -460,7 +460,6 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
||||
OSFlavor flavor = UnknownFlavor;
|
||||
BinaryFormat format = UnknownFormat;
|
||||
unsigned char width = 0;
|
||||
int unknownCount = 0;
|
||||
|
||||
for (const QString &p : parts) {
|
||||
if (p == "unknown" || p == "pc"
|
||||
@@ -623,8 +622,6 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
||||
os = BareMetalOS;
|
||||
flavor = GenericFlavor;
|
||||
format = ElfFormat;
|
||||
} else {
|
||||
++unknownCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -112,7 +112,7 @@ void BuildDirectoryAspect::addToLayout(Layouting::LayoutItem &parent)
|
||||
StringAspect::addToLayout(parent);
|
||||
d->problemLabel = new InfoLabel({}, InfoLabel::Warning);
|
||||
d->problemLabel->setElideMode(Qt::ElideNone);
|
||||
parent.addItems({{}, d->problemLabel.data()});
|
||||
parent.addItems({Layouting::br, Layouting::empty, d->problemLabel.data()});
|
||||
updateProblemLabel();
|
||||
if (!d->sourceDir.isEmpty()) {
|
||||
connect(this, &StringAspect::checkedChanged, this, [this] {
|
||||
|
@@ -141,8 +141,7 @@ public:
|
||||
PortList freePorts;
|
||||
FilePath debugServerPath;
|
||||
FilePath debugDumperPath = Core::ICore::resourcePath("debugger/");
|
||||
FilePath qmlRunCommand;
|
||||
bool qmlRunCommandChecked = false;
|
||||
std::optional<FilePath> qmlRunCommand;
|
||||
bool emptyCommandAllowed = false;
|
||||
|
||||
QList<Icon> deviceIcons;
|
||||
@@ -475,7 +474,9 @@ void IDevice::fromMap(const QVariantMap &map)
|
||||
d->version = map.value(QLatin1String(VersionKey), 0).toInt();
|
||||
|
||||
d->debugServerPath = FilePath::fromSettings(map.value(QLatin1String(DebugServerKey)));
|
||||
d->qmlRunCommand = FilePath::fromSettings(map.value(QLatin1String(QmlRuntimeKey)));
|
||||
const FilePath qmlRunCmd = FilePath::fromSettings(map.value(QLatin1String(QmlRuntimeKey)));
|
||||
if (!qmlRunCmd.isEmpty())
|
||||
d->qmlRunCommand = qmlRunCmd;
|
||||
d->extraData = map.value(ExtraDataKey).toMap();
|
||||
}
|
||||
|
||||
@@ -508,7 +509,9 @@ QVariantMap IDevice::toMap() const
|
||||
map.insert(QLatin1String(VersionKey), d->version);
|
||||
|
||||
map.insert(QLatin1String(DebugServerKey), d->debugServerPath.toSettings());
|
||||
map.insert(QLatin1String(QmlRuntimeKey), d->qmlRunCommand.toSettings());
|
||||
map.insert(QLatin1String(QmlRuntimeKey),
|
||||
d->qmlRunCommand ? d->qmlRunCommand->toSettings() : FilePath().toSettings());
|
||||
|
||||
map.insert(ExtraDataKey, d->extraData);
|
||||
|
||||
return map;
|
||||
@@ -597,20 +600,23 @@ void IDevice::setDebugServerPath(const FilePath &path)
|
||||
|
||||
FilePath IDevice::qmlRunCommand() const
|
||||
{
|
||||
if (!d->qmlRunCommandChecked) {
|
||||
d->qmlRunCommandChecked = true;
|
||||
QString runtime = d->qmlRunCommand.path();
|
||||
if (runtime.isEmpty())
|
||||
runtime = "qml";
|
||||
d->qmlRunCommand = searchExecutableInPath(runtime);
|
||||
}
|
||||
return d->qmlRunCommand;
|
||||
if (d->qmlRunCommand)
|
||||
return *d->qmlRunCommand;
|
||||
|
||||
const FilePath newPath = searchExecutableInPath("qml");
|
||||
if (newPath.isEmpty())
|
||||
return {};
|
||||
|
||||
d->qmlRunCommand = newPath;
|
||||
return *d->qmlRunCommand;
|
||||
}
|
||||
|
||||
void IDevice::setQmlRunCommand(const FilePath &path)
|
||||
{
|
||||
d->qmlRunCommand = path;
|
||||
d->qmlRunCommandChecked = false;
|
||||
if (path.isEmpty())
|
||||
d->qmlRunCommand.reset();
|
||||
else
|
||||
d->qmlRunCommand = path;
|
||||
}
|
||||
|
||||
void IDevice::setExtraData(Id kind, const QVariant &data)
|
||||
|
@@ -350,6 +350,18 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
QStringList keywords() const final
|
||||
{
|
||||
return {
|
||||
Tr::tr("Name:"),
|
||||
Tr::tr("Executable"),
|
||||
Tr::tr("&Add"),
|
||||
Tr::tr("&Delete"),
|
||||
Tr::tr("&Clean Up"),
|
||||
Tr::tr("&Make Default")
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
InterpreterOptionsWidget *m_widget = nullptr;
|
||||
};
|
||||
|
@@ -1059,6 +1059,20 @@ QtOptionsPage::QtOptionsPage()
|
||||
setWidgetCreator([] { return new QtOptionsPageWidget; });
|
||||
}
|
||||
|
||||
QStringList QtOptionsPage::keywords() const
|
||||
{
|
||||
return {
|
||||
Tr::tr("Add..."),
|
||||
Tr::tr("Remove"),
|
||||
Tr::tr("Clean Up"),
|
||||
Tr::tr("Link with Qt"),
|
||||
Tr::tr("Remove Link"),
|
||||
Tr::tr("Qt installation path:"),
|
||||
Tr::tr("qmake path:"),
|
||||
Tr::tr("Register documentation:")
|
||||
};
|
||||
}
|
||||
|
||||
bool QtOptionsPage::canLinkWithQt()
|
||||
{
|
||||
return Internal::canLinkWithQt(nullptr);
|
||||
|
@@ -12,6 +12,8 @@ class QtOptionsPage final : public Core::IOptionsPage
|
||||
public:
|
||||
QtOptionsPage();
|
||||
|
||||
QStringList keywords() const final;
|
||||
|
||||
static bool canLinkWithQt();
|
||||
static bool isLinkedWithQt();
|
||||
static void linkWithQt();
|
||||
|
@@ -1,6 +1,8 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include "keys.h"
|
||||
|
||||
namespace Terminal::Internal {
|
||||
@@ -72,8 +74,14 @@ VTermKey qtKeyToVTerm(Qt::Key key, bool keypad)
|
||||
return keypad ? VTERM_KEY_KP_PERIOD : VTERM_KEY_NONE;
|
||||
case Qt::Key_Slash:
|
||||
return keypad ? VTERM_KEY_KP_DIVIDE : VTERM_KEY_NONE;
|
||||
case Qt::Key_Enter:
|
||||
return keypad ? VTERM_KEY_KP_ENTER : VTERM_KEY_NONE;
|
||||
case Qt::Key_Enter: {
|
||||
VTermKey enterKey = VTERM_KEY_KP_ENTER;
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost())
|
||||
enterKey = VTERM_KEY_ENTER;
|
||||
|
||||
return keypad ? enterKey : VTERM_KEY_NONE;
|
||||
}
|
||||
case Qt::Key_Equal:
|
||||
return keypad ? VTERM_KEY_KP_EQUAL : VTERM_KEY_NONE;
|
||||
default:
|
||||
|
@@ -14,41 +14,113 @@ namespace Terminal::Internal {
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
FilePaths availableShells()
|
||||
struct ShellItemBuilder
|
||||
{
|
||||
explicit ShellItemBuilder(const CommandLine &value)
|
||||
{
|
||||
m_item.openParameters.shellCommand = value;
|
||||
}
|
||||
explicit ShellItemBuilder(const FilePath &value)
|
||||
{
|
||||
m_item.openParameters.shellCommand = CommandLine(value);
|
||||
}
|
||||
ShellItemBuilder &name(const QString &value)
|
||||
{
|
||||
m_item.name = value;
|
||||
return *this;
|
||||
}
|
||||
ShellItemBuilder &icon(const FilePath &value)
|
||||
{
|
||||
static QFileIconProvider iconProvider;
|
||||
m_item.icon = iconProvider.icon(value.toFileInfo());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline operator ShellModelItem() { return item(); }
|
||||
ShellModelItem item()
|
||||
{
|
||||
if (m_item.name.isEmpty())
|
||||
m_item.name = m_item.openParameters.shellCommand->executable().toUserOutput();
|
||||
if (m_item.icon.isNull())
|
||||
icon(m_item.openParameters.shellCommand->executable());
|
||||
return m_item;
|
||||
}
|
||||
|
||||
private:
|
||||
ShellModelItem m_item;
|
||||
};
|
||||
|
||||
static QSet<FilePath> msysPaths()
|
||||
{
|
||||
QSet<FilePath> res;
|
||||
FilePath msys2 = FilePath::fromUserInput(QStandardPaths::findExecutable("msys2.exe"));
|
||||
if (msys2.exists())
|
||||
res.insert(msys2.parentDir());
|
||||
for (const QFileInfo &drive : QDir::drives()) {
|
||||
for (const QString &name : QStringList{"msys2", "msys32", "msys64"}) {
|
||||
msys2 = FilePath::fromString(drive.filePath()).pathAppended(name);
|
||||
if (msys2.pathAppended("msys2.exe").exists())
|
||||
res.insert(msys2);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
struct ShellModelPrivate
|
||||
{
|
||||
QList<ShellModelItem> localShells;
|
||||
ShellModelPrivate();
|
||||
};
|
||||
|
||||
ShellModelPrivate::ShellModelPrivate()
|
||||
{
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
FilePaths shells;
|
||||
|
||||
FilePath comspec = FilePath::fromUserInput(qtcEnvironmentVariable("COMSPEC"));
|
||||
shells << comspec;
|
||||
const FilePath comspec = FilePath::fromUserInput(qtcEnvironmentVariable("COMSPEC"));
|
||||
localShells << ShellItemBuilder(comspec);
|
||||
|
||||
if (comspec.fileName() != "cmd.exe") {
|
||||
FilePath cmd = FilePath::fromUserInput(QStandardPaths::findExecutable("cmd.exe"));
|
||||
shells << cmd;
|
||||
localShells << ShellItemBuilder(cmd);
|
||||
}
|
||||
|
||||
FilePath powershell = FilePath::fromUserInput(
|
||||
const FilePath powershell = FilePath::fromUserInput(
|
||||
QStandardPaths::findExecutable("powershell.exe"));
|
||||
|
||||
if (powershell.exists())
|
||||
shells << powershell;
|
||||
localShells << ShellItemBuilder(powershell);
|
||||
|
||||
FilePath bash = FilePath::fromUserInput(QStandardPaths::findExecutable("bash.exe"));
|
||||
if (bash.exists())
|
||||
shells << bash;
|
||||
const FilePath sys_bash =
|
||||
FilePath::fromUserInput(QStandardPaths::findExecutable("bash.exe"));
|
||||
if (sys_bash.exists())
|
||||
localShells << ShellItemBuilder({sys_bash, {"--login"}});
|
||||
|
||||
FilePath git_bash = FilePath::fromUserInput(QStandardPaths::findExecutable("git.exe"));
|
||||
if (git_bash.exists())
|
||||
shells << git_bash.parentDir().parentDir().pathAppended("usr/bin/bash.exe");
|
||||
const FilePath git_exe = FilePath::fromUserInput(QStandardPaths::findExecutable("git.exe"));
|
||||
if (git_exe.exists()) {
|
||||
FilePath git_bash = git_exe.parentDir().parentDir().pathAppended("bin/bash.exe");
|
||||
if (git_bash.exists()) {
|
||||
localShells << ShellItemBuilder({git_bash, {"--login"}})
|
||||
.icon(git_bash.parentDir().parentDir().pathAppended("git-bash.exe"));
|
||||
}
|
||||
}
|
||||
|
||||
FilePath msys2_bash = FilePath::fromUserInput(QStandardPaths::findExecutable("msys2.exe"));
|
||||
if (msys2_bash.exists())
|
||||
shells << msys2_bash.parentDir().pathAppended("usr/bin/bash.exe");
|
||||
|
||||
return shells;
|
||||
const QStringList msys2_args{"-defterm", "-no-start", "-here"};
|
||||
for (const FilePath &msys2_path : msysPaths()) {
|
||||
const FilePath msys2_cmd = msys2_path.pathAppended("msys2_shell.cmd");
|
||||
for (const FilePath &type : msys2_path.dirEntries({{"*.ico"}})) {
|
||||
// Only list this type if it has anything in /bin
|
||||
QDirIterator it(type.path().replace(".ico", "/bin"), QDir::Files);
|
||||
if (!it.hasNext())
|
||||
continue;
|
||||
localShells << ShellItemBuilder(
|
||||
{msys2_cmd, msys2_args + QStringList{"-" + type.baseName()}})
|
||||
.icon(type)
|
||||
.name(type.toUserOutput().replace(".ico", ".exe"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
FilePath shellsFile = FilePath::fromString("/etc/shells");
|
||||
const auto shellFileContent = shellsFile.fileContents();
|
||||
QTC_ASSERT_EXPECTED(shellFileContent, return {});
|
||||
QTC_ASSERT_EXPECTED(shellFileContent, return);
|
||||
|
||||
QString shellFileContentString = QString::fromUtf8(*shellFileContent);
|
||||
|
||||
@@ -63,29 +135,18 @@ FilePaths availableShells()
|
||||
});
|
||||
|
||||
// ... and filter out non-existing shells.
|
||||
return Utils::filtered(shells, [](const FilePath &shell) { return shell.exists(); });
|
||||
localShells = Utils::transform(
|
||||
Utils::filtered(shells, [](const FilePath &shell) {return shell.exists(); }),
|
||||
[](const FilePath &shell) {
|
||||
return ShellItemBuilder(shell).item();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
struct ShellModelPrivate
|
||||
{
|
||||
QList<ShellModelItem> localShells;
|
||||
};
|
||||
|
||||
ShellModel::ShellModel(QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ShellModelPrivate())
|
||||
{
|
||||
QFileIconProvider iconProvider;
|
||||
|
||||
const FilePaths shells = availableShells();
|
||||
for (const FilePath &shell : shells) {
|
||||
ShellModelItem item;
|
||||
item.icon = iconProvider.icon(shell.toFileInfo());
|
||||
item.name = shell.toUserOutput();
|
||||
item.openParameters.shellCommand = {shell, {}};
|
||||
d->localShells << item;
|
||||
}
|
||||
}
|
||||
|
||||
ShellModel::~ShellModel() = default;
|
||||
|
@@ -538,8 +538,15 @@ public:
|
||||
void paintIfDefedOutBlocks(const PaintEventData &data, QPainter &painter) const;
|
||||
void paintFindScope(const PaintEventData &data, QPainter &painter) const;
|
||||
void paintCurrentLineHighlight(const PaintEventData &data, QPainter &painter) const;
|
||||
void paintCursorAsBlock(const PaintEventData &data, QPainter &painter,
|
||||
PaintEventBlockData &blockData, int cursorPosition) const;
|
||||
QRectF cursorBlockRect(const QTextDocument *doc,
|
||||
const QTextBlock &block,
|
||||
int cursorPosition,
|
||||
QRectF blockBoundingRect = {},
|
||||
bool *doSelection = nullptr) const;
|
||||
void paintCursorAsBlock(const PaintEventData &data,
|
||||
QPainter &painter,
|
||||
PaintEventBlockData &blockData,
|
||||
int cursorPosition) const;
|
||||
void paintAdditionalVisualWhitespaces(PaintEventData &data, QPainter &painter, qreal top) const;
|
||||
void paintIndentDepth(PaintEventData &data, QPainter &painter, const PaintEventBlockData &blockData);
|
||||
void paintReplacement(PaintEventData &data, QPainter &painter, qreal top) const;
|
||||
@@ -2778,6 +2785,14 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
if (ro) break;
|
||||
if (e->modifiers() == Qt::NoModifier) {
|
||||
setOverwriteMode(!inOverwriteMode);
|
||||
if (inOverwriteMode) {
|
||||
for (const QTextCursor &cursor : multiTextCursor()) {
|
||||
const QRectF oldBlockRect = d->cursorBlockRect(document(),
|
||||
cursor.block(),
|
||||
cursor.position());
|
||||
viewport()->update(oldBlockRect.toAlignedRect());
|
||||
}
|
||||
}
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
@@ -4426,19 +4441,22 @@ void TextEditorWidgetPrivate::paintCurrentLineHighlight(const PaintEventData &da
|
||||
}
|
||||
}
|
||||
|
||||
void TextEditorWidgetPrivate::paintCursorAsBlock(const PaintEventData &data, QPainter &painter,
|
||||
PaintEventBlockData &blockData, int cursorPosition) const
|
||||
QRectF TextEditorWidgetPrivate::cursorBlockRect(const QTextDocument *doc,
|
||||
const QTextBlock &block,
|
||||
int cursorPosition,
|
||||
QRectF blockBoundingRect,
|
||||
bool *doSelection) const
|
||||
{
|
||||
const qreal space = charWidth();
|
||||
int relativePos = cursorPosition - blockData.position;
|
||||
bool doSelection = true;
|
||||
QTextLine line = blockData.layout->lineForTextPosition(relativePos);
|
||||
int relativePos = cursorPosition - block.position();
|
||||
QTextLine line = block.layout()->lineForTextPosition(relativePos);
|
||||
qreal x = line.cursorToX(relativePos);
|
||||
qreal w = 0;
|
||||
if (relativePos < line.textLength() - line.textStart()) {
|
||||
w = line.cursorToX(relativePos + 1) - x;
|
||||
if (data.doc->characterAt(cursorPosition) == QLatin1Char('\t')) {
|
||||
doSelection = false;
|
||||
if (doc->characterAt(cursorPosition) == QLatin1Char('\t')) {
|
||||
if (doSelection)
|
||||
*doSelection = false;
|
||||
if (w > space) {
|
||||
x += w - space;
|
||||
w = space;
|
||||
@@ -4448,12 +4466,30 @@ void TextEditorWidgetPrivate::paintCursorAsBlock(const PaintEventData &data, QPa
|
||||
w = space; // in sync with QTextLine::draw()
|
||||
}
|
||||
|
||||
QRectF lineRect = line.rect();
|
||||
lineRect.moveTop(lineRect.top() + blockData.boundingRect.top());
|
||||
lineRect.moveLeft(blockData.boundingRect.left() + x);
|
||||
lineRect.setWidth(w);
|
||||
if (blockBoundingRect.isEmpty())
|
||||
blockBoundingRect = q->blockBoundingGeometry(block).translated(q->contentOffset());
|
||||
|
||||
QRectF cursorRect = line.rect();
|
||||
cursorRect.moveTop(cursorRect.top() + blockBoundingRect.top());
|
||||
cursorRect.moveLeft(blockBoundingRect.left() + x);
|
||||
cursorRect.setWidth(w);
|
||||
return cursorRect;
|
||||
}
|
||||
|
||||
void TextEditorWidgetPrivate::paintCursorAsBlock(const PaintEventData &data,
|
||||
QPainter &painter,
|
||||
PaintEventBlockData &blockData,
|
||||
int cursorPosition) const
|
||||
{
|
||||
bool doSelection = true;
|
||||
const QRectF cursorRect = cursorBlockRect(data.doc,
|
||||
data.block,
|
||||
cursorPosition,
|
||||
blockData.boundingRect,
|
||||
&doSelection);
|
||||
const QTextCharFormat textFormat = data.fontSettings.toTextCharFormat(C_TEXT);
|
||||
painter.fillRect(lineRect, textFormat.foreground());
|
||||
painter.fillRect(cursorRect, textFormat.foreground());
|
||||
int relativePos = cursorPosition - blockData.position;
|
||||
if (doSelection) {
|
||||
blockData.selections.append(
|
||||
createBlockCursorCharFormatRange(relativePos,
|
||||
|
@@ -4806,7 +4806,7 @@ bool Value::isValid(const Base *b) const
|
||||
case JsonValue::Double:
|
||||
if (intValue)
|
||||
break;
|
||||
// fall through
|
||||
[[fallthrough]];
|
||||
case JsonValue::String:
|
||||
case JsonValue::Array:
|
||||
case JsonValue::Object:
|
||||
@@ -4885,7 +4885,7 @@ uint32_t Value::valueToStore(const JsonValue &v, uint32_t offset)
|
||||
if (c != INT_MAX)
|
||||
return c;
|
||||
}
|
||||
// fall through
|
||||
[[fallthrough]];
|
||||
case JsonValue::String:
|
||||
case JsonValue::Array:
|
||||
case JsonValue::Object:
|
||||
|
@@ -287,7 +287,7 @@ QMakeEvaluator::quoteValue(const ProString &val)
|
||||
break;
|
||||
case 32:
|
||||
quote = true;
|
||||
// fallthrough
|
||||
[[fallthrough]];
|
||||
default:
|
||||
ret += c;
|
||||
break;
|
||||
|
@@ -295,7 +295,8 @@ ProStringList QMakeEvaluator::split_value_list(QStringView vals, int source)
|
||||
--x;
|
||||
}
|
||||
}
|
||||
// fallthrough
|
||||
hadWord = true;
|
||||
break;
|
||||
default:
|
||||
hadWord = true;
|
||||
break;
|
||||
@@ -1661,7 +1662,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::expandVariableReferences(
|
||||
tokPtr++;
|
||||
continue;
|
||||
}
|
||||
// fallthrough
|
||||
[[fallthrough]];
|
||||
default:
|
||||
Q_ASSERT_X(false, "expandVariableReferences", "Unrecognized token");
|
||||
break;
|
||||
@@ -2137,7 +2138,7 @@ QString QMakeEvaluator::formatValue(const ProString &val, bool forceQuote)
|
||||
break;
|
||||
case 32:
|
||||
quote = true;
|
||||
// fallthrough
|
||||
[[fallthrough]];
|
||||
default:
|
||||
ret += c;
|
||||
break;
|
||||
|
@@ -1563,7 +1563,7 @@ static bool getBlock(const ushort *tokens, int limit, int &offset, QString *outS
|
||||
case TokRemove:
|
||||
case TokReplace:
|
||||
// The parameter is the sizehint for the output.
|
||||
// fallthrough
|
||||
[[fallthrough]];
|
||||
case TokLine: {
|
||||
ushort dummy;
|
||||
ok = getUshort(tokens, limit, offset, &dummy, outStr);
|
||||
|
@@ -185,7 +185,7 @@ void doExit(int exitCode)
|
||||
std::cout << commandLineParser.value("wait").toStdString() << std::endl;
|
||||
|
||||
waitingForExitKeyPress = true;
|
||||
onKeyPress([exitCode] { doExit(exitCode); });
|
||||
onKeyPress([] { doExit(0); });
|
||||
} else {
|
||||
exit(exitCode);
|
||||
}
|
||||
@@ -206,9 +206,7 @@ void onInferiorFinished(int exitCode, QProcess::ExitStatus status)
|
||||
|
||||
void onInferiorErrorOccurered(QProcess::ProcessError error)
|
||||
{
|
||||
qCInfo(log) << "Inferior error: " << error << inferiorProcess.errorString();
|
||||
sendCrash(inferiorProcess.exitCode());
|
||||
doExit(1);
|
||||
qCWarning(log) << "Inferior error: " << error << inferiorProcess.errorString();
|
||||
}
|
||||
|
||||
void onInferiorStarted()
|
||||
|
@@ -8,6 +8,10 @@ set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (WINDOWS)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
endif()
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Gui Network Widgets)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Network Widgets)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Script Webkit WebkitWidgets QUIET)
|
||||
@@ -67,5 +71,5 @@ if (Qt${QT_VERSION_MAJOR}WebkitWidgets_FOUND)
|
||||
endif()
|
||||
|
||||
# and the plugin
|
||||
add_library(simple_test_plugin simple_test_plugin.cpp)
|
||||
add_library(simple_test_plugin SHARED simple_test_plugin.cpp)
|
||||
target_link_libraries(simple_test_plugin PRIVATE Qt${QT_VERSION_MAJOR}::Core)
|
||||
|
@@ -36,10 +36,8 @@ Qt 6.2.4 (MSVC2019, 64bit)
|
||||
Third - you'll have to provide some additional repositories.
|
||||
These additional repositories are located inside ~/squish-data or C:\Users\<user>\squish-data (depending on the OS you're on).
|
||||
You can also just provide them inside a different folder and specify the folder with the environment variable SYSTEST_SRCPATH.
|
||||
This folder must contain the following:
|
||||
* a QtCreator repository (or source copy) of tag v4.7.0 named 'creator' including the submodule src/shared/qbs
|
||||
* a subfolder called 'creator-test-data'
|
||||
* a speedcrunch 0.11 repository (or source copy) inside 'creator-test-data' named 'speedcrunch'
|
||||
This folder must contain a QtCreator repository (or source copy) of tag v4.7.0 named 'creator'
|
||||
including the submodule src/shared/qbs
|
||||
|
||||
Fourth - you'll have to make sure that some needed tools are available (no matter on which OS you're on).
|
||||
* cmake 3.14 or newer
|
||||
|
@@ -44,7 +44,9 @@ def __closeInfoBarEntry__(leftButtonText):
|
||||
doNotShowAgain = toolButton % "Do Not Show Again"
|
||||
leftWidget = "leftWidget={%s}" % (toolButton % leftButtonText)
|
||||
test.log("closing %s" % leftButtonText)
|
||||
clickButton(waitForObject("{%s %s}" % (doNotShowAgain, leftWidget)))
|
||||
buttonObjStr = "{%s %s}" % (doNotShowAgain, leftWidget)
|
||||
clickButton(waitForObject(buttonObjStr))
|
||||
waitFor('object.exists(buttonObjStr) == False', 2000)
|
||||
|
||||
# additionalParameters must be a list or tuple of strings or None
|
||||
def startQC(additionalParameters=None, withPreparedSettingsPath=True, closeLinkToQt=True, cancelTour=True):
|
||||
|
@@ -606,3 +606,24 @@ def stringify(obj):
|
||||
if isinstance(obj, bytes):
|
||||
tmp = obj.decode('cp1252') if platform.system() in ('Microsoft','Windows') else obj.decode()
|
||||
return tmp
|
||||
|
||||
|
||||
class GitClone:
|
||||
|
||||
def __init__(self, url, revision):
|
||||
self.localPath = os.path.join(tempDir(),
|
||||
url.rsplit('/', 1)[1].rsplit('.')[0])
|
||||
self.url = url
|
||||
self.revision = revision
|
||||
|
||||
def __enter__(self):
|
||||
try:
|
||||
subprocess.check_call(["git", "clone", "-b", self.revision,
|
||||
"--depth", "1", self.url, self.localPath])
|
||||
return self.localPath
|
||||
except subprocess.CalledProcessError as e:
|
||||
test.warning("Could not clone git repository %s" % self.url, str(e))
|
||||
return None
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
deleteDirIfExists(self.localPath)
|
||||
|
@@ -3,7 +3,6 @@
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
SpeedCrunchPath = ""
|
||||
|
||||
def buildConfigFromFancyToolButton(fancyToolButton):
|
||||
beginOfBuildConfig = "<b>Build:</b> "
|
||||
@@ -14,44 +13,37 @@ def buildConfigFromFancyToolButton(fancyToolButton):
|
||||
return toolTipText[beginIndex:endIndex]
|
||||
|
||||
def main():
|
||||
if not neededFilePresent(SpeedCrunchPath):
|
||||
return
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_5_14_1_DEFAULT])
|
||||
waitForProjectParsing()
|
||||
with GitClone("https://bitbucket.org/heldercorreia/speedcrunch.git",
|
||||
"release-0.12.0") as SpeedCrunchPath:
|
||||
if not SpeedCrunchPath:
|
||||
test.fatal("Could not clone SpeedCrunch")
|
||||
return
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(os.path.join(SpeedCrunchPath, "src", "speedcrunch.pro"),
|
||||
[Targets.DESKTOP_5_14_1_DEFAULT])
|
||||
waitForProjectParsing()
|
||||
|
||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||
|
||||
availableConfigs = iterateBuildConfigs("Release")
|
||||
if not availableConfigs:
|
||||
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
|
||||
for kit, config in availableConfigs:
|
||||
selectBuildConfig(kit, config)
|
||||
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
|
||||
if buildConfig != config:
|
||||
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
|
||||
continue
|
||||
test.log("Testing build configuration: " + config)
|
||||
invokeMenuItem("Build", "Run qmake")
|
||||
waitForCompile()
|
||||
selectFromLocator("t rebuild", "Rebuild All Projects")
|
||||
waitForCompile(300000)
|
||||
checkCompile()
|
||||
checkLastBuild()
|
||||
availableConfigs = iterateBuildConfigs("Release")
|
||||
if not availableConfigs:
|
||||
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
|
||||
for kit, config in availableConfigs:
|
||||
selectBuildConfig(kit, config)
|
||||
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
|
||||
if buildConfig != config:
|
||||
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
|
||||
continue
|
||||
test.log("Testing build configuration: " + config)
|
||||
invokeMenuItem("Build", "Run qmake")
|
||||
waitForCompile()
|
||||
selectFromLocator("t rebuild", "Rebuild All Projects")
|
||||
waitForCompile(300000)
|
||||
checkCompile()
|
||||
checkLastBuild()
|
||||
|
||||
# Add a new run configuration
|
||||
# Add a new run configuration
|
||||
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
||||
def init():
|
||||
global SpeedCrunchPath
|
||||
SpeedCrunchPath = os.path.join(srcPath, "creator-test-data", "speedcrunch", "src", "speedcrunch.pro")
|
||||
cleanup()
|
||||
|
||||
def cleanup():
|
||||
# Make sure the .user files are gone
|
||||
cleanUpUserFiles(SpeedCrunchPath)
|
||||
for dir in glob.glob(os.path.join(srcPath, "creator-test-data", "speedcrunch", "speedcrunch-build-*")):
|
||||
deleteDirIfExists(dir)
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
@@ -3,7 +3,6 @@
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
SpeedCrunchPath = ""
|
||||
BuildPath = tempDir()
|
||||
|
||||
def cmakeSupported():
|
||||
@@ -27,39 +26,36 @@ def main():
|
||||
if not cmakeSupported():
|
||||
test.warning("CMake version is no more supported for QC")
|
||||
return
|
||||
if not neededFilePresent(SpeedCrunchPath):
|
||||
return
|
||||
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
result = openCmakeProject(SpeedCrunchPath, BuildPath)
|
||||
if not result:
|
||||
test.fatal("Could not open/create cmake project - leaving test")
|
||||
with GitClone("https://bitbucket.org/heldercorreia/speedcrunch.git",
|
||||
"release-0.12.0") as SpeedCrunchPath:
|
||||
if not SpeedCrunchPath:
|
||||
test.fatal("Could not clone SpeedCrunch")
|
||||
return
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
result = openCmakeProject(os.path.join(SpeedCrunchPath, "src", "CMakeLists.txt"),
|
||||
BuildPath)
|
||||
if not result:
|
||||
test.fatal("Could not open/create cmake project - leaving test")
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
waitForProjectParsing()
|
||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||
treeFile = "projecttree_speedcrunch.tsv"
|
||||
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", treeFile)
|
||||
|
||||
# Invoke a rebuild of the application
|
||||
selectFromLocator("t rebuild", "Rebuild All Projects")
|
||||
|
||||
# Wait for, and test if the build succeeded
|
||||
waitForCompile(300000)
|
||||
checkCompile()
|
||||
checkLastBuild()
|
||||
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
waitForProjectParsing()
|
||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||
treeFile = "projecttree_speedcrunch.tsv"
|
||||
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", treeFile)
|
||||
|
||||
# Invoke a rebuild of the application
|
||||
selectFromLocator("t rebuild", "Rebuild All Projects")
|
||||
|
||||
# Wait for, and test if the build succeeded
|
||||
waitForCompile(300000)
|
||||
checkCompile()
|
||||
checkLastBuild()
|
||||
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
||||
def init():
|
||||
global SpeedCrunchPath
|
||||
SpeedCrunchPath = srcPath + "/creator-test-data/speedcrunch/src/CMakeLists.txt"
|
||||
cleanup()
|
||||
|
||||
def cleanup():
|
||||
global BuildPath
|
||||
# Make sure the .user files are gone
|
||||
cleanUpUserFiles(SpeedCrunchPath)
|
||||
deleteDirIfExists(BuildPath)
|
||||
|
@@ -5,51 +5,55 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
pathCreator = srcPath + "/creator/qtcreator.pro"
|
||||
pathSpeedcrunch = srcPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro"
|
||||
if not neededFilePresent(pathCreator) or not neededFilePresent(pathSpeedcrunch):
|
||||
if not neededFilePresent(pathCreator):
|
||||
return
|
||||
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
with GitClone("https://bitbucket.org/heldercorreia/speedcrunch.git",
|
||||
"0.11") as pathSpeedcrunch:
|
||||
if not pathSpeedcrunch:
|
||||
test.fatal("Could not clone SpeedCrunch")
|
||||
return
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
|
||||
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
|
||||
openQmakeProject(pathSpeedcrunch, [Targets.DESKTOP_5_14_1_DEFAULT])
|
||||
# Wait for parsing to complete
|
||||
waitFor("runButton.enabled", 30000)
|
||||
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)
|
||||
startopening = datetime.utcnow()
|
||||
openQmakeProject(pathCreator, [Targets.DESKTOP_5_10_1_DEFAULT])
|
||||
# Wait for parsing to complete
|
||||
startreading = datetime.utcnow()
|
||||
waitFor("runButton.enabled", 300000)
|
||||
secondsOpening = (datetime.utcnow() - startopening).seconds
|
||||
secondsReading = (datetime.utcnow() - startreading).seconds
|
||||
timeoutOpen = 45
|
||||
timeoutRead = 22
|
||||
test.verify(secondsOpening <= timeoutOpen, "Opening and reading qtcreator.pro took %d seconds. "
|
||||
"It should not take longer than %d seconds" % (secondsOpening, timeoutOpen))
|
||||
test.verify(secondsReading <= timeoutRead, "Just reading qtcreator.pro took %d seconds. "
|
||||
"It should not take longer than %d seconds" % (secondsReading, timeoutRead))
|
||||
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
|
||||
openQmakeProject(os.path.join(pathSpeedcrunch, "src", "speedcrunch.pro"),
|
||||
[Targets.DESKTOP_5_14_1_DEFAULT])
|
||||
# Wait for parsing to complete
|
||||
waitFor("runButton.enabled", 30000)
|
||||
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)
|
||||
startopening = datetime.utcnow()
|
||||
openQmakeProject(pathCreator, [Targets.DESKTOP_5_10_1_DEFAULT])
|
||||
# Wait for parsing to complete
|
||||
startreading = datetime.utcnow()
|
||||
waitFor("runButton.enabled", 300000)
|
||||
secondsOpening = (datetime.utcnow() - startopening).seconds
|
||||
secondsReading = (datetime.utcnow() - startreading).seconds
|
||||
timeoutOpen = 45
|
||||
timeoutRead = 22
|
||||
test.verify(secondsOpening <= timeoutOpen, "Opening and reading qtcreator.pro took %d seconds. "
|
||||
"It should not take longer than %d seconds" % (secondsOpening, timeoutOpen))
|
||||
test.verify(secondsReading <= timeoutRead, "Just reading qtcreator.pro took %d seconds. "
|
||||
"It should not take longer than %d seconds" % (secondsReading, timeoutRead))
|
||||
|
||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", "projecttree_speedcrunch.tsv")
|
||||
compareProjectTree(naviTreeView % "qtcreator( \[\S+\])?", "projecttree_creator.tsv")
|
||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", "projecttree_speedcrunch.tsv")
|
||||
compareProjectTree(naviTreeView % "qtcreator( \[\S+\])?", "projecttree_creator.tsv")
|
||||
|
||||
openGeneralMessages()
|
||||
# Verify that qmljs.g is in the project even when we don't know where (QTCREATORBUG-17609)
|
||||
selectFromLocator("p qmljs.g", "qmljs.g")
|
||||
# Now check some basic lookups in the search box
|
||||
selectFromLocator(": qlist::qlist", "QList::QList")
|
||||
test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList")
|
||||
openGeneralMessages()
|
||||
# Verify that qmljs.g is in the project even when we don't know where (QTCREATORBUG-17609)
|
||||
selectFromLocator("p qmljs.g", "qmljs.g")
|
||||
# Now check some basic lookups in the search box
|
||||
selectFromLocator(": qlist::qlist", "QList::QList")
|
||||
test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList")
|
||||
|
||||
invokeMenuItem("File", "Exit")
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
||||
def init():
|
||||
cleanup()
|
||||
|
||||
def cleanup():
|
||||
# Make sure the .user files are gone
|
||||
cleanUpUserFiles([srcPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro",
|
||||
srcPath + "/creator/qtcreator.pro"])
|
||||
cleanUpUserFiles([srcPath + "/creator/qtcreator.pro"])
|
||||
|
||||
|
@@ -1534,6 +1534,7 @@ TEST(SmallString, LongPathStringMoveConstuctor)
|
||||
}
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Wpragmas")
|
||||
QT_WARNING_DISABLE_GCC("-Wself-move")
|
||||
QT_WARNING_DISABLE_CLANG("-Wself-move")
|
||||
|
||||
|