Commit Graph

62421 Commits

Author SHA1 Message Date
Cristian Adam
1b3a4e1fc6 CMakePM: Clear and setup file watcher before and after backup configuration
Qt Creator 4.15 will do a backup of the CMake file-api, but the file watcher
that triggers a reparsing was not cleared up before the backup.

This could lead to unnecesary file-api rescans.

Task-number: QTCREATORBUG-25783
Change-Id: Id91379ea85c8a91e03d952c5c66b0371ebff943f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-08 09:34:00 +00:00
Miikka Heikkinen
56555d8b74 QmlDesigner: Fix issues with QtQuick3D versioning
Empty version no longer triggers error about version incompatibility
when the import is set with Model::changeImports().

Adding QtQuick3D via the prompt inside 3D Edit view now correctly sets
empty version instead of 6.x.

Fixes: QDS-4494
Change-Id: I18e62ced6d6df45bc453431f8419bc853bf1e758
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 08:27:34 +00:00
Jarek Kobus
7171b0385f Pass QFuture<T> to the ProgressManager::addTask()
Amends 9a8a7a88a6

Change-Id: Ib389a25f2564db5b6cb7711771c296d2ebd1178a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-08 08:27:22 +00:00
David Schulz
6008c5f673 Core: filepathify LocatorFilterEntry
Change-Id: I279af30f6b57e8d1279d96e5cbae4025cf4ef473
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 07:46:37 +00:00
Eike Ziller
9a8a7a88a6 BaseFileFind: Centralize waiting for search to finish
Instead of adding a FutureSynchronizer to all backends, we can use a
central one in BaseFileFind.

Amends 269f15df6b

Change-Id: Iad0145317b53a95b686c091017b8197d759dc253
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-08 07:46:29 +00:00
David Schulz
4445876013 Editor: directly use the Link overload of openEditorAt
Change-Id: I5e863600159cc54a99fec5a20df8de1fbc3d745f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 07:37:42 +00:00
David Schulz
bf79f1ae38 Utils: fix QtcProcess timeout error message
Change-Id: Iccfe7cfe61937872589a708f79dec69afefb9be4
Reviewed-by: hjk <hjk@qt.io>
2021-06-08 07:36:13 +00:00
Tapani Mattila
f087e70e80 AssetExport: Enable setting custom metadata file name for exported components
Task-number: QDS-4384
Change-Id: I5d41ab00f7f90137355289f341defcb87ddf3b44
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2021-06-08 07:32:12 +00:00
hjk
1ce7adce47 Utils: Set the working directory in QtcProcess::start
The m_process member is strictly speaking only needed for processes
handled "fully locally", i.e. without diversion through any device.

Better set it only when needed, even if only to avoid even unused
locally illegal paths like "docker://123/tmp/x" as working directory.

Change-Id: Ia9e686855ff0c213eb3be03def8c4cecc7ee37ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 07:32:02 +00:00
Jarek Kobus
bcd3feeaa7 Fix a possible crash on shutdown while executing VcsCommand
Add a global synchronizer to the VcsPlugin.

Fixes: QTCREATORBUG-25744
Change-Id: I97578f4a5b5275071aa0253a22fc9ab2f90d9b75
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-06-08 07:12:30 +00:00
Alessandro Portale
b730aa6405 Tracing/QmlProfiler/Perfprofiler: Merge modules
Move Tracing Qml Types into the "QtCreator.Tracing" module.
Move QmlProfiler Qml Types into the "QtCreator.QmlProfiler" module.
Move PerfProfiler Qml Types into the "QtCreator.PerfProfiler" module.
And tst_flamegraphview ones into QtCreator.TstTracingFlameGraphView.

... in preparation to register the types declaratively.

Change-Id: Ic0e3863d09b3426fa5b7419116625ad49b817dcf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-08 06:46:28 +00:00
Eike Ziller
a3391e7b33 Improve safety of VcsCommand
Amends 6e85ff9f4b

Using "invokeMethod(m_outputWindow, ..." has the disadvantage that it
crashes if m_outputWindow was deleted. This is nicely handled when
connecting to signals, so switch back to signals.

Change-Id: I6a681ac48a86536fa8e69e42d3c61ffa9d30c3d5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-06-08 06:37:04 +00:00
Eike Ziller
ee61b09b21 GitGrep: Do not access global state from non-main thread
- VcsCommand calls into VcsOutputWindow at construction, so we need to
  construct it in the main thread
- VcsCommand may not call into global settings from runCommand, so we
  need to store the ssh prompt command
- accessing the GitClient singleton in a non-main thread is not
  thread-safe

Change-Id: I3dcdff8091c2dcea1c165ce5b3eca5ef62d474fd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-06-08 06:36:53 +00:00
David Schulz
93fcf5c91f LSP: Fix CodeActionResult
The isValid check now works on both objects since the error message
simplification. So check the command property and see whether it is a
string to identify the object.

Change-Id: Iaafe2d868267ebb83440d72703ee3edc517385d8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 06:14:50 +00:00
Tuomo Pelkonen
ef7cfe1570 FlowEditor: set TopRightCorner as the default text position for FlowDecision
Task-number: QDS-2508
Change-Id: I1bb62443b8361fc166a7e92644d2641194c105ef
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 06:14:05 +00:00
hjk
ac2271a9cb Docker: Disable original development helper items
Proper Docker support will re-use the original build system's
build and run configurations.

Change-Id: I910512e4943bae90905f16607f9af0548c8078ba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 06:08:17 +00:00
David Schulz
4e69b5068a LSP: Fix Range::overlaps
Change-Id: I14e6477b25a4c9a25c3832a4bc580728bb85c448
Reviewed-by: <sergeikrivonos@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-08 04:42:27 +00:00
Christian Stenger
64ce2a6f43 AutoTest: Cache PCH lookups
Avoid slowing down scans of bigger projects by caching
lookups of paths inside precompiled headers.

Change-Id: I17652ba36ab761cc06ecce151e41253271236881
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-08 04:37:38 +00:00
hjk
4245d89a67 ProjectExplorer: Show a verbose error message if available
... when a start failed, e.g. due to a inacessible working directory.

Change-Id: Ibcec1c5323c37f1e8f6c9e55439439b24f3b40b1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-07 15:18:08 +00:00
Thomas Hartmann
71a081de64 QmlDesigner: Ignore invalid version
Task-number: QDS-4495
Change-Id: I2d01f68f9f598ea9106a72332f039ec35e188678
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-07 13:42:36 +00:00
hjk
a7cd9bda3a ProjectExplorer: Implement (Docker)Device::exists(filePath)
While the original plan was to use more specific functions like
'isReadableFile' to cut down the number of accesses, it is
unrealistic to re-write all occurrences in reasonable time.
So make the basic building blocks accessible, too.

Change-Id: I2586ebd19e1e7ae2c884fd2a4180869421293e3a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-07 12:16:38 +00:00
Jarek Kobus
422409bf26 Add TestStringTable test
The TestStringTable tests the fix provided for a crash in StringTable
on shutdown.

Amends: f4ab1279fd

Task-number: QTCREATORBUG-25417
Change-Id: I5a4a7e4a20e1b9611682a976d38dee17d4603c5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-06-07 12:16:27 +00:00
Christian Stenger
9db6569c43 AutoTest: Take precompiled headers into account
Test frameworks might be added to the precompiled
headers. This in turn would make some pre-checks
whether a file has to be processed or not fail.

Fixes: QTCREATORBUG-25821
Change-Id: Iff69c1a83889cb6f79a3e3f9b2e59c5383989ccd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-07 12:05:37 +00:00
Jarek Kobus
6e85ff9f4b Get rid of OutputProxy in ShellCommand
Before we have used the OutputProxyFactory, which
was called in the non-gui thread. The factory, when run,
created the connection between the thread and outside
world (e.g. VersionControl output window). Instead of
setting the factory we provide a set of virtual functions
called directly from non-gui threads. We also provide overrides
for them in VcsCommand class. Their implementation
safely redirects the calls directly to the VcsOutputWindow
through the QMetaObject::invokeMethod() with auto connection
as a default.

Task-number: QTCREATORBUG-25744
Change-Id: I09f2da278003b71095e953a51499a5513cb8f03f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-07 10:44:31 +00:00
Jarek Kobus
269f15df6b Wait for all searches to be finished in d'tors
Task-number: QTCREATORBUG-25792
Change-Id: Idc516324b2a80b9b907cf29ed3df4de86d842266
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-07 10:17:44 +00:00
David Schulz
4b19decaa7 Core: Remove EditorManager::CanContainLineAndColumnNumber
In preparation of just supporting Utils::FilePath to open editors.
Opening editors at specific locations is still supported via
openEditorAt with Utils::Link, but the caller has first to parse the
file name via Utils::Link::fromString.

Change-Id: I17e5a28aeb50779cef9948fe72e37122d1020c50
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-07 10:09:04 +00:00
Orgad Shaneh
7ab715022f Utils: Fix MSVC warning
conversion from 'size_t' to 'int', possible loss of data.

Change-Id: I425fe53e64bfa2b4459a0c9c0fc8c95d142291e4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-07 09:19:53 +00:00
Christian Kandeler
a5ba33cbeb CppEditor: Add second "Find References" Action
This one includes access type categorization, while the "normal" one
does not.
We need this now, because with clangd, the categorization is too slow to
enable it by default.

Change-Id: I2eb4608630d34452ae28f0836befd5d9053f42bf
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-07 08:28:49 +00:00
hjk
a09851ff1f ProjectExplorer: Fix Coverity warning in AbstractProcessStep
*** CID 1505141:  Null pointer dereferences  (FORWARD_NULL)
/qt-creator/src/plugins/projectexplorer/abstractprocessstep.cpp: 409 in ProjectExplorer::AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)()
403         if (!process) // Happens when the process was canceled and handed over to the Reaper.
404             process = qobject_cast<QtcProcess *>(sender()); // The process was canceled!
405         if (process) {
406             stdError(d->stderrStream->toUnicode(process->readAllStandardError()));
407             stdOutput(d->stdoutStream->toUnicode(process->readAllStandardOutput()));
408         }
>>>    CID 1505141:  Null pointer dereferences  (FORWARD_NULL)
>>>    Passing null pointer "process" to "cleanUp", which dereferences it.
409         d->cleanUp(process);
410     }
411

Amends 4a26a2c28.

Change-Id: If9a66841b05e389a87a1b843ee5ef9e66edf15dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-07 08:22:58 +00:00
The Qt Project
9f0179b7c1 Merge "Merge remote-tracking branch 'origin/4.15'" 2021-06-07 08:03:24 +00:00
Orgad Shaneh
3c8a991a9b QtcProcess: Really set working directory for process
Git operations were broken.

Amends commit accb1e6e08.

Change-Id: I0ffe41d3d5b80990eed29f7609daaf23201e49af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-06-07 07:20:12 +00:00
Thomas Hartmann
306904fe83 QmlDesigner: Use Window instead of Dialog
Change-Id: I9f7392788e96ed399f686caed41e30e8347b3665
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-07 07:06:44 +00:00
Eike Ziller
098637b758 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
	src/plugins/ios/iosprobe.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: I6c2136b576c44fc35def397191db97069599f183
2021-06-07 08:37:56 +02:00
David Schulz
db09eb7600 LanguageClient: fix nullptr access in lsp inspector
Change-Id: I348db437bce0edd17730b0a8a7c47c07d7b92e1c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-07 06:21:04 +00:00
David Schulz
64434b9fb4 LanguageClient: correctly track current hover request
Change-Id: I6c5b90aa8c3fd7611e48c0cd676dc1c1f9b9e562
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-07 05:32:01 +00:00
Mahmoud Badri
90ea538f24 QmlDesigner: Add empty assets directories to the model
...so that changes to empty asset folders are detected and handled.
Also remove a check for folders named as the project's name as it
doesn't seem necessary.

Task-number: QDS-4429
Change-Id: I8031fb57d3c02bb6599824f04f222414a52d08c9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-04 18:33:42 +00:00
Thomas Hartmann
3251b13dd0 QmlDesigner: Use lazy initialization for the ImageCache
Change-Id: I42f6f047882c4056a1523bb85b4801f53e50fbe5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-04 16:43:50 +00:00
Eike Ziller
975c6cb096 iOS: Don't run event loop while executing xcode-select
This fixes debugging Qt Creator with the iOS plugin enabled. For unclear
reasons running the event loop while executing the process locks Qt
Creator up when debugging. Since running the event loop is a dangerous
hack anyhow and in this case we don't have much benefit from it, just
don't do it.

Change-Id: Ie147d3461823587a987d0920efdfae0839fb5b67
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-06-04 13:49:39 +00:00
Eike Ziller
66948d9a63 Fix build on macOS
Complains about template argument (QString) and type of value
(const QString) not being the same.
make_optional is usually used with template parameter deduction anyhow,
but in this case we can just return the value.

Change-Id: Icc5c6bb4505d09ab6a864fb7a7c6ec97e34b42b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-04 13:49:08 +00:00
Knud Dollereder
2fa63a2801 Fix QKeySequence construction on macOS
Constructing a QKeySequence with the string "Cmd+Opt+Shift+V" leads
to an invalid, non-empty QKeySequence when compiling Design Studio
on macOS. This triggers an assertion later in the code path.
Using “Ctrl+Alt+Shift+V” instead works as expected.

Change-Id: I7cb185d18f9ffbb7454c61f28a93cdd307121882
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-04 13:30:20 +00:00
Eike Ziller
637837edf1 Mode bar: Fix splitting configuration name into two lines
Amends 0795d5f42d

- QRegularExpression::match does not support negative offsets, so that
  part was wrong when porting to QRegularExpression
- QString::lastIndexOf with QRegularExpression and negative index is
  broken in Qt > 5.15.2, which leads to endless recursion

Use good ol' loops instead, which also saves the overhead of throwing a
regular expression on this.

Task-number: QTBUG-94215
Change-Id: Ia9747c32fc775f2a735af97a6b73f9a5021882ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-04 13:27:29 +00:00
Erik Verbruggen
3282aa92f8 Fix missing checks for GHS-Arm
Some places where ghs-specific checks were done, were not modified to
do the same for ghs-arm.

Change-Id: I484f98209188e4c160a13248ca3c3f046b342b22
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit 943c31a5b4)
2021-06-04 13:03:02 +00:00
Erik Verbruggen
b41bf33dff Change the generator for the GHS and GHS-Arm compiler to Jom
Using Ninja not all modified files will be compiled in an incremental
build.

Fixes: UL-4247
Change-Id: I0bdb1e611e54ea6674ccae4d23391ac86f0960b8
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit 3ed6f58056)
2021-06-04 13:02:56 +00:00
Erik Verbruggen
b7218a34dd Add support for the Cypress traveo II kit
Fixes: UL-4242
Change-Id: I0b492a3edd6a1dce9d214e6490e174050c3fdb30
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit d98feae8f6)
2021-06-04 13:02:49 +00:00
Thomas Hartmann
27a8cb376e StudioWelcome: Pseudo destaturation
Qt 6 does not have the QtGraphicalEffects module anymore.

Change-Id: Idb4e9d141a65b31ad68058d95ffa519bd65f5c4c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-04 12:31:57 +00:00
Christian Stenger
c624467a5f CppCheck: Use line-based output callback
Change-Id: I1b2341f71908a00f820b47109fcc4fda2134a83b
Reviewed-by: hjk <hjk@qt.io>
2021-06-04 12:28:44 +00:00
Christian Stenger
133b3b58a7 Utils: Provide line based callback handling
Change-Id: Ibb1df93b457d299c377472ff6c0fbd719554d7d8
Reviewed-by: hjk <hjk@qt.io>
2021-06-04 12:28:36 +00:00
hjk
4e30ce160e Utils: Start collecting environment changes instead of full environments
We have a couple of cases where classes need to modify environments but
have only the ability to provide complete environments without actually
knowing the full context. Starting with systemEnvironment usually works
so far, but breaks down in cases of e.g. containerized builds.

This patch here introduces the ability to collect changes to
environments, and postpones creating a full environment until the
context is clear.

As introductory example use BaseQtVersion::qmakeRunEnvironment

Change-Id: Id23c0aa80fc95b0a8a01f8e3a87adc9b1a57002a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-04 11:42:05 +00:00
Eike Ziller
3c9da87f33 CMake: Duplicate CMake output in Projects mode
There is some space on the right side there, and in Projects mode it is
nice to have the output directly visible without opening the General
Messages pane (without intermangling with other output there).
This is a first step that duplicates the output in a very simple manner.

Fixes: QTCREATORBUG-25522
Change-Id: Id53b21d629b1f1bbc46ebf3d38bcec1fd83a6360
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-04 11:07:28 +00:00
hjk
1fd18e31c1 Qmake: Use local Makefile path when constructing make command
The command will be executed by qmake and make steps on the build device,
from that perspective the Makefile path is local.

Change-Id: I7a72002126975ea462daf528f2c1f490d433af77
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-04 10:10:40 +00:00