Commit Graph

62421 Commits

Author SHA1 Message Date
Christian Kandeler
f9083cc6ad ClangCodeModel: Keep a QPointer to the ClangdClient in ClangdTextMark
Apparently, the pointer might already be invalid when
addToolTipContent() is called.

Change-Id: I649bdca0945247b2b8ce4f709721c4d0bf96a11b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 12:29:44 +00:00
Jarek Kobus
6a142dfd95 Fix the "Cannot remove a null widget" warning
After the 867c0b8d8a53974074b1fff5b132f3ae9f150066 got integrated
into qtbase, Qt started issuing a warning on Creator shutdown.
The reason is that mode's widget might be deleted before the
mode's destruction. Deleting the mode's widget removes it automatically
from the contained stacked layout of the mode manager. This
means that the indices inside the stacked layout and those inside
the ModeManager's d->m_modes list are now out of sync.
FancyTabWidget::removeTab() can't find the right widget for the
passed index now or returns wrong widget for it.

The fix is to remove removeMode() method (and in turn some more
unused now). The context objects don't need to be removed on
shutdown, and the remaining mode's widgets will be deleted
by Qt itself when the main windows is destroyed.

Fixes: QTCREATORBUG-25925
Change-Id: I70c2773eea2984c5d06ce3bf71a4271b267efbe0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-30 11:41:34 +00:00
hjk
4a8c222c18 Utils: Add FilePath::symLinkTarget
And implement it for the docker device.

This replaces the previous unused and not really implemented
FilePath::resolveSymLinkTarget.

Change-Id: I9dcb4f8276dbb88b21959276da0d50135742fba0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-30 11:11:10 +00:00
hjk
4c3bbba75c Debugger: Fix typo (target-remote vs target extended-remote)
Change-Id: Iec25998654c32652d42d1ef3f82e474646c16424
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-30 11:09:27 +00:00
Christian Stenger
7fd4691a7a CMakePM: Try to improve file information for ctest
The ctest information regarding the test case itself cannot be as
adequate as the information coming from the code model.
Nevertheless depending on the used mechanism we might end up in
places that will not be helpful when using the test tree to open
files of ctest. Try to get closer to the real declaration source
if we can.

Change-Id: Ia9d217f0cdc6de6230d89dd342b60856cf1312b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 09:48:45 +00:00
Christian Kandeler
673d596c84 ClangCodeModel: Provide tooltips via clangd
Note that we temporarily lose the ability to hover over an include and
get the full path of the header file. This is a valuable feature that we
need to restore, preferably by fixing clangd itself.
Fixing the remaining few test failures would likely require more
complicated code as well as additional LSP round-trips, and as of now
I'm not convinced it is worth the effort.

Change-Id: I08c72c4bd1268bbd67baeb57bbfd29d9b11303a5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 08:49:24 +00:00
Christian Stenger
eef0769d7a Docker: Remove unused lambda captures
Avoids warnings.

Change-Id: I9bf836ff24fa6524571d0303e544189340dede32
Reviewed-by: hjk <hjk@qt.io>
2021-06-30 07:18:37 +00:00
Eike Ziller
bb195a95c7 Remove ExtraCompilerFactoryObserver
Was only used by PchManager.

Change-Id: I610c1d4215613eb494e48225329660c1e2680d49
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-30 07:06:11 +00:00
hjk
d97c10a42e TextEditor: highlighter.cpp code cosmetics
static, namespaces.

Change-Id: Id824f6979ce6c6ec6bbe4847c808c7ae47d26695
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 06:49:23 +00:00
hjk
bce19b73c5 TextEditor: FilePathify Repository *highlightRepository()
Change-Id: I66ed44e199fa26b28e23497c2650224e6331baa7
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 06:48:58 +00:00
Christian Stenger
8e1032b83c Docker: Do not use hard-coded /tmp
Amends 8c7b6a7549.

Change-Id: Ie702c7ccc5ac897920f1b8eda00dd90378a2d80b
Reviewed-by: hjk <hjk@qt.io>
2021-06-30 04:55:15 +00:00
hjk
89ab11d539 ProjectExplorer: Short-circuit ProcessParameters::effectiveCommand
... in case of remote commands.

This is enough for docker related searches for now, on the other
hand, Environment::searchInPath is not yet generic enough to cope
with remote searches.

Add a FIXME so this is not forgotten.

Change-Id: I97f3c75069a17256c83dc9f8a73ae1c1c235465f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-29 14:12:57 +00:00
hjk
eb7b5ea34e Docker: Improve logging a bit
Most logged items span more than one line, so be generous with extra
newlines.

Also, complain only about when host-local read access into the
docker device ist not possible, writing is generally done only
in the separately mounted places after re-mapping to host-local paths
in the host file system.

Change-Id: I5525749dfb880d4dc3547f86de43314567e92b4d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:48:13 +00:00
hjk
1afe21d41e Docker: Make mounted volumes user-configurable
Still use the so-far hardcoded "/opt" and "/data" as default, i.e.
not the intended final setup which should at least pick up
the source and build dirs automatically.

Change-Id: If632f3f5a6e824a952938c97336df8ff58b39d67
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:48:05 +00:00
Christian Kandeler
29704e60b0 Designer: Fix "Go to slot"
Amends 8dc4cb17c1, where we forgot to actually open the file in case the
slot already exists.

Fixes: QTCREATORBUG-25843
Change-Id: Idd9395f5bf72418043f917fd70bc3d6569b4f2fd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:43:17 +00:00
hjk
d8bd855c02 CMake: Use FilePath::dirEntries file api parser
Change-Id: Id83284518029414721cf1a44111d8f63cae9246f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:16:53 +00:00
hjk
b8e6d05ded Utils: Also pass Sort flag to FilePath::dirEntries
Change-Id: Ic21c2ba3ef59c6bb3e19552904187b3c6a096d80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:16:46 +00:00
Christian Kandeler
4e777fcf90 Clangd: Make "Follow Symbol" more robust
The AST is only needed for virtual function disambiguation, while the
basic functionality works fine without it. So in case clangd fails to
retrieve the AST node for some reason, just use the original "go to
definition" result.
This also makes "Follow Symbol" work with clangd < 12.

Change-Id: I2c110e9a51b01dc912fcdf6f4ed45fce766df374
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 12:50:33 +00:00
hjk
d857e17b13 CMake: Use FilePath::ensureExistingFile in file API
Change-Id: I38c2e97711bbc1c72c51eeb59429572ea7931e4d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 12:35:02 +00:00
hjk
1e1c556bc8 Utils: Add a FilePath::ensureExistingFile
Essentially a kind of 'touch', to be used in the CMake file API.

Change-Id: Iaae62b441c0006b39d4bef5f06420e798c28c2a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 12:34:43 +00:00
Miikka Heikkinen
b058b6e841 QmlPuppet: Add separate set of qml files for Qt6 for 3D editor
Import QtQuick3D 1.15 no longer works in Qt 6.2, so provide a separate
set of qml files for each major Qt version.

Fixes: QDS-4642
Change-Id: I3e17fb248f71f87fb9a40dcad3c03e037cafb0f4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-29 12:03:57 +00:00
Miikka Heikkinen
48348b8dc4 QmlPuppet: Change custom 3D geometries to use public API
Custom geometries often break and code becomes convoluted with
version ifdeffing, so refactor the custom geometries to use public
geometry api, which works both in Qt5 and Qt6.

Fixes: QDS-4611
Change-Id: I2d78776a14d5c8153b52806842254dbedb5de83d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-29 12:03:51 +00:00
Andre Hartmann
a659f445c7 Debugger: Escape special chars in line annotation
By re-using the existing function quoteUnprintable()
and moving their code as escapeUnprintable() to
watchutils.

In contrast to the watches window, where the escaping
can be disabled by the context menu, the line annotations
are always escaped for simplicity.

Change-Id: I76adfd7cd70ec92ff0d7f7ea41fc30ae0057cad0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 11:09:04 +00:00
hjk
4271b3a299 Docker: Bark if there is no container before trying to run on it
Change-Id: I64bee9901a515d46aa18e35d5e4a26f9105519ea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 10:34:12 +00:00
Christian Stenger
75ffccad0b Docker: Make usage of UID and GID configurable
Make it optional to use UID and GID of the current user.

Change-Id: I1a7eeaba0cfae204b05f0ab4d409d965b8fc09ef
Reviewed-by: hjk <hjk@qt.io>
2021-06-29 10:21:36 +00:00
Miina Puuronen
d5182a890a QmlDesigner: Disable Asset Library context menu when not needed
Assets Library context menus options are now enabled only when needed
and disabled otherwise. Also some renaming etc.

Task-number: QDS-4628
Change-Id: I5b2c4209f8389e51cf3f5e470bc14e5f9ffc1f29
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-29 10:13:37 +00:00
hjk
13ad1351b0 Utils: Add QtcProcess::setStandardInputFile
Needed for SshProcess.

Change-Id: Id3c8ca0cc86d7a515371fb3651e2d186cbea4df6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-29 10:08:35 +00:00
hjk
5ead2afeeb Utils: Implement FilePath::removeRecursively
Sprinkle a few QTC_ASSERT to make sure we are in a known
context.

Cmake's FileApiReader uses this before moving directories
as QFile::rename does not do anything if the target exists.

Change-Id: I555f99e81a9fe7d93ae66145eeebfa9d5880bc51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 09:34:28 +00:00
Mahmoud Badri
5470385085 QmlDesigner: clear assets selection on focus out
Fixes: QDS-4625
Change-Id: I4a9ab829522d66e3644bba7d43845bbe82d0773b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-29 09:08:00 +00:00
hjk
24190d9c0b CMake: Use local paths with file system watcher
Change-Id: I6eb831255f90b56115a5c5d79175a8985052ff83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-29 08:58:25 +00:00
Christian Kandeler
117fa35e00 Clangd: Ensure open document for "Send Goto Implementation" requests
Fixes: QTCREATORBUG-25861
Change-Id: Ied14b3ad129b205b05653a40c249a0a339ab686a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 08:37:06 +00:00
hjk
b26fb834a8 Docker: Use categorized logging for DockerDeviceOperation
Change-Id: Ib9aa32c65bd38b4b72b356603182e84ce5672e91
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 08:35:32 +00:00
Henning Gruendl
3f5130ef2c QmlDesigner: Update SplitViewSpecifics
Change-Id: Ibb22bd5648b66c4fd12eb8a97f84d5eaa6a33670
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-06-29 08:29:57 +00:00
Henning Gruendl
5f8e344a7d QmlDesigner: Update alias icon in navigator
* Replace the aliasOn/Off icon in the navigator with alias icon
* Change color for alias icon in Property Editor so it will match with
  the navigator

Task-number: QDS-4646
Change-Id: Idda5e62dac527c645c7c7b9de9c8b448087f31a7
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-06-29 08:29:21 +00:00
Alessandro Portale
eeccdd4839 Android: Remove size constraints of the "New AVD Dialog"
This removes minimal/maximal sizes of the dialog. Unjustified size
restrictions cause poor UX.

The initial dialog width is increased from 600 to 800 px.

Fixes: QTCREATORBUG-25846
Change-Id: I306fbacba2a833f0c9a3bd6a23c6ff9a1bba9c3b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-06-29 08:04:25 +00:00
Christian Stenger
acec1a3a03 Docker: Pass on working directory only if provided
Change-Id: I9ae62b441c0006b39d4bef5f06420e798c28c2a5
Reviewed-by: hjk <hjk@qt.io>
2021-06-29 07:34:48 +00:00
Christian Stenger
ca1ce3a1ba Docker: Silence assert
We query the device with executables that may or may not exist.
So, expect the call to fail if the image does not contain the
respective executable in PATH.

Change-Id: Iff43879c72155de8a8a9276e26085d03ead61f2f
Reviewed-by: hjk <hjk@qt.io>
2021-06-29 07:34:41 +00:00
Christian Stenger
8c7b6a7549 Docker: Use directory commonly existing
Trying to use /tmp on Windows ends up in a failing process call
as this directory usually does not exist.

Change-Id: I80a5e45c474d3fe6ff6f2ede67837722cb59078a
Reviewed-by: hjk <hjk@qt.io>
2021-06-29 07:34:33 +00:00
hjk
9f29b9e31b Docker: Use id of current user to run the container
This ensures typical files created in the build process are
accessible and removable(!) by the user outside.

Downside is that some commands (e.g. whoami) won't work well
within the container as that user typically is not listed in
/etc/passwd etc. inside the container. Buildsteps requiring
them won't work until the container image is (re-)created with
this data in place.

In general, there seems to be no silver bullet for this problem.
An extensive discussion of pros and cons can be found at
https://jtreminio.com/blog/running-docker-containers-as-current-host-user

Change-Id: I0421e031324ffe3d64b9aeede289a43357c46e3d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 07:30:09 +00:00
Christian Kandeler
6f5e20bf64 ClangTools: Fix applying check options
The algorithm we used to determine whether an option was applicable did
not take the wildcard syntax into account that is used when all sub-
checks of a group are enabled.

Fixes: QTCREATORBUG-25827
Change-Id: I1d385bcc90ea9bf0bfac5cffe8739a8148aa740f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 06:59:21 +00:00
Christian Kandeler
74385cc10c ClangTools: Make sure URL for clang-tidy checks is always correct
Fixes: QTCREATORBUG-25902
Change-Id: Ifadb6c90cf9a86fc4efb734d6105217b70f9419d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 06:58:58 +00:00
David Schulz
922f9b159d LanguageClient: fix diagnostic document revision check
We track the document revision in the client nowadays.

Change-Id: Ia55bc7cd5eaf100fb19953ca71e8de8f43ae3266
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-29 04:49:50 +00:00
David Schulz
44f0f9ae18 Clangd: use special value text for automatic worker count
Change-Id: Iddb75b6716724b5994d8093a8e389f5cb8e2d044
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-29 04:45:47 +00:00
Cristian Adam
2d08b296b7 CMakePM: Remove wishlist comment
The comment is no longer valid.

Change-Id: Ica19e26039e147ccdd77559cc85bfcb5e784b68c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 17:45:13 +00:00
Alessandro Portale
bb8aa12cbc PerfProfiler: Add qml, register types via qt_add_qml_module
Use the CMake-based qml API to create the "QtCreator.PerfProfiler"
module.
This uses qt_add_qml_module, which was introduced with Qt 6.2.

For Qt 6.1 and below, everything compiles and runs like before this
change.

Change-Id: I7e3a9e544e52592b5daf0117ce415583ab97dafe
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-28 15:06:50 +00:00
Alessandro Portale
9624d2cd69 QmlProfiler: Add qml, register types via qt_add_qml_module
Use the CMake-based qml API to create the "QtCreator.QmlProfiler"
module.
This uses qt_add_qml_module, which was introduced with Qt 6.2.

For Qt 6.1 and below, everything compiles and runs like before this
change.

Change-Id: If381059bbf2a0a2b92c7f62e6da3142036ac6bbc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-28 15:06:45 +00:00
Alessandro Portale
3ebe5dbb99 Tracing: Use qt_add_qml_module for tst_flamegraphview
Use the CMake-based qml API to create the
"QtCreator.TstTracingFlameGraphView" module.
This uses qt_add_qml_module, which was introduced with Qt 6.2.

For Qt 6.1 and below, everything compiles and runs like before this
change.

Change-Id: I7b1d7109c5fcff55c7be4b431f21281a63d13332
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-28 15:06:39 +00:00
Christian Kandeler
7bf52b0c0d ClangCodeModel: Provide diagnostics via clangd
Change-Id: Ib45a62ebe200c2b56a1bb1a66f8a92103e60d092
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 13:22:36 +00:00
hjk
54b4022987 Utils: Implement FilePath::rename()
And uses it in CMake's fileapi reader.

Change-Id: I9e719aa4b253eaca17c6b304eab5e7268fcfab29
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 13:03:32 +00:00
Christian Kandeler
782779f8f4 ClangCodeModel: Remove outdated code
Diagnostics from clang-tidy and clazy do not take this route anymore.

Change-Id: Ifca2d9861d69dda94638277ec1210d28a3350b12
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 12:56:58 +00:00