Commit Graph

62421 Commits

Author SHA1 Message Date
hjk
a41524f08c QtSupport: Expand path variables only to local paths
It's what it used to do and actually better for the docker case where
the two only active use of these in form of %{Qt:QT_INSTALL_PREFIX}
are in a cmake build context that would require (device-)local path.

Long term we might want to use a variation of registerFileVariable
here without changing semantics on the user side.

Change-Id: If8dd77ac0b94ede41dbfe322802d5ef6c0b043ee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-28 12:56:46 +00:00
Christian Kandeler
d083fd0227 ClangTools: Make version number available via settings
Change-Id: I9501f5a3234fb995a7ca3192adc1569febb8662e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 12:56:31 +00:00
Miina Puuronen
a813897825 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-28 12:30:17 +00:00
Christian Kandeler
56cddf38b3 Clangd: Let users limit the worker thread count
This is particularly interesting for indexing, where users might prefer
a slower-building index with less CPU load.

Change-Id: Id44c58e9041df2857cd0772e71345673b14623f3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 10:35:33 +00:00
Christian Kandeler
876cd8e975 Clangd: Allow to switch off background indexing
It is conceivable that users don't want to spend the extra CPU time on
this.

Change-Id: Ic3611c8d17d201ae986fad08b344369a8728ce1b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 10:35:06 +00:00
Christian Kandeler
ba138a1855 CppTools: Add dedicated settings and settings page for clangd
We plan to add more clangd settings, and it makes sense to have a
dedicated place for them both in the code and the UI.

Change-Id: Ideb92935b7a5a6a98e07980f4011736fb82042d1
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 10:34:24 +00:00
Assam Boudjelthia
cd20ad8ff4 Revert "Android: add prepare_apk_dir CMake target by default"
This reverts commit 9dcbb8ca01.

Reason for revert: This workaround is not needed anymore, since
Qt 6.1.2 (see 71348437939e62b0e3b86888e966b300ff1e2855).

Change-Id: I089457dc58c5b97136b30190fdf17cfb303f8bd8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-28 10:29:10 +00:00
Assam Boudjelthia
f9a8e47d13 Android: Copy the target lib to android-build as part of the apk step
Make sure to copy the target's main lib file before building the APK.
If the lib file is already there, i.e. copied by the underlying build
system, this does nothing, but if the file is not copied by default like
in cmake with Qt 6, this would copy it and would save us having to add
*_prepare_apk_dir in cmake command.
Also, this could allow us to remove the step "make install" from
qmake step settings.

After this we could revert 9dcbb8ca01.

Fixes: QTCREATORBUG-25367
Fixes: QTCREATORBUG-25216
Change-Id: I243a16a32e2ea97e175c893470480c9d2c9b1e27
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-28 10:29:01 +00:00
Assam Boudjelthia
03712d6a92 Android: remove app lib_name field from the manifest editor UI
This field is supposed to hold the name for the *.so lib that
contains the main() function, ideally it shouldn't be edited by
the user, because some users might use the field to set an invalid
name or use the app's human readable name which is wrong.

Change-Id: Ie7feb79d6231d1785c29754ed277e057181e9ca0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-28 10:28:41 +00:00
The Qt Project
35b169f466 Merge "Merge remote-tracking branch 'origin/5.0'" 2021-06-28 09:41:13 +00:00
Marco Bubke
26b2c0609c Utils: Export std::variant_alternative_t
Change-Id: I30f1f797aff2bdf60b9a93fdee564ec648a2a6fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:09:08 +00:00
Marco Bubke
091c7a0093 Sqlite: Disable value method for fundamentals
There is optionalValue which can handle a null value. ints and floats
can be initialize to zero but you cannot be sure that this value comes
from the database, is a empty value. So it's better to force
the use of optionalValue for ints and floats. In that case empty has
to be handled.

Change-Id: Id5c5db57a8d3335d91911824d06f388ed054df9e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2021-06-28 08:08:59 +00:00
Cristian Adam
3340fa88e4 CMakePM: Proper restore user saved CMake tools changes
If you had an auto detected CMake tool from the sdk you would
not be able to change the "Autorun CMake" state from ON to OFF
because the sdk value would always be used instead of the
user one.

Fixes: QTCREATORBUG-25911
Change-Id: Ibe3b393a2b9e4d397251018fda8a9508ad096791
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:42 +00:00
Cristian Adam
fc493c3fcb CMakePM: Resolve paths to build directories
With the default build directory template the CMake build directories
will be displayed as project-source/../build-project-name-kit-build-type
which can be irritating.

With this commit the build directory will contain the resolved path.

Change-Id: I968260caba5b9a47e1bda4eeaea386a04fe817b1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:20 +00:00
Cristian Adam
20366297ed CMakePM: Keep always created run configurations up to date
Qt Creator will do an update of run configurations after a project
configuration.

If an always created target was no longer existing, it shouldn't be
part of the run configuration.

For some reason this was not the case for CMake projects.

With this patchset if a target's name is changed, the previous target
name is no longer part of the run configuration.

Fixes: QTCREATORBUG-25906
Fixes: QTCREATORBUG-24914
Change-Id: I086a2540eaad9039e41fb48194d5901c7be22be8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:06 +00:00
Fawzi Mohamed
73c40bcefa qmljstools::LocatorData: improve safety
* check that we create LocatorData in the same thread as the
  ModelManagerInterface
* pass this as connect context, to ensure signal disconnect

Change-Id: I5e51af90c521fd8c83a6cfe2d105832f5a02a04f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 584f0476ec)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-28 07:07:57 +00:00
Eike Ziller
a9cdf04cb4 Merge remote-tracking branch 'origin/5.0'
Change-Id: Ifc49d21fa35373e036ea547ddd1dbdc0510da7bd
2021-06-28 09:01:36 +02:00
hjk
d1300542bb Proparser: Don't crash on accidental remote files
Change-Id: I62ca1b17436fce21d582816388db497d82df6582
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-28 06:57:19 +00:00
hjk
6a826bd751 QtSupport: Claim support for any Qt version with docker
It's hard to draw the line, and it's only about a potentially missing
warning here.

Change-Id: Ie86905d0b8309297965133dedf636b6172a11757
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-28 06:57:10 +00:00
Eike Ziller
2e09518e9c Pass the new node in ProjectTree::currentNodeChanged
Avoids some roundtrips asking for ProjectTree::currentNode()
which traverses the project tree every time.

Change-Id: I650728eab5a47a7f4760cf88844a4b7106365255
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-28 06:55:51 +00:00
Bernhard Beschow
35021ec2da AutoTest: Turn pointer into value
... which avoids a raw pointer which needs additional "management".

Change-Id: I9c478b4043a563b00ced09de8366657eaf34c349
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 16:42:43 +00:00
Pekka Kaikkonen
68ff37e630 QmlDesigner : QRC File integration
Split resource file generation into two actions. Take file from
current project into account. .qrc generation should take existing
.qrc file into account.

Task-number: QDS-4516
Task-number: QDS-4517
Task-number: QDS-4519
Change-Id: Iee15880657e456fbd74df505c10ee83a80ee64a7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-06-25 15:17:26 +00:00
Fawzi Mohamed
584f0476ec qmljstools::LocatorData: improve safety
* check that we create LocatorData in the same thread as the
  ModelManagerInterface
* pass this as connect context, to ensure signal disconnect

Change-Id: I5e51af90c521fd8c83a6cfe2d105832f5a02a04f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-25 14:52:58 +00:00
Cristian Adam
f8a77287bf CMakePM: Add support for qtc_runnable feature
This will allow for the Qt Creator's CMake build only qtcreator
target to be selected as runnable.

Similar to qmake's qtc_runnable or Qbs's qtcRunnable features.

Fixes: QTCREATORBUG-25908
Change-Id: I6416873d0ad9cfec4960d98fc4b289ec98cc58b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-25 14:24:41 +00:00
hjk
6d26f4f5b0 CMake: Allow autodetected tools to associate themselves with kits
Change-Id: I5b48ddf36ba1b9c4eb6476017be63c4d43b60627
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 13:57:36 +00:00
Christian Kandeler
9706d89335 QmlDesigner: Fix warnings
- unused variables
- mis-ordered field initializations

Change-Id: I9f265799597e7c0f4f41cbb20edf19c48cae4c0e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 09:23:53 +00:00
Christian Kandeler
472f9c30d3 QbsProjectManager: Make use of qbs config --add-profile
... if available.

Task-number: QTCREATORBUG-25463
Change-Id: I7fc8a06a5c43b35c4b1b571504d31cc03a95b189
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 09:23:41 +00:00
Christian Kandeler
bd9bcdb925 QbsProjectManager: Simplify profile creation code a bit
Change-Id: I253671358955a970def0eb1343558135a38acaa2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 08:00:15 +00:00
Christian Kandeler
b52337aef9 QbsProjectManager: Make qbs version available in settings
We'll make use of this in a follow-up patch.

Change-Id: I851d607256617b02a3fedc3a370203a47a8db904
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 07:50:37 +00:00
Alessandro Portale
d720a7fb21 Tracing: Use Qt5_VERSION to check the Qt version in CMake
Instead of QT_VERSION.

Change-Id: I466f4daee623b91aadda5160cc7dec104788f66c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-25 07:38:45 +00:00
hjk
2a5bdc893e Debugger: Robustify protocol
Chicken out of list parsing when an element can't be read.

Change-Id: Ia0c487c53984ee29ba1b561edc040aa1447493a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 06:11:44 +00:00
hjk
f295021d98 Docker: Give created devices an deterministic id
Change-Id: I451f37065b69da26000cb21ba92b070e6b5698d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-24 14:07:26 +00:00
Christian Kandeler
4ff26e2a27 CppEditor: Do not rely on object identity when comparing names
In particular, the same namespace can be declared in lots of different
places.

Fixes: QTCREATORBUG-25776
Change-Id: I7e255cee560043ed4beb47b8047f99c3a9c21198
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-24 13:46:25 +00:00
Christian Kandeler
627dd6681b Sqlite: Fix warnings
- use of uninitialized value
- unused local typedef

Change-Id: I60d6c3a9a04d9f603a102439582c9e55d85a191f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-24 12:07:48 +00:00
Christian Kandeler
b1837036b3 Fix some warnings about unused lambda captures
Change-Id: Icfb1b963b3c55656c760497e4ae3ece2bdccbbc7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-24 12:07:31 +00:00
Eike Ziller
8f30ff6987 CMake: Show build directory when asking if it should be used
When changing the build directory to a new or empty directory, we ask if
the build directory should be changed and the project be configured
there. Mention the new directory in the dialog.

Change-Id: Ie4d7e9b132e6e90004e4d498b2182562375e7441
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-24 11:58:52 +00:00
Christian Kandeler
c6a4cd293b CMake: Fix initializer re-ordering warning
Change-Id: Iffcc4eb562a06ff12d641d23687dc4c44c797ce8
Reviewed-by: hjk <hjk@qt.io>
2021-06-24 10:35:59 +00:00
Eike Ziller
f42b68f4af Merge remote-tracking branch 'origin/5.0'
Change-Id: I18a3caa2d5999570fcd02846403756f9124ab4af
2021-06-24 10:59:32 +02:00
Eike Ziller
6bc9cddb9e Merge remote-tracking branch 'origin/4.15' into 5.0
Conflicts:
	src/plugins/cmakeprojectmanager/projecttreehelper.cpp
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: Ie3a281b8635e79ca5fa794a127ed0039f33fe2ee
2021-06-24 10:43:10 +02:00
Mahmoud Badri
e8a3a6aad3 QmlDesigner: clear assets selection on focus out
Fixes: QDS-4625
Change-Id: I4a9ab829522d66e3644bba7d43845bbe82d0773b
Reviewed-by: Miina Puuronen <miina.puuronen@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-24 08:11:23 +00:00
Eike Ziller
dda115d0d8 Merge remote-tracking branch 'origin/master' into 5.0
Change-Id: I3f9049ec34c9b3be42bd0d1fd8aa1d14f8014fe2
2021-06-24 08:40:54 +02:00
Wojciech Smigaj
194569b471 ProjectTree: Add an option to hide Source and Headers file groups
A new checkbox "Show Source and Header Groups" is added to
the filter menu in the project tree. It is checked by default.

Unchecking it removes the extra level of virtual folders containing
sources and headers.

Change-Id: I25f4514e7f1f6cdfcb531a911e54cc6e7e42a3e2
Fixes: QTCREATORBUG-25313
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-24 05:24:26 +00:00
Ivan Komissarov
afa4218871 Update Qbs submodule to the top of 1.19 branch
Change-Id: I79385eb5d49c46a4e856682f3be43c954ca26717
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-23 20:08:34 +00:00
Eike Ziller
2e4d57db35 Fix that disabled QRC files were enabled by QRC expansion
The automatic expansion of QRC files to the tree of their contents
didn't preserve the "enabled" property of the original QRC node.
For CMake projects that resulted in the file system tree still being
shown, with only the QRC nodes, when "Hide Disabled Files" was on,
instead of hiding the file system tree completely.

Change-Id: If1eb88478955dc8635def844cfc501befcbfc329
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-23 18:37:35 +00:00
Cristian Adam
913dc9549e CMakePM: Do not expand qrc files for <File System>
The qrc file expansion could take time and it's not a
great idea to do it for all files in the filesystem.

Amends 53115259ba

Task-number: QTCREATORBUG-25783
Change-Id: I10b1f6c224e78b0efe4654bcf36d7cb9ba0e7e5f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 18:37:21 +00:00
Kai Köhne
10420d4e5e Replace Freenode with Libera.Chat
Change-Id: Ia4a54b72f522a02c734273630c8217af75e4ea92
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-06-23 14:40:50 +00:00
Eike Ziller
0bcab32657 Avoid expanding QRC nodes in main thread
For CMake and Qbs projects and users of TreeScanner, where the tree is
already created in a separate thread.

Expanding the QRC nodes means reading and parsing the QRC files, which
can take up a considerable time (second(s)) if there are hundreds of
them in a larger project like Qt Creator.

Task-number: QTCREATORBUG-25783
Change-Id: I5ca818b9f75ea6e8ef23f837cc9e15df7e6630e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 14:27:44 +00:00
Eike Ziller
9109a6895e CMake: Do not create file system node in main thread
The file system scanning was already in a thread, but creating a tree
from the flat list of file nodes was still done in the main thread.
Creating the tree looks for and creates folder nodes as needed for each
file node, which is not that big of a deal but still takes 1/3 of a
second for the Qt Creator source tree.

Task-number: QTCREATORBUG-25783
Change-Id: I28948ed3ff5233f6fc4b86e93da94d882b81e231
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 14:25:08 +00:00
Jarek Kobus
fd6ec7da25 Remove unused ModelManagerInterface:isIdle()
Change-Id: I7c607bcc0a03219d7d6205a0c5fbdd3d46f9e9fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-23 14:01:50 +00:00
hjk
95496a7d8c QtSupport: Fall back to local paths in ProParser
That's conceptually wrong, but the only thing we can do until
the ProParser can operate remotely.

Change-Id: I9e5cad6241239b4df45c44538dbb0f56c56d5e57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 12:14:07 +00:00