Merge remote-tracking branch 'origin/4.12'

Change-Id: Ie35e9959693b6f6f78509eea5b259d6493ef87f2
This commit is contained in:
Eike Ziller
2020-04-17 08:09:55 +02:00
55 changed files with 7620 additions and 5291 deletions

View File

@@ -1,2 +1,10 @@
These forms are processed at run-time to produce dynamically-generated user interfaces. In order to generate a form at run-time, a resource file containing a .ui file is needed. Applications that use the form handling classes need to be configured to be built against the QtUiTools module. This is done by including the following declaration in a qmake project file to ensure that the application is compiled and linked appropriately. A form loader object, provided by the QUiLoader class, is used to construct the user interface. This user interface
can be retrieved from any QIODevice; for example, a QFile object can be used to obtain a form stored in a project's resources. The QUiLoader::load() function takes the user interface description contained in the file and constructs the form widget.
IDE Overview
Qt Creator is an integrated development environment (IDE) that provides you
with tools to design and develop applications with the Qt application framework.
Qt is designed for developing applications and user interfaces once and
deploying them to several desktop, embedded, and mobile operating systems or web
browsers (experimental). Qt Creator provides you with tools for accomplishing
your tasks throughout the whole application development life-cycle, from
creating a project to deploying the application to the target platforms.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -76,6 +76,25 @@
To switch to the editor context when you close the last help page, select
the \uicontrol {Return to editor on closing the last page} check box.
\section1 Selecting the Help Viewer Backend
The help viewer backend determines the style sheet that is used to display
the help files. A help viewer backend that is based on the \l {QTextBrowser}
is used by default. However, it has several issues that have been fixed when
using litehtml as the help viewer backend.
On \macos, you can also use a help viewer backend that is based on the
system WebView component.
To switch the help viewer backend:
\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Help >
\uicontrol General.
\li In the \uicontrol {Viewer backend} field, select a viewer backend.
\li Reload the help page to take the new backend to use.
\endlist
\section1 Viewing Function Tooltips
To hide function tooltips by default, select \uicontrol Tools >

View File

@@ -121,11 +121,5 @@
\endtable
* See \l{Running on QNX Devices} for limitations.
\note Madde support has been removed from \QC 3.0. To develop for Maemo or Harmattan,
use \QC 2.8.
\note BlackBerry 10 support has been removed from \QC 3.5. Use \QC 3.4 instead.
//! [target platforms]
*/

View File

@@ -101,25 +101,24 @@
\section1 Example of Adding Internal Libraries
The following example describes how to add a statically linked internal
library to your project.
To add an internal library to your project:
\list 1
\li Choose \uicontrol File > \uicontrol {New File or Project} >
\uicontrol Library > \uicontrol {C++ Library} to create the library.
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol Library > \uicontrol {C++ Library}.
The \uicontrol {Introduction and Product Location} dialog opens.
\li Select \uicontrol Choose to open the \uicontrol {Project Location}
dialog.
\image qtcreator-add-library-wizard-ex-1.png "Introduction and Product Location dialog"
\li In the \uicontrol Type field, select \uicontrol {Statically Linked Library}.
\image qtcreator-add-library-wizard-ex-1.png "Project Location dialog"
\li In the \uicontrol Name field, give a name for the library. For example,
\b mylib.
\li Follow the instructions of the wizard until you get to the
\uicontrol {Project Management} dialog. In the \uicontrol {Add to project}
\uicontrol {Project Management} dialog. In the
\uicontrol {Add as a subproject to project}
list, select a project. For example, \b myapp.
\li In the \uicontrol Projects view, right-click the project name to open the
@@ -127,9 +126,10 @@
\uicontrol {Add Library} > \uicontrol {Internal Library} >
\uicontrol Next.
\li In the \uicontrol Library field, select \b mylib and click \uicontrol Next.
\li In the \uicontrol Library field, select \b mylib, and then select
\uicontrol Next.
\li Click \uicontrol Finish to add the following library declaration to the
\li Select \uicontrol Finish to add the following library declaration to the
project file:
\code

View File

@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -43,7 +43,7 @@
to enter the information. If you created the project by using another \QC
instance, \QC asks whether you want to use the old settings. The settings
are specific to the development environment, and should not be copied from
one environment to another. Therefore, we recommend that you click \uicontrol No
one environment to another. Therefore, we recommend that you select \uicontrol No
and enter the information again in the \uicontrol {Configure Project} tab.
The \uicontrol {Configure Project} tab displays a list of \l{glossary-buildandrun-kit}{kits}
@@ -86,8 +86,10 @@
(CMake), \e {.qbs} (Qbs), \e {pyproject} (Python), or
\e {Makefile.am} (Autotools, experimental).
\li In the \uicontrol {Configure Project} tab, select kits for building and running your
project, and click \uicontrol {Configure Project}.
\li In the \uicontrol {Configure Project} tab, select kits for building
and running your project.
\li Select \uicontrol {Configure Project}.
\endlist
@@ -96,16 +98,16 @@
\list
\li In all modes, select \key Ctrl+O (\key Cmd+O on \macos) to open the
\li In all modes, press \key Ctrl+O (\key Cmd+O on \macos) to open the
\uicontrol {Open File} dialog, where you can select a project file
to open a project.
\li In all modes, except the \uicontrol Help mode, select
\li In all modes, except the \uicontrol Help mode, press
\key Ctrl+Shift+O (\key Cmd+Shift+O on \macos) to open the
\uicontrol {Load Project} dialog, where you can select a project
file to open a project.
\li In the \uicontrol Welcome mode, \uicontrol Projects tab, select
\li In the \uicontrol Welcome mode, \uicontrol Projects tab, press
\key Ctrl+Shift+number (\key Cmd+Shift+number on \macos), where
the number is the number of a project in the list of recently opened
projects.

View File

@@ -50,7 +50,8 @@
To set up a project, you first have to decide what kind of an
application you want to develop: do you want a user interface based
on Qt Quick or Qt widgets. Second, you have to choose the
language to implement the application logic: C++ or JavaScript.
language to implement the application logic: C++, JavaScript, or
Python.
\li \l{Using Version Control Systems}

View File

@@ -32,36 +32,47 @@
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol {Application (Qt Quick)} >
\uicontrol {Qt Quick Application - Swipe} > \uicontrol Choose.
\uicontrol {Qt Quick Application - Swipe}.
\li Select \uicontrol Choose to open the
\uicontrol {Project Location} dialog.
\li In the \uicontrol Name field, enter a name for the application.
\li In the \uicontrol {Create in} field, enter the path for the project
files, and then select \uicontrol Next (or \uicontrol Continue on
\macos).
files.
\li Select \uicontrol Next (or \uicontrol Continue on \macos) to open
the \uicontrol {Define Build System} dialog.
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
\li In the \uicontrol {Qt Quick Controls Style} field, select one of
the predefined \l{Styling Qt Quick Controls}{UI styles} to use,
and then select \uicontrol Next.
\li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog.
\li Select \uicontrol Next to use the default settings and to open
the \uicontrol {Translation File} dialog.
\li Select \uicontrol Next to use the default settings and to open
the \uicontrol {Kit Selection} dialog.
\li Select \l{glossary-buildandrun-kit}{kits} for the platforms that
you want to build the application for. To build applications for
mobile devices, select kits for Android ARM and iPhone OS, and
click \uicontrol{Next}.
mobile devices, select kits for Android ARM and iPhone OS.
\note Kits are listed if they have been specified in \uicontrol
Tools > \uicontrol Options > \uicontrol Kits (on Windows and Linux)
or in \uicontrol {\QC} > \uicontrol Preferences >
\uicontrol Kits (on \macos).
For more information, see \l {Adding Kits}.
\li Select \uicontrol Next.
\li Select \uicontrol Next to open the \uicontrol {Project Management}
dialog.
\li Review the project settings, and click \uicontrol{Finish} (or
\uicontrol Done on \macos).
\li Review the project settings, and select \uicontrol{Finish}
(or \uicontrol Done on \macos) to create the project.
\endlist
@@ -71,5 +82,8 @@
in the \uicontrol {Text Editor} to add the application logic. For the
purposes of this example, you can ignore \e Page2Form.ui.qml.
For more information about the settings that you skipped, see
\l{Creating Qt Quick Applications}.
//! [qt quick application]
*/

View File

@@ -100,30 +100,44 @@
\QC creates the necessary boilerplate files. Some of the files are
specific to a particular target platform.
\section1 Creating Empty Qt Quick Applications
\section1 Creating Qt Quick Applications
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol {Application (Qt Quick)} >
\uicontrol {Qt Quick Application - Empty} > \uicontrol Choose.
\uicontrol {Application (Qt Quick)}.
\li Select the application type:
\list
\li \uicontrol {Qt Quick Application - Empty}
\li \uicontrol {Qt Quick Application - Scroll}
\li \uicontrol {Qt Quick Application - Stack}
\li \uicontrol {Qt Quick Application - Swipe}
\endlist
\li Select \uicontrol Choose to open the \uicontrol {Project Location}
dialog.
\li In the \uicontrol Name field, enter a name for the application.
\li In the \uicontrol {Create in} field, enter the path for the project
files, and then select \uicontrol Next (or \uicontrol Continue on
\macos).
files. Select the \uicontrol {Use as default project location} check
box to create new projects in this folder by default.
\li Select \uicontrol Next (or \uicontrol Continue on \macos) to open
the \uicontrol {Define Build System} dialog.
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
\li Select \uicontrol Next.
\li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog.
\li Select the Qt version to
develop with in the \uicontrol {Minimal required Qt version} field.
The Qt version determines the Qt Quick imports that are used in the
QML files.
\li Select the Qt version to develop with in the
\uicontrol {Minimal required Qt version} field.
The Qt version determines the Qt Quick imports
that are used in the QML files.
\li Select the \uicontrol {Use Qt Virtual Keyboard} check box to add
support for \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
@@ -135,7 +149,8 @@
You can use the \l {Installing Qt}{Qt Maintenance Tool} to install
Qt Virtual Keyboard.
\li Select \uicontrol Next.
\li Select \uicontrol Next to open the \uicontrol {Translation File}
dialog.
\li In the \uicontrol Language field, select a language that you plan
to \l {Using Qt Linguist}{translate} the application to. You can
@@ -145,83 +160,42 @@
name for the translation source file that will be generated
for the selected language.
\li Select \uicontrol Next.
\li Select \l{glossary-buildandrun-kit}{kits} for running and building
your project, and then click \uicontrol Next.
\note Kits are listed if they have been specified in
\uicontrol Tools > \uicontrol Options > \uicontrol Kits.
\li Review the project settings, and click \uicontrol Finish (on Windows
and Linux) or \uicontrol Done (on \macos) to create the project.
\endlist
\QC generates a QML file, \e main.qml, that you can modify in the Design
mode.
\include creator-python-project.qdocinc python qml project wizards
\section1 Creating Qt Quick Controls Applications
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol {Application (Qt Quick)} >
\uicontrol {Qt Quick Application - Scroll},
\uicontrol {Qt Quick Application - Stack}, or
\uicontrol {Qt Quick Application - Swipe} > \uicontrol Choose.
\li In the \uicontrol Name field, enter a name for the application.
\li In the \uicontrol {Create in} field, enter the path for the project
files, and then select \uicontrol Next (or \uicontrol Continue on
\macos).
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
\li In the \uicontrol {Qt Quick Controls Style} field, select one of
the predefined \l{Styling Qt Quick Controls}{UI styles} to use,
and then select \uicontrol Next.
\li Select the \uicontrol {Use Qt Virtual Keyboard} check box to add
support for \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
{Qt Virtual Keyboard} to the application.
\note \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
{Qt Virtual Keyboard} is not supported for Android and iOS.
\li Select \uicontrol Next to open the \uicontrol {Kit Selection}
dialog.
\li Select \l{glossary-buildandrun-kit}{kits} for the platforms that
you want to build the application for. To build applications for
mobile devices, select kits for Android ARM and iOS, and
click \uicontrol{Next}.
you want to build the application for.
\note Kits are listed if they have been specified in \uicontrol
Tools > \uicontrol Options > \uicontrol Kits (on Windows and Linux)
or in \uicontrol {\QC} > \uicontrol Preferences >
\uicontrol Kits (on \macos).
For more information, see \l {Adding Kits}.
\li Select \uicontrol Next.
\li Select \uicontrol Next to open the \uicontrol {Project Management}
dialog.
\li Review the project settings, and click \uicontrol{Finish} (or
\uicontrol Done on \macos).
\li Review the project settings, and select \uicontrol Finish
(on Windows and Linux) or \uicontrol Done (on \macos) to
create the project.
\endlist
For the Scroll application, \QC creates a QML file, \e main.qml, that you
can modify in the Design mode.
For the Empty and Scroll applications, \QC creates a QML file,
\e main.qml, that you can modify in the \uicontrol {Form Editor}
or the \uicontrol {Text Editor}.
For the Stack and Swipe applications, \QC generates two UI files,
\e Page1Form.ui.qml and \e Page2Form.ui.qml, that you can modify in the
\uicontrol {Form Editor} and a QML file, \e main.qml, that you can
modify in the \uicontrol {Text Editor} to add the application logic.
\include creator-python-project.qdocinc python qml project wizards
\section1 Creating Qt Quick UI Projects
Qt Quick UI projects are useful for testing or prototyping user interfaces,
Qt Quick UI Prototype projects are useful for testing or prototyping user
interfaces,
or for setting up a separate project just for QML editing, for example. You
cannot use them for application development, because they do not contain:
@@ -232,13 +206,28 @@
{devices}
\endlist
To create a Qt Quick UI project:
For more information about how to turn Qt Quick UI Prototype projects into
Qt Quick Application projects, see
\l{Converting UI Projects to Applications}.
To create a Qt Quick UI Prototype project:
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol {Other Project} > \uicontrol {Qt Quick UI Prototype} >
\uicontrol Choose.
\uicontrol {Other Project} > \uicontrol {Qt Quick UI Prototype}.
\li Select \uicontrol Choose to open the \uicontrol {Project Location}
dialog.
\li In the \uicontrol Name field, enter a name for the application.
\li In the \uicontrol {Create in} field, enter the path for the project
files. Select the \uicontrol {Use as default project location} check
box to create new projects in this folder by default.
\li Select \uicontrol Next (or \uicontrol Continue on \macos) to open
the \uicontrol {Define Project Details} dialog.
\li In the \uicontrol {Minimal required Qt version} field, select the Qt
version to develop with. The Qt version determines the Qt Quick
@@ -252,10 +241,30 @@
support for \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
{Qt Virtual Keyboard} to the application.
\li Select \uicontrol Next (or \uicontrol Continue on \macos).
\note If you have not installed the Qt Virtual Keyboard module when
you installed Qt, an error message will appear when you try to open
the \e main.qml in the \uicontrol {Form Editor} in the Design mode.
You can use the \l {Installing Qt}{Qt Maintenance Tool} to install
Qt Virtual Keyboard.
\li Review the project settings, and click \uicontrol Finish (on Windows
and Linux) or \uicontrol Done (on \macos) to create the project.
\li Select \uicontrol Next to open the \uicontrol {Kit Selection}
dialog.
\li Select \l{glossary-buildandrun-kit}{kits} for the platforms that
you want to build the application for.
\note Kits are listed if they have been specified in \uicontrol
Tools > \uicontrol Options > \uicontrol Kits (on Windows and Linux)
or in \uicontrol {\QC} > \uicontrol Preferences >
\uicontrol Kits (on \macos).
For more information, see \l {Adding Kits}.
\li Select \uicontrol Next to open the \uicontrol {Project Management}
dialog.
\li Review the project settings, and select \uicontrol Finish
(on Windows and Linux) or \uicontrol Done (on \macos) to
create the project.
\endlist

View File

@@ -96,18 +96,38 @@
To display the versioning history of a file, select \uicontrol{Log of}.
The log output contains the date, the commit message, and a commit
identifier. Click on the commit identifier to display a description
of the change including the diff in the \uicontrol {Git Show} view.
identifier. Click on the commit identifier to view commit details.
\image qtcreator-vcs-show.png
\image qtcreator-git-log.png "Commit details in Git log"
Right-clicking on a commit identifier brings up a context menu that lets
you apply actions on the commit, such as view annotations or cherry-pick
or revert a commit.
or revert a commit. For more information, see \l{Working with Branches}.
To toggle the diff view, select \uicontrol Diff. To use the patience
algorithm for calculating the differences, select \uicontrol Patience.
To only show text changes, select \uicontrol {Ignore Whitespace}.
To filter log entries by the text in the commit message or by strings that
were added or removed, select \uicontrol Filter.
To follow only the first parent on merge commits, select
\uicontrol {First Parent}.
To toggle between textual and visual representation of the log, select
\uicontrol Graph.
To show log also for previous names of the file, select \uicontrol Follow.
Select \inlineimage reload_gray.png
(\uicontrol Reload) to rescan the files.
To display a description of the change including the diff in the
\uicontrol {Git Show} view, select \uicontrol {Describe Change} in the
context menu.
\image qtcreator-vcs-show.png "Commit description in Git show"
\section2 Viewing Annotations
To view annotations, select \uicontrol{Blame}. The view displays the lines
@@ -174,7 +194,9 @@
\section2 Viewing Git Status
To view the status of the repository in the \uicontrol {Version Control}
output view, select \uicontrol Status.
output pane, select \uicontrol Status. The context menu contains additional
actions, such as selecting and clearing all entries in the pane, copying
text, and opening files.
\section2 Committing Changes to Git
@@ -226,6 +248,13 @@
\uicontrol {Interactive Rebase}. You can reorder or discard commits, squash
them into a single commit, or edit the commit messages.
If you already pushed the local changes to a remote, \QC refuses
the interactive rebase because the local commits are missing. To
start the interactive rebase from the change log, select
\uicontrol Branches > \uicontrol Log. Select the change, and then
select > \uicontrol {Interactive Rebase from Change} in the context
menu.
\section2 Working with Branches
To work with Git branches, select \uicontrol {Branches}. The checked out
@@ -239,6 +268,10 @@
(\uicontrol {Filter Tree}), and then select
\uicontrol {Include Old Entries} and \uicontrol {Include Tags}.
To add a tag to a change in the change log, select \uicontrol Branches >
\uicontrol Log. Select the change, and then select > \uicontrol {Add Tag
for Change} in the context menu.
If you checked out a specific commit, the list of branches displays a
\e {Detached HEAD} entry.
@@ -422,6 +455,8 @@
to perform a rebase operation while pulling.
To push committed changes to the remote repository, select \uicontrol Push.
If the local branch does not have an upstream branch in the remote
repository, \QC prompts you to create it and set it as upstream.
\section2 Managing Remote Repositories

View File

@@ -49,7 +49,7 @@
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol Application > \uicontrol {Qt Widgets Application} >
\uicontrol Application (Qt) > \uicontrol {Qt Widgets Application} >
\uicontrol Choose.
\image qtcreator-new-qt-gui-application.png "New File or Project dialog"
@@ -61,20 +61,16 @@
\li In the \uicontrol{Name} field, type \b {TextFinder}.
\li In the \uicontrol {Create in} field, enter the path for the project files.
For example, \c {C:\Qt\examples}, and then click \uicontrol{Next} (on
For example, \c {C:\Qt\examples}, and then select \uicontrol{Next} (on
Windows and Linux) or \uicontrol Continue (on \macos).
The \uicontrol {Kit Selection} dialog opens.
The \uicontrol {Define Build System} dialog opens.
\image qtcreator-new-project-qt-versions-qt-gui.png "Kit Selection dialog"
\image qtcreator-new-project-build-system-qt-gui.png "Define Build System dialog"
\li Select build and run \l{glossary-buildandrun-kit}{kits} for your project,
and click \uicontrol Next or \uicontrol Continue.
\note If only one kit is specified in \uicontrol Tools >
\uicontrol Options > \uicontrol Kits (on Windows and Linux) or in
\uicontrol {\QC} > \uicontrol Preferences > \uicontrol Kits
(on \macos), this dialog is skipped.
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
The \uicontrol{Class Information} dialog opens.
@@ -89,13 +85,20 @@
\note The \uicontrol{Header file}, \uicontrol{Source file} and \uicontrol{Form file}
fields are automatically updated to match the name of the class.
\li Click \uicontrol Next or \uicontrol Continue.
The \uicontrol {Kit Selection} dialog opens.
\image qtcreator-new-project-qt-versions-qt-gui.png "Kit Selection dialog"
\li Select build and run \l{glossary-buildandrun-kit}{kits} for your project,
and select \uicontrol Next or \uicontrol Continue.
\li Select \uicontrol Next or \uicontrol Continue.
The \uicontrol{Project Management} dialog opens.
\image qtcreator-new-project-summary-qt-gui.png "Project Management dialog"
\li Review the project settings, and click \uicontrol{Finish} (on Windows and
\li Review the project settings, and select \uicontrol{Finish} (on Windows and
Linux) or \uicontrol Done (on \macos) to create the project.
\endlist
@@ -107,9 +110,9 @@
\list
\li main.cpp
\li textfinder.h
\li textfinder.cpp
\li main.cpp
\li textfinder.ui
\li textfinder.pro
@@ -150,7 +153,7 @@
\uicontrol Sidebar. For example, to find the \uicontrol Label widget, start typing
the word \b label.
\image qtcreator-texfinder-filter.png "Filter field"
\image qtcreator-textfinder-filter.png "Filter field"
\li Double-click the \uicontrol{Label} widget and enter the text
\b{Keyword}.
@@ -164,23 +167,23 @@
\image qtcreator-textfinder-objectname.png "Changing object names"
\li Press \key {Ctrl+A} (or \key {Cmd+A}) to select the widgets and
click \uicontrol{Lay out Horizontally} (or press \uicontrol{Ctrl+H} on Linux or
select \uicontrol{Lay out Horizontally} (or press \key {Ctrl+H} on Linux or
Windows or \key {Ctrl+Shift+H} on \macos) to apply a horizontal
layout (QHBoxLayout).
\image qtcreator-texfinder-ui-horizontal-layout.png "Applying horizontal layout"
\image qtcreator-textfinder-ui-horizontal-layout.png "Applying horizontal layout"
\li Drag and drop a \uicontrol{Text Edit} widget (QTextEdit) to the form.
\li Select the screen area and click \uicontrol{Lay out Vertically} (or press
\uicontrol{Ctrl+L}) to apply a vertical layout (QVBoxLayout).
\li Select the screen area, and then select \uicontrol{Lay out Vertically}
(or press \key {Ctrl+L}) to apply a vertical layout (QVBoxLayout).
\image qtcreator-textfinder-ui.png "Text Finder UI"
Applying the horizontal and vertical layouts ensures that the
application UI scales to different screen sizes.
\li To call a find function when users press the \uicontrol Find button, you
\li To call a find function when users select the \uicontrol Find button, you
use the Qt signals and slots mechanism. A signal is emitted when a
particular event occurs and a slot is a function that is called in
response to a particular signal. Qt widgets have predefined signals
@@ -201,7 +204,7 @@
\endlist
\li Press \uicontrol{Ctrl+S} (or \key {Cmd+S}) to save your changes.
\li Press \key {Ctrl+S} (or \key {Cmd+S}) to save your changes.
\endlist
@@ -295,7 +298,7 @@
\li In the \uicontrol{Name} field, enter \b{textfinder}.
\li In the \uicontrol{Path} field, enter \c{C:\Qt\examples\TextFinder},
and click \uicontrol Next or \uicontrol Continue.
and select \uicontrol Next or \uicontrol Continue.
The \uicontrol{Project Management} dialog opens.
@@ -303,8 +306,8 @@
\li In the \uicontrol{Add to project} field, select \b{TextFinder.pro}
and click \uicontrol{Finish} or \uicontrol Done to open the file in the code
editor.
and select \uicontrol{Finish} or \uicontrol Done to open the file
in the code editor.
\li Select \uicontrol Add > \uicontrol {Add Prefix}.
@@ -320,7 +323,7 @@
\section1 Compiling and Running Your Program
Now that you have all the necessary files, click the
Now that you have all the necessary files, select the
\inlineimage run_small.png
button to compile and run your program.

File diff suppressed because it is too large Load Diff

View File

@@ -214,10 +214,6 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
readSignalOrMethod(component, name == QLatin1String("Method"), fmo);
else if (name == QLatin1String("Enum"))
readEnum(component, fmo);
else
addWarning(component->firstSourceLocation(),
tr("Expected only Property, Method, Signal and Enum object definitions, not \"%1\".")
.arg(name));
} else if (script) {
QString name = toString(script->qualifiedId);
if (name == QLatin1String("name")) {
@@ -238,14 +234,7 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
fmo->setIsCreatable(readBoolBinding(script));
} else if (name == QLatin1String("isComposite")) {
fmo->setIsComposite(readBoolBinding(script));
} else {
addWarning(script->firstSourceLocation(),
tr("Expected only name, prototype, defaultProperty, attachedType, exports, "
"isSingleton, isCreatable, isComposite and exportMetaObjectRevisions "
"script bindings, not \"%1\".").arg(name));
}
} else {
addWarning(member->firstSourceLocation(), tr("Expected only script bindings and object definitions."));
}
}
@@ -276,12 +265,7 @@ void TypeDescriptionReader::readModuleApi(UiObjectDefinition *ast)
apiInfo.version = readNumericVersionBinding(script);
} else if (name == QLatin1String("name")) {
apiInfo.cppName = readStringBinding(script);
} else {
addWarning(script->firstSourceLocation(),
tr("Expected only uri, version and name script bindings."));
}
} else {
addWarning(member->firstSourceLocation(), tr("Expected only script bindings."));
}
}
@@ -311,8 +295,6 @@ void TypeDescriptionReader::readSignalOrMethod(UiObjectDefinition *ast, bool isM
QString name = toString(component->qualifiedTypeNameId);
if (name == QLatin1String("Parameter"))
readParameter(component, &fmm);
else
addWarning(component->firstSourceLocation(), tr("Expected only Parameter object definitions."));
} else if (script) {
QString name = toString(script->qualifiedId);
if (name == QLatin1String("name"))
@@ -321,11 +303,6 @@ void TypeDescriptionReader::readSignalOrMethod(UiObjectDefinition *ast, bool isM
fmm.setReturnType(readStringBinding(script));
else if (name == QLatin1String("revision"))
fmm.setRevision(readIntBinding(script));
else
addWarning(script->firstSourceLocation(), tr("Expected only name and type script bindings."));
} else {
addWarning(member->firstSourceLocation(), tr("Expected only script bindings and object definitions."));
}
}
@@ -367,8 +344,6 @@ void TypeDescriptionReader::readProperty(UiObjectDefinition *ast, FakeMetaObject
isList = readBoolBinding(script);
else if (id == QLatin1String("revision"))
revision = readIntBinding(script);
else
addWarning(script->firstSourceLocation(), tr("Expected only type, name, revision, isPointer, isReadonly and isList script bindings."));
}
if (name.isEmpty() || type.isEmpty()) {
@@ -396,8 +371,6 @@ void TypeDescriptionReader::readEnum(UiObjectDefinition *ast, FakeMetaObject::Pt
fme.setName(readStringBinding(script));
else if (name == QLatin1String("values"))
readEnumValues(script, &fme);
else
addWarning(script->firstSourceLocation(), tr("Expected only name and values script bindings."));
}
fmo->addEnum(fme);
@@ -427,8 +400,6 @@ void TypeDescriptionReader::readParameter(UiObjectDefinition *ast, FakeMetaMetho
// ### unhandled
} else if (id == QLatin1String("isList")) {
// ### unhandled
} else {
addWarning(script->firstSourceLocation(), tr("Expected only name and type script bindings."));
}
}

View File

@@ -285,14 +285,9 @@ void AndroidSdkModel::selectMissingEssentials()
if (!pendingPkgs.contains((*tool)->sdkStylePath()))
continue;
if ((*tool)->type() == AndroidSdkPackage::PlatformToolsPackage)
addTool(tool); // Select Platform tools
else if ((*tool)->type() == AndroidSdkPackage::BuildToolsPackage)
addTool(tool); // Select build tools
else if ((*tool)->type() == AndroidSdkPackage::NDKPackage)
addTool(tool); // Select NDK Bundle
addTool(tool);
pendingPkgs.removeOne((*tool)->sdkStylePath());
if (pendingPkgs.isEmpty())
break;
}

View File

@@ -820,7 +820,7 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
const QString openSslRepo("https://github.com/KDAB/android_openssl.git");
Utils::QtcProcess *gitCloner = new Utils::QtcProcess(this);
gitCloner->setCommand(Utils::CommandLine("git", {"clone", openSslRepo, openSslPath.fileName()}));
gitCloner->setCommand(Utils::CommandLine("git", {"clone", "--depth=1", openSslRepo, openSslPath.fileName()}));
gitCloner->setWorkingDirectory(openSslPath.parentDir().toString());
QDir openSslDir(openSslPath.toString());

View File

@@ -212,6 +212,8 @@ bool QuickTestAstVisitor::visit(CPlusPlus::CallAST *ast)
if (expressionListAST && expressionListAST->value) {
const auto *stringLitAST = expressionListAST->value->asStringLiteral();
if (!stringLitAST)
return false;
const auto *string
= translationUnit()->stringLiteral(stringLitAST->literal_token);
if (string) {

View File

@@ -312,11 +312,10 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
const FilePath &sourceDirectory)
{
RawProjectParts rpps;
const QDir sourceDir(sourceDirectory.toString());
int counter = 0;
for (const TargetDetails &t : input.targetDetails) {
QDir sourceDir(sourceDirectory.toString());
bool needPostfix = t.compileGroups.size() > 1;
int count = 1;
for (const CompileInfo &ci : t.compileGroups) {
@@ -359,14 +358,15 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
cxxProjectFlags.commandLineFlags = cProjectFlags.commandLineFlags;
rpp.setFlagsForCxx(cxxProjectFlags);
FilePath precompiled_header
= FilePath::fromString(findOrDefault(t.sources, [&ending](const SourceInfo &si) {
return si.path.endsWith(ending);
}).path);
FilePath precompiled_header = FilePath::fromString(
findOrDefault(t.sources, [&ending](const SourceInfo &si) {
return si.path.endsWith(ending);
}).path);
rpp.setFiles(transform<QList>(ci.sources, [&t, &sourceDir](const int si) {
return sourceDir.absoluteFilePath(t.sources[static_cast<size_t>(si)].path);
}));
if (!precompiled_header.isEmpty()) {
if (precompiled_header.toFileInfo().isRelative()) {
const FilePath parentDir = FilePath::fromString(sourceDir.absolutePath());
@@ -381,6 +381,22 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
rpps.append(rpp);
++count;
}
// Check sources for more files and associate them with the current target
const QStringList extraSources = Utils::transform<QList>(
Utils::filtered(t.sources, [](const SourceInfo &si) { return si.compileGroup == -1; }),
[&sourceDir](const SourceInfo &si) { return sourceDir.absoluteFilePath(si.path); });
if (!extraSources.isEmpty()) {
RawProjectPart rpp;
rpp.setProjectFileLocation(t.sourceDir.pathAppended("CMakeLists.txt").toString());
rpp.setBuildSystemTarget(t.name);
rpp.setDisplayName(t.id + "_extra");
rpp.setFiles(extraSources);
// This is all the information we have :-/
rpps.append(rpp);
}
}
return rpps;

View File

@@ -27,18 +27,21 @@
#include "mcusupportoptions.h"
#include "mcusupportsdk.h"
#include <cmakeprojectmanager/cmaketoolmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
#include <cmakeprojectmanager/cmakekitinformation.h>
#include <debugger/debuggeritem.h>
#include <debugger/debuggeritemmanager.h>
#include <debugger/debuggerkitinformation.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
@@ -182,7 +185,7 @@ void McuPackage::updateStatus()
const Utils::FilePath detectionPath = Utils::FilePath::fromString(
m_fileChooser->filePath().toString() + "/" + m_detectionPath);
const QString displayDetectionPath = Utils::FilePath::fromString(m_detectionPath).toUserOutput();
const bool validPackage = detectionPath.exists();
const bool validPackage = m_detectionPath.isEmpty() || detectionPath.exists();
m_status = validPath ? (validPackage ? ValidPackage : ValidPathInvalidPackage) : InvalidPath;
@@ -192,7 +195,9 @@ void McuPackage::updateStatus()
QString statusText;
switch (m_status) {
case ValidPackage:
statusText = tr("Path is valid, \"%1\" was found.").arg(displayDetectionPath);
statusText = m_detectionPath.isEmpty()
? "Path exists." // TODO tr()
: tr("Path is valid, \"%1\" was found.").arg(displayDetectionPath);
break;
case ValidPathInvalidPackage:
statusText = tr("Path exists, but does not contain \"%1\".").arg(displayDetectionPath);
@@ -217,6 +222,22 @@ McuToolChainPackage::Type McuToolChainPackage::type() const
return m_type;
}
static ProjectExplorer::ToolChain *desktopToolChain(Core::Id language)
{
using namespace ProjectExplorer;
ToolChain *toolChain = ToolChainManager::toolChain([language](const ToolChain *t) {
const Abi abi = t->targetAbi();
return (abi.os() != Abi::WindowsOS
|| (abi.osFlavor() == Abi::WindowsMsvc2017Flavor
|| abi.osFlavor() == Abi::WindowsMsvc2019Flavor))
&& abi.architecture() == Abi::X86Architecture
&& abi.wordWidth() == 64
&& t->language() == language;
});
return toolChain;
}
static ProjectExplorer::ToolChain* armGccToolChain(const Utils::FilePath &path, Core::Id language)
{
using namespace ProjectExplorer;
@@ -245,24 +266,30 @@ static ProjectExplorer::ToolChain* armGccToolChain(const Utils::FilePath &path,
ProjectExplorer::ToolChain *McuToolChainPackage::toolChain(Core::Id language) const
{
const QLatin1String compilerName(
language == ProjectExplorer::Constants::C_LANGUAGE_ID ? "gcc" : "g++");
const Utils::FilePath compiler = Utils::FilePath::fromUserInput(
Utils::HostOsInfo::withExecutableSuffix(
path() + (
m_type == TypeArmGcc
? "/bin/arm-none-eabi-%1" : m_type == TypeIAR
? "/foo/bar-iar-%1" : "/bar/foo-keil-%1")).arg(compilerName));
ProjectExplorer::ToolChain *tc = nullptr;
if (m_type == TypeDesktop) {
tc = desktopToolChain(language);
} else {
const QLatin1String compilerName(
language == ProjectExplorer::Constants::C_LANGUAGE_ID ? "gcc" : "g++");
const Utils::FilePath compiler = Utils::FilePath::fromUserInput(
Utils::HostOsInfo::withExecutableSuffix(
path() + (
m_type == TypeArmGcc
? "/bin/arm-none-eabi-%1" : m_type == TypeIAR
? "/foo/bar-iar-%1" : "/bar/foo-keil-%1")).arg(compilerName));
ProjectExplorer::ToolChain *tc = armGccToolChain(compiler, language);
tc = armGccToolChain(compiler, language);
}
return tc;
}
QString McuToolChainPackage::cmakeToolChainFileName() const
{
return QLatin1String(m_type == TypeArmGcc
? "armgcc.cmake" : m_type == McuToolChainPackage::TypeIAR
? "iar.cmake" : "keil.cmake");
? "armgcc" : m_type == McuToolChainPackage::TypeIAR
? "iar" : m_type == McuToolChainPackage::TypeKEIL
? "keil" : "ghs") + QLatin1String(".cmake");
}
QVariant McuToolChainPackage::debuggerId() const
@@ -429,11 +456,6 @@ Utils::FilePath McuSupportOptions::qulDirFromSettings()
packagePathFromSettings(Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK));
}
static bool mcuTargetIsDesktop(const McuTarget* mcuTarget)
{
return mcuTarget->qulPlatform() == "Qt";
}
static Utils::FilePath jomExecutablePath()
{
return Utils::HostOsInfo::isWindowsHost() ?
@@ -453,21 +475,23 @@ static void setKitProperties(const QString &kitName, ProjectExplorer::Kit *k,
McuSupportOptions::supportedQulVersion().toString());
k->setAutoDetected(true);
k->makeSticky();
if (mcuTargetIsDesktop(mcuTarget)) {
if (mcuTarget->toolChainPackage()->type() == McuToolChainPackage::TypeDesktop)
k->setDeviceTypeForIcon(Constants::DEVICE_TYPE);
} else {
QSet<Core::Id> irrelevant = {
SysRootKitAspect::id(),
"QtSupport.QtInformation" // QtKitAspect::id()
};
if (jomExecutablePath().exists()) // TODO: add id() getter to CMakeGeneratorKitAspect
irrelevant.insert("CMake.GeneratorKitInformation");
k->setIrrelevantAspects(irrelevant);
}
QSet<Core::Id> irrelevant = {
SysRootKitAspect::id(),
QtSupport::QtKitAspect::id()
};
if (jomExecutablePath().exists()) // TODO: add id() getter to CMakeGeneratorKitAspect
irrelevant.insert("CMake.GeneratorKitInformation");
k->setIrrelevantAspects(irrelevant);
}
static void setKitToolchains(ProjectExplorer::Kit *k, const McuToolChainPackage *tcPackage)
{
// No Green Hills toolchain, because support for it is missing.
if (tcPackage->type() == McuToolChainPackage::TypeGHS)
return;
ProjectExplorer::ToolChainKitAspect::setToolChain(k, tcPackage->toolChain(
ProjectExplorer::Constants::C_LANGUAGE_ID));
ProjectExplorer::ToolChainKitAspect::setToolChain(k, tcPackage->toolChain(
@@ -476,11 +500,22 @@ static void setKitToolchains(ProjectExplorer::Kit *k, const McuToolChainPackage
static void setKitDebugger(ProjectExplorer::Kit *k, const McuToolChainPackage *tcPackage)
{
// Qt Creator seems to be smart enough to deduce the right Kit debugger from the ToolChain
// We rely on that at least in the Desktop case.
if (tcPackage->type() == McuToolChainPackage::TypeDesktop
// No Green Hills debugger, because support for it is missing.
|| tcPackage->type() == McuToolChainPackage::TypeGHS)
return;
Debugger::DebuggerKitAspect::setDebugger(k, tcPackage->debuggerId());
}
static void setKitDevice(ProjectExplorer::Kit *k)
static void setKitDevice(ProjectExplorer::Kit *k, const McuTarget* mcuTarget)
{
// "Device Type" Desktop is the default. We use that for the Qt for MCUs Desktop Kit
if (mcuTarget->toolChainPackage()->type() == McuToolChainPackage::TypeDesktop)
return;
ProjectExplorer::DeviceTypeKitAspect::setDeviceTypeId(k, Constants::DEVICE_TYPE);
}
@@ -492,6 +527,13 @@ static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarge
Utils::EnvironmentItems changes;
QStringList pathAdditions;
// The Desktop version depends on the Qt shared libs in Qul_DIR/bin.
// If CMake's fileApi is avaialble, we can rely on the "Add library search path to PATH"
// feature of the run configuration. Otherwise, we just prepend the path, here.
if (mcuTarget->toolChainPackage()->type() == McuToolChainPackage::TypeDesktop
&& !CMakeProjectManager::CMakeToolManager::defaultCMakeTool()->hasFileApi())
pathAdditions.append(QDir::toNativeSeparators(qtForMCUsSdkPackage->path() + "/bin"));
QVector<McuPackage *> packagesIncludingSdk;
packagesIncludingSdk.reserve(mcuTarget->packages().size() + 1);
packagesIncludingSdk.append(mcuTarget->packages());
@@ -517,9 +559,12 @@ static void setKitCMakeOptions(ProjectExplorer::Kit *k, const McuTarget* mcuTarg
using namespace CMakeProjectManager;
CMakeConfig config = CMakeConfigurationKitAspect::configuration(k);
config.append(CMakeConfigItem("CMAKE_CXX_COMPILER", "%{Compiler:Executable:Cxx}"));
config.append(CMakeConfigItem("CMAKE_C_COMPILER", "%{Compiler:Executable:C}"));
if (mcuTarget->toolChainPackage())
// CMake ToolChain file for ghs handles CMAKE_*_COMPILER autonomously
if (mcuTarget->toolChainPackage()->type() != McuToolChainPackage::TypeGHS) {
config.append(CMakeConfigItem("CMAKE_CXX_COMPILER", "%{Compiler:Executable:Cxx}"));
config.append(CMakeConfigItem("CMAKE_C_COMPILER", "%{Compiler:Executable:C}"));
}
if (mcuTarget->toolChainPackage()->type() != McuToolChainPackage::TypeDesktop)
config.append(CMakeConfigItem(
"CMAKE_TOOLCHAIN_FILE",
(qulDir + "/lib/cmake/Qul/toolchain/"
@@ -528,8 +573,6 @@ static void setKitCMakeOptions(ProjectExplorer::Kit *k, const McuTarget* mcuTarg
(qulDir + "/lib/cmake/Qul/QulGenerators.cmake").toUtf8()));
config.append(CMakeConfigItem("QUL_PLATFORM",
mcuTarget->qulPlatform().toUtf8()));
if (mcuTargetIsDesktop(mcuTarget))
config.append(CMakeConfigItem("CMAKE_PREFIX_PATH", "%{Qt:QT_INSTALL_PREFIX}"));
if (mcuTarget->colorDepth() >= 0)
config.append(CMakeConfigItem("QUL_COLOR_DEPTH",
QString::number(mcuTarget->colorDepth()).toLatin1()));
@@ -541,14 +584,24 @@ static void setKitCMakeOptions(ProjectExplorer::Kit *k, const McuTarget* mcuTarg
CMakeConfigurationKitAspect::setConfiguration(k, config);
}
static void setKitQtVersionOptions(ProjectExplorer::Kit *k)
{
QtSupport::QtKitAspect::setQtVersion(k, nullptr);
}
QString McuSupportOptions::kitName(const McuTarget *mcuTarget) const
{
// TODO: get version from qulSdkPackage and insert into name
const QString colorDepth = mcuTarget->colorDepth() > 0
? QString::fromLatin1(" %1bpp").arg(mcuTarget->colorDepth())
: "";
// Hack: Use the platform name in the kit name. Exception for the "Qt" platform: use "Desktop"
const QString targetName =
mcuTarget->toolChainPackage()->type() == McuToolChainPackage::TypeDesktop
? "Desktop"
: mcuTarget->qulPlatform();
return QString::fromLatin1("Qt for MCUs %1 - %2%3")
.arg(supportedQulVersion().toString(), mcuTarget->qulPlatform(), colorDepth);
.arg(supportedQulVersion().toString(), targetName, colorDepth);
}
QList<ProjectExplorer::Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTargt)
@@ -568,13 +621,12 @@ ProjectExplorer::Kit *McuSupportOptions::newKit(const McuTarget *mcuTarget)
KitGuard kitGuard(k);
setKitProperties(kitName(mcuTarget), k, mcuTarget);
if (!mcuTargetIsDesktop(mcuTarget)) {
setKitToolchains(k, mcuTarget->toolChainPackage());
setKitDebugger(k, mcuTarget->toolChainPackage());
setKitDevice(k);
}
setKitDevice(k, mcuTarget);
setKitToolchains(k, mcuTarget->toolChainPackage());
setKitDebugger(k, mcuTarget->toolChainPackage());
setKitEnvironment(k, mcuTarget, qtForMCUsSdkPackage);
setKitCMakeOptions(k, mcuTarget, qtForMCUsSdkPackage->path());
setKitQtVersionOptions(k);
k->setup();
k->fix();

View File

@@ -109,7 +109,9 @@ public:
enum Type {
TypeArmGcc,
TypeIAR,
TypeKEIL
TypeKEIL,
TypeGHS,
TypeDesktop
};
McuToolChainPackage(const QString &label, const QString &defaultPath,

View File

@@ -60,6 +60,11 @@ McuPackage *createQtForMCUsPackage()
return result;
}
static McuToolChainPackage *createDesktopToolChainPackage()
{
return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::TypeDesktop);
}
static McuToolChainPackage *createArmGccPackage()
{
const char envVar[] = "ARMGCC_DIR";
@@ -93,6 +98,50 @@ static McuToolChainPackage *createArmGccPackage()
return result;
}
static McuToolChainPackage *createGhsToolchainPackage()
{
const char envVar[] = "GHS_COMPILER_DIR";
const QString defaultPath =
qEnvironmentVariableIsSet(envVar) ? qEnvironmentVariable(envVar) : QDir::homePath();
auto result = new McuToolChainPackage(
"Green Hills Compiler",
defaultPath,
Utils::HostOsInfo::withExecutableSuffix("ccv850"),
"GHSToolchain",
McuToolChainPackage::TypeGHS);
result->setEnvironmentVariableName(envVar);
return result;
}
static McuPackage *createRGLPackage()
{
const char envVar[] = "RGL_DIR";
QString defaultPath;
if (qEnvironmentVariableIsSet(envVar)) {
defaultPath = qEnvironmentVariable(envVar);
} else if (Utils::HostOsInfo::isWindowsHost()) {
defaultPath = QDir::rootPath() + "Renesas_Electronics/D1x_RGL";
if (QFileInfo::exists(defaultPath)) {
const QFileInfoList subDirs =
QDir(defaultPath).entryInfoList({QLatin1String("rgl_ghs_D1Mx_*")},
QDir::Dirs | QDir::NoDotAndDotDot);
if (subDirs.count() == 1)
defaultPath = subDirs.first().filePath() + '/';
}
}
auto result = new McuPackage(
"Renesas Graphics Library",
defaultPath,
{},
"RGL");
result->setEnvironmentVariableName(envVar);
return result;
}
static McuPackage *createStm32CubeFwF7SdkPackage()
{
auto result = new McuPackage(
@@ -140,21 +189,34 @@ static McuPackage *createEvkbImxrt1050SdkPackage()
return result;
}
static McuPackage *createSeggerJLinkPackage()
static McuPackage *createMcuXpressoIdePackage()
{
QString defaultPath = QString("%{Env:SEGGER_JLINK_SOFTWARE_AND_DOCUMENTATION_PATH}");
if (Utils::HostOsInfo::isWindowsHost()) {
const QString programPath = findInProgramFiles("/SEGGER/JLink");
if (!programPath.isEmpty())
defaultPath = programPath;
const char envVar[] = "MCUXpressoIDE_PATH";
QString defaultPath;
if (qEnvironmentVariableIsSet(envVar)) {
defaultPath = qEnvironmentVariable(envVar);
} else if (Utils::HostOsInfo::isWindowsHost()) {
defaultPath = QDir::rootPath() + "nxp";
if (QFileInfo::exists(defaultPath)) {
// If default dir has exactly one sub dir that could be the IDE path, pre-select that.
const QFileInfoList subDirs =
QDir(defaultPath).entryInfoList({QLatin1String("MCUXpressoIDE*")},
QDir::Dirs | QDir::NoDotAndDotDot);
if (subDirs.count() == 1)
defaultPath = subDirs.first().filePath() + '/';
}
} else {
defaultPath = "/usr/local/mcuxpressoide/";
}
auto result = new McuPackage(
McuPackage::tr("SEGGER JLink"),
"MCUXpresso IDE",
defaultPath,
Utils::HostOsInfo::withExecutableSuffix("JLink"),
"SeggerJLink");
result->setDownloadUrl("https://www.segger.com/downloads/jlink");
result->setEnvironmentVariableName("SEGGER_JLINK_SOFTWARE_AND_DOCUMENTATION_PATH");
Utils::HostOsInfo::withExecutableSuffix("ide/binaries/crt_emu_cm_redlink"),
"MCUXpressoIDE");
result->setDownloadUrl("https://www.nxp.com/mcuxpresso/ide");
result->setEnvironmentVariableName(envVar);
return result;
}
@@ -162,21 +224,25 @@ void hardcodedTargetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage
QVector<McuTarget *> *mcuTargets)
{
McuToolChainPackage* armGccPackage = Sdk::createArmGccPackage();
McuToolChainPackage *ghsToolchainPackage = createGhsToolchainPackage();
McuToolChainPackage* desktopToolChainPackage = createDesktopToolChainPackage();
McuPackage* stm32CubeFwF7SdkPackage = Sdk::createStm32CubeFwF7SdkPackage();
McuPackage* stm32CubeProgrammerPackage = Sdk::createStm32CubeProgrammerPackage();
McuPackage* evkbImxrt1050SdkPackage = Sdk::createEvkbImxrt1050SdkPackage();
McuPackage* seggerJLinkPackage = Sdk::createSeggerJLinkPackage();
McuPackage *mcuXpressoIdePackage = createMcuXpressoIdePackage();
McuPackage *rglPackage = createRGLPackage();
QVector<McuPackage*> stmEvalPackages = {
armGccPackage, stm32CubeProgrammerPackage};
QVector<McuPackage*> nxpEvalPackages = {
armGccPackage, seggerJLinkPackage};
armGccPackage, mcuXpressoIdePackage};
QVector<McuPackage*> renesasEvalPackages = {
armGccPackage, seggerJLinkPackage};
ghsToolchainPackage, rglPackage};
QVector<McuPackage*> desktopPackages = {};
*packages = {
armGccPackage, stm32CubeFwF7SdkPackage, stm32CubeProgrammerPackage, evkbImxrt1050SdkPackage,
seggerJLinkPackage};
armGccPackage, desktopToolChainPackage, ghsToolchainPackage,
stm32CubeFwF7SdkPackage, stm32CubeProgrammerPackage, evkbImxrt1050SdkPackage,
mcuXpressoIdePackage, rglPackage};
const QString vendorStm = "STM";
const QString vendorNxp = "NXP";
@@ -192,8 +258,8 @@ void hardcodedTargetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage
} targets[] = {
{vendorNxp, {"MIMXRT1050-EVK"}, nxpEvalPackages, armGccPackage, {16}},
{vendorNxp, {"MIMXRT1064-EVK"}, nxpEvalPackages, armGccPackage, {16}},
{vendorQt, {"Qt"}, desktopPackages, nullptr, {32}},
{vendorRenesas, {"RH850-D1M1A"}, renesasEvalPackages, armGccPackage, {32}},
{vendorQt, {"Qt"}, desktopPackages, desktopToolChainPackage, {32}},
{vendorRenesas, {"RH850-D1M1A"}, renesasEvalPackages, ghsToolchainPackage, {32}},
{vendorStm, {"STM32F469I-DISCOVERY"}, stmEvalPackages, armGccPackage, {24}},
{vendorStm, {"STM32F7508-DISCOVERY"}, stmEvalPackages, armGccPackage, {32, 16}},
{vendorStm, {"STM32F769I-DISCOVERY"}, stmEvalPackages, armGccPackage, {32}},

View File

@@ -159,6 +159,14 @@ QbsBuildConfiguration::QbsBuildConfiguration(Target *target, Core::Id id)
QbsBuildConfiguration::~QbsBuildConfiguration()
{
for (BuildStep * const bs : buildSteps()->steps()) {
if (const auto qbs = qobject_cast<QbsBuildStep *>(bs))
qbs->dropSession();
}
for (BuildStep * const cs : cleanSteps()->steps()) {
if (const auto qcs = qobject_cast<QbsCleanStep *>(cs))
qcs->dropSession();
}
delete m_buildSystem;
}

View File

@@ -537,6 +537,15 @@ QbsBuildStepData QbsBuildStep::stepData() const
return data;
}
void QbsBuildStep::dropSession()
{
if (m_session) {
doCancel();
m_session->disconnect(this);
m_session = nullptr;
}
}
// --------------------------------------------------------------------
// QbsBuildStepConfigWidget:

View File

@@ -73,6 +73,8 @@ public:
QbsBuildSystem *qbsBuildSystem() const;
QbsBuildStepData stepData() const;
void dropSession();
signals:
void qbsConfigurationChanged();
void qbsBuildOptionsChanged();

View File

@@ -85,6 +85,15 @@ QbsCleanStep::~QbsCleanStep()
m_session->disconnect(this);
}
void QbsCleanStep::dropSession()
{
if (m_session) {
doCancel();
m_session->disconnect(this);
m_session = nullptr;
}
}
bool QbsCleanStep::init()
{
if (buildSystem()->isParsing() || m_session)

View File

@@ -46,6 +46,8 @@ public:
QbsBuildStepData stepData() const;
void dropSession();
private:
bool init() override;
void doRun() override;

View File

@@ -106,7 +106,8 @@ void DragTool::createQmlItemNode(const ItemLibraryEntry &itemLibraryEntry,
m_dragNode = QmlItemNode::createQmlItemNode(view(), itemLibraryEntry, itemPos, parentNode);
m_dragNode.setFlowItemPosition(positonInItemSpace);
if (rootIsFlow)
m_dragNode.setFlowItemPosition(positonInItemSpace);
QList<QmlItemNode> nodeList;
nodeList.append(m_dragNode);

View File

@@ -87,6 +87,8 @@ void ImportManagerView::importsChanged(const QList<Import> &/*addedImports*/, co
void ImportManagerView::possibleImportsChanged(const QList<Import> &/*possibleImports*/)
{
QmlDesignerPlugin::instance()->currentDesignDocument()->updateSubcomponentManager();
if (m_importsWidget)
m_importsWidget->setPossibleImports(model()->possibleImports());
}

View File

@@ -512,20 +512,18 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport()
addInfo(progressTitle);
notifyProgress(0, progressTitle);
// Trigger underlying qmljs snapshot update by making a non-change to the doc
model->rewriterView()->textModifier()->replace(0, 0, {});
// There is an inbuilt delay before rewriter change actually updates the data model,
// so we need to wait for a moment to allow the change to take effect.
// Otherwise subsequent subcomponent manager update won't detect new imports properly.
QTimer *timer = new QTimer(parent());
static int counter;
counter = 0;
timer->callOnTimeout([this, timer, progressTitle, doc]() {
timer->callOnTimeout([this, timer, progressTitle, model]() {
if (!isCancelled()) {
notifyProgress(++counter * 10, progressTitle);
if (counter >= 10) {
doc->updateSubcomponentManager();
// Trigger underlying qmljs snapshot update by making a non-change to the doc
model->rewriterView()->textModifier()->replace(0, 0, {});
timer->stop();
notifyFinished();
}

View File

@@ -39,6 +39,7 @@
#include <QApplication>
#include <QCursor>
#include <QFontDatabase>
#include <QQmlContext>
#include <coreplugin/icore.h>
@@ -410,6 +411,12 @@ void PropertyEditorContextObject::restoreCursor()
QApplication::restoreOverrideCursor();
}
QStringList PropertyEditorContextObject::styleNamesForFamily(const QString &family)
{
const QFontDatabase dataBase;
return dataBase.styles(family);
}
void EasingCurveEditor::registerDeclarativeType()
{
qmlRegisterType<EasingCurveEditor>("HelperWidgets", 2, 0, "EasingCurveEditor");

View File

@@ -90,6 +90,8 @@ public:
Q_INVOKABLE void hideCursor();
Q_INVOKABLE void restoreCursor();
Q_INVOKABLE QStringList styleNamesForFamily(const QString &family);
int majorVersion() const;
int majorQtQuickVersion() const;
int minorQtQuickVersion() const;

View File

@@ -53,16 +53,15 @@ def main():
["Resources", "adding.qrc"],
["QML", "example.qml"]]:
filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename]
if filename.endswith(".h"):
filenames.remove("TEST")
if filename.endswith(".qrc"):
filenames = ["ABCD" + filename.lower(), "abcd" + filename.lower(), filename]
previous = filenames[-1]
for filename in filenames:
tempFiletype = filetype
if (filetype == "Resources" and previous in ("test", "TEST")
or filetype == "QML" and not previous.endswith(".qml")):
if filetype == "QML" and not previous.endswith(".qml"):
tempFiletype = "Other files"
elif filetype == "Sources" and previous in ("test", "TEST"):
tempFiletype = "Headers"
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
previous, filename)
# QTCREATORBUG-13176 does update the navigator async
@@ -114,7 +113,7 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
"Verify that file with new name exists: %s" % newFilePath)
test.compare(readFile(newFilePath), oldFileText,
"Comparing content of file before and after renaming")
test.verify(waitFor("newname in safeReadFile(proFile)", 2000),
test.verify(waitFor("' ' + newname in safeReadFile(proFile)", 2000),
"Verify that new filename '%s' was added to pro-file." % newname)
if oldname not in newname:
test.verify(oldname not in readFile(proFile),