Commit Graph

72811 Commits

Author SHA1 Message Date
Jarek Kobus
2d1d4d9ba3 Android: Optimize isConnected()
Before, the implementation used connectedDevices() function
which constructs the detailed info about each device
found, including running 3 extra processes for each device
in a loop. For the purpose of isConnected() - the detailed
info isn't really necessary - it's enough to parse the output
of the {adbToolPath(), {"devices"}} command and detect if
the requested serialNumber appears there. We skip executing
3 additional processes for each device found.

Change-Id: I34f79fb56b4aa4d52a284bc2c67ae01a3467b505
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 12:33:53 +00:00
Christian Stenger
7f08529a60 PE: Remove left-over connect
The item view was made read-only and this connect
only results in a warning on the command line when
double clicking an item.
Amends 8ef85e481a.

Change-Id: I32d6b9d38e2c554fb91f5cbd1f1f5fd1e6c1a394
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-05 11:45:57 +00:00
Christian Kandeler
c33decf1b0 Utils: Fix editing in environment widget
In the edge case that the name of one variable starts with the name of
another followed by an underscore, we mistakenly stopped at the former
when searching for the latter in the text widget.

Fixes: QTCREATORBUG-30855
Change-Id: I6decf7805a937d52d25e6c62899ae062f636a2a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-05 11:12:07 +00:00
David Schulz
f3e164af4f ProjectExplorer: prepare for parallelization of recursive file scan
Change-Id: Ia2db3ef0fe619907c1ed30b8f984de4de04cc477
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-06-05 10:59:59 +00:00
Christian Stenger
5b93e34c00 Utils: Allow comments in environment items
This patch allows commenting environment changes or adding
comments to the batch edit widget.
To mark a line as comment prefix it with '##'.

Modifying the environment by using the batch edit mode
allows using '#' to disable variables.
Mis-using this to disable statements of the environment
items widget is tempting and other tools explicitly allow
it this way. But when doing so, the environment may get
some unforeseen modifications.
So, explicitly provide a mechanism for comments and be
more clear about this inside the documentation.

Change-Id: I6a58d0d00e996a3f886ec30e826cade324321818
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-05 10:48:24 +00:00
Eike Ziller
6692462dcb Wizard: Fix size calculation of outline titles
On macOS we now (with Qt 6.7) get nice, high resolution pixmaps from
QIcon::fromTheme. That means that our wrong assumption that the pixmap
size == UI size leads to huge layout sizes for the indicator of the
current wizard page.

We need to take devicePixelRatio into account for determining the UI
size.

Fixes: QTCREATORBUG-31015
Change-Id: I6e9c77cf2f37fce60735e75c1fa694e4b4208b98
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-05 10:40:10 +00:00
Artem Sokolovskii
e8938acca9 ClangFormat: Fix indenting 'return' after key words
Change-Id: I9e11b4d299c13ffada897b009fb70c3447213500
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-05 10:22:50 +00:00
Artem Sokolovskii
9b2bd223dd AppStatisticMonitor: Use QCharts instead of self made
Change-Id: I4de07dd104dec9e1c68e5daf00a55ab7f8a3f72e
Reviewed-by: hjk <hjk@qt.io>
2024-06-05 10:22:12 +00:00
Mahmoud Badri
4e4c8cc8c4 Add ZipWriter/ZipReader to qtc
Also zlib dependency is added.

ZipWriter/ZipReader were taken from qtbase
(b85a9d0ee16e3bdc817eb1e8a8f85026e631b401)

Change-Id: I5ab68c91fe97f06d65fb43a78949b0d6569eb6a4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-05 09:46:59 +00:00
Cristian Adam
f17c0fe19c CMakePM: Fix Presets macro expanding of environment
Amends a25bbf23c6

The commit broke evironment variable usage in CMake presets. For example
"$env{HOME}" would have been expanded to "/home/user:/home/user" because
of code thinking it deals with paths.

Change-Id: I3ef34179e2ebaf55b25a42dcce87438c1a72b73e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-05 06:59:13 +00:00
Tim Jenssen
59ceee6d5c QmlDesigner: prepand license type to about information
Task-number: QDS-12849
Change-Id: Ied891021c412af0941f6575a1b2d994ace2345ce
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-06-05 06:56:39 +00:00
Jarek Kobus
6621c68ca9 TaskTree: Qt-ify the code
Make it more conforming to the current Qt style:
1. Remove trailing semicolons after inlined functions.
2. Use Q_SIGNALS / Q_EMIT in headers.
3. Use QString::fromLatin1() where needed (as otherwise the string
   c'tor is deprecated).
4. Use module names in Qt includes.
5. Simplify local asserts in barrier.cpp.

Change-Id: I13cadee6ff61a24d792efcf3b613f7cf5563076b
Reviewed-by: hjk <hjk@qt.io>
2024-06-05 06:55:07 +00:00
Jarek Kobus
dfef293aa4 Android: Fix find process and user PID recipe
Before, the loop got finished after the very first
failure of the pid command. Fix it so that the loop
stops on the first successful execution of any child.
Make timeout task return error, so that the loop
continues executing after the timeout.

Simplify some commands' constructions.

Amends a7ece15f6e

Change-Id: I637002f0248ec69e61e058c7246471396aac1142
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-04 18:41:46 +00:00
Cristian Adam
831b93905b CMakePM: Set platform codegen and linker flags for GCC compilers
If a GCC compiler has platform codegen flags they will be set into
CMAKE_C_FLAGS_INIT or CMAKE_CXX_FLAGS_INIT initial CMake parameters.

The linker flags are set they will be set into
CMAKE_EXE_LINKER_FLAGS_INIT, CMAKE_MODULE_LINKER_FLAGS_INIT and
CMAKE_SHARED_LINKER_FLAGS_INIT initial CMake parameters.

If the kit has a Qt the CMAKE_CXX_FLAGS_INIT value will merge both GCC
C++ platform codegen flags and the QML Debugging flags.

Fixes: QTCREATORBUG-24420
Change-Id: I066d30b816ae8575f615654bb85bd82a394f9737
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-04 18:32:57 +00:00
Cristian Adam
a9995e23b1 CMakePM: Allow CMake custom build types
CMake can have custom build types. Qt Creator can rename existing build
types.

This changeset allows having a custom build type like for example:
  * CMAKE_BUILD_TYPE=MyRelease
  * CMAKE_CONFIGURATION_TYPES=MyDebug;MyRelease

Fixes: QTCREATORBUG-30014
Change-Id: I3d81d9ff867bfaab29aaf1741606f9c586da82e0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-04 15:30:37 +00:00
Christian Kandeler
ba017c03c2 RemoteLinux: Lower the timeout when retrieving the environment
Otherwise, a non-responsive device will freeze Qt Creator for ten
seconds (with no announcement, because the env call does not go through
the device shell).

Change-Id: I92ab847dd441494770dbe29cde1c726dd31f32fb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 14:53:49 +00:00
Marcus Tillmanns
00174e493f ProjectExplorer: Add WorkspaceProjectRunConfig
Change-Id: I66f25165f652f371130555279eddc0437b011887
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 14:08:54 +00:00
Eike Ziller
87a7451c2a LayoutBuilder: Fix build with Apple Clang
It needs an explicit constructor, otherwise it complains that it cannot
find a match to the Arg2{p1, p2} call (requires 1 argument, but 2 were
provided) etc.

Amends 6231213aa3

Change-Id: Ibe3b27b334b8abff5028a77372cf208bfda9d8c1
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 13:29:24 +00:00
Eike Ziller
ca3c4537d8 Merge remote-tracking branch 'origin/13.0' into 14.0
Conflicts:
	src/plugins/copilot/copilotsettings.cpp

Change-Id: I6d17cf8968d6efbafb883da8346c7950349f7d84
2024-06-04 14:43:35 +02:00
David Schulz
99ce8b522f Core: compress shortcut settings widget updates
reduces the number of calls to ShortcutSettingsWidget::initialize while
the shortcut settings widget is open and actions get registered. For
example when searching the preferences dialog the shortcut settings
widget is alive and some setting page widgets create a text editor,
which again registers some actions.

Change-Id: Ieb3c3d1c7ce317c3407a9c97514f6cc4a4ce76c4
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 12:32:43 +00:00
Marcus Tillmanns
f512bbff89 Copilot: Adapt to agent.js => language-server.js rename
Copilot has changed the name of agent.js to language-server.js. This
patch adds the new name and changes the installation note without
changing the translation.

Change-Id: I585fe54c86029de32de806447ec3356999a99540
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 12:29:34 +00:00
Sivert Krøvel
0e80f63a1a McuSupport: Use arm-none-eabi-gdb as a backup debugger
We normally use arm-none-eabi-gdb-py, but this doesn't come
with the new arm gcc version which ships with Qt for MCUs 2.8.0
To make sure the kit works, use this as a fallback.

Task-number: QTCREATORBUG-30699
Change-Id: I85c6c3ea1f7aae504e0aa1afb8a344d9bc3067d5
Reviewed-by: Kwangsub Kim <kwangsub.kim@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 12:19:25 +00:00
Sivert Krøvel
3be0b263a8 McuSupport: Read and write user settings with non-versioned key
The settings keys are versioned to avoid the situation where the
installer removes a settings key which may still be in use.
See QTCREATORBUG-29194 for details.

When reading from user settings, it makes more sense to use the
non-versioned keys, especially in the case of the main Qt for MCUs
SDK package path. With this patch, the plain settings key is used
to read and write except for when determining the default value of a
path in the McuPackage constructor, where we want to also look in the
system scope settings for the values written by the installer, which
may be version specific

Task-number: QTCREATORBUG-30810
Change-Id: Ib1e2be170cb7da24b6e4534b59f702b894556d8c
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 12:19:14 +00:00
hjk
6231213aa3 Utils: Make contents margins handling less special
Change-Id: I985419bbb213aba899c83efb49b376e0f3338bd5
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 12:16:03 +00:00
hjk
b10d5581e4 Utils: Make LayoutBuilder setter setup less repetitive
Change-Id: I9113f7a97566c21cf83dcb95ce8e75e9707360b4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 12:15:37 +00:00
Christian Stenger
968e47194c VCS: Fix handling of default executable
We set the executable by default to a single command which
should be used as found in PATH.
Although listed valid in settings some commands refuse to
run when we validate the command before running without
taking their full path into account.
Use the full path of vcs binaries internally to avoid
problems but still display single command if set.

Change-Id: If8677b531c5534d27c19557ed36fa780a248558f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-04 11:49:39 +00:00
Jarek Kobus
f1d0aee486 ProjectExplorer: Add projectnodeshelper.h into project
Otherwise this file is exlcuded from project search results.

Change-Id: I65ce5121ac105f5565c46e4b5a5fbd74bee966d6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-04 10:59:48 +00:00
Ali Kianian
9d872edce0 QmlDesigner: Make the material editor preview resizable
* Also the ui for the material editor preview is changed.

Task-number: QDS-12928
Change-Id: I37cdb5f5f0b701fd0eb9b00f837a7e5738829ea3
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-04 10:24:49 +00:00
Eike Ziller
3c71998e34 PluginManager: Fix -load all -noload Plugin
Setting a plugin forceDisabled must also remove the forceEnabled flag
and vice versa.

Broke in b39b192518

Change-Id: I9c2b84de0753a1b283c301b9868650e62c088144
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-04 10:17:05 +00:00
Christian Kandeler
408e986f2b ClangCodeModel: Fix potential crash
... when removing from the list of FollowSymbol operations. The done()
callback of ClangdFollowSymbol messes with the list, so call cancel()
after removing the corresponding iterator.

Change-Id: Ibb72ffa436598692e48119d93d430bb79bcb0f5e
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 09:21:25 +00:00
Orgad Shaneh
173aed9b8e C++: Fix compiler warning
warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

Change-Id: I3a8203c1662cfba36ebe28ad3bd1b5ff46b55dfe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-04 09:04:05 +00:00
Cristian Adam
725cf0637f CMakePM: Skip .obj/.o for static qml plugins in PATH
Amends 5d159e6185

This commit reverts to Qt Creator 12 behavior, plus skipping .obj/.o
parts which are needed for linking but not for finding out library paths
that need to be added to PATH environment.

Tested with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/
qml/tutorials/extending-qml/chapter6-plugins

Without the patch (Qt Creator 12 behavior):

"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_resources_1.dir/.qt/rcc",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_init.dir/chartsplugin_init_autogen",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_init.dir",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts",
"C:/Qt/6.7.1/mingw_64/lib",
"C:/Qt/6.7.1/mingw_64/bin"

With the patch:

"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts",
"C:/Qt/6.7.1/mingw_64/lib",
"C:/Qt/6.7.1/mingw_64/bin"

As you can see above, only skipping the .obj/.o files will bring a lot.

The change also doesn't come with the side effects of the Qt Creator
13.0.0/1 releases.

Task-number: QTCREATORBUG-29662
Change-Id: I264a0ef579177b7129471919b77cd22a46e7d511
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 09:03:31 +00:00
Christian Kandeler
bfd3b88bb8 RemoteLinux: Do not announce connection attempts from non-UI threads
This can lead to a deadlock. Example scenario:
  - Have a kit with an unreachable device as the build device.
  - Open a project with a .user file not matching the current QtC.
  - The target setup page will open, showing a candidate widget
    for each kit. These widgets contains path choosers, which nowadays
    start a dedicated thread to validate their input.
  - The path validation thread for the Linux kit arrives at setupShell()
    and tries to announce the connection attempt. To that end, it
    invokes a method of Core::ICore::infoBar, using
    Qt::BlockingQueuedConnection, as otherwise the call would either
    not be tread-safe or arrive too late.
  - As the InfoBar lives in the main thread, control is now passed back
    to that one, and the target setup page continues its work, which is
    to gather candidates for importing a build from. This involves
    perusing potential build directories for all kits. In case of the
    Linux kit, QDirIterator is backed by a remote call to find(), which
    triggers a call to runInShell(), which tries to acquire the mutex
    that is already held by the path validation thread, which in turn is
    waiting for the UI thread.
  - Qt Creator now hangs indefinitely.
Skipping the announcements for non-UI threads limits the usefulness of
this feature, but I don't see a better way.

Change-Id: I816c83358f543aa9a6e6e97eee7fa8ad95e66ea8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 09:02:40 +00:00
Marcus Tillmanns
a30eb2ccc4 Utils: Fix terminal process environment
The TerminalInterface did not fallback to the system environment
if no environment was set by the user. Instead it had platform
specific code that saved over the path.

Instead we just apply the user changes to the system environment.

Change-Id: I011f1a9d935c958265b2bda8257ad8611f06e578
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 08:43:01 +00:00
Marcus Tillmanns
249312acd0 Lua: Add -loadluaplugin startup argument
Change-Id: Ia0a57bbb94d42534857889a0d08ec41c75708dca
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 08:03:13 +00:00
Marcus Tillmanns
8965e12d4f ProjectExplorer: Add readOnly handling to runconfig aspects
Change-Id: If8ebd2d13c22bf60f50bb55a7b61f15ba81e481b
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 07:30:20 +00:00
hjk
4a4eda1b09 Debugger: Simplify some redundant file property checks
Change-Id: Ie6d638d0ece7b08dc28058f74f4c37910ffb6d83
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-04 07:06:07 +00:00
hjk
a726e5d349 Utils: Let all FilePath::is*{Dir,File} return false when empty
Less guessing on the user side what effectively happens.

Change-Id: I6ace4645d40346ee942ae7390575f28992dd0c26
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-04 07:05:56 +00:00
Cristian Adam
5d159e6185 CMakePM: Only add external "bin" dirs to PATH
At QTCREATORBUG-29662 we have the issue when a program cannot be started
because the PATH environment variable had content longer than 2048
characters.

Qt Creator 12 had only one place that added paths to librarySeachPaths
namely the "bin" directories.

Qt Creator 13 tried to filter these "bin" directories to the ones that
have .dll files. This fixed QTCREATORBUG-29662 but had issues with dlls
having different names than the link libraries provided by CMake.

By only allowing "bin" directories from paths not from the build
directory we allow Qt, or OpenSSL dependencies, but not just existing
"bin" directories.

Amends 0d8a542b4f
Amends 8713919f31
Amends ac97ab1abf
Amends 2ce6255a7d

Task-number: QTCREATORBUG-29662
Change-Id: If0b162f25ae1e5bfc1e1ff313720c54c5ae936c5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-03 13:33:55 +00:00
Eike Ziller
181d18e925 Fix another plugin json
Amends 6cd7aed8eb

Change-Id: I73667ca94aa746ef9e91984c2257efa842387adb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-03 13:25:45 +00:00
David Schulz
ff12f2f680 ProjectExplorer: avoid scanning file contents to detect the node type
Change-Id: I735464bed8d546475036e0d5ea61dc7cbbe78975
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 13:19:45 +00:00
Eike Ziller
5941c68dbd Find: Save settings in session
Usually the directories and search terms relate to the project(s) worked
on, so save them in the session.

Fixes: QTCREATORBUG-793
Change-Id: Ia00597a91fa3a902d6b8b4f2d8cb93634cdc333c
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 13:12:59 +00:00
Eike Ziller
f7c7cd0ae9 Find: Avoid saving default values for advanced search
Change-Id: I69454675c15a9eb92d0665ea6f88f0969a532eb8
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 12:03:54 +00:00
Eike Ziller
f870e7ffdf FindFilter: Move settings saving to Store
This makes it possible to save it for the session instead/in addition.

Task-number: QTCREATORBUG-793
Change-Id: I95bc20f4912a97863cb88849e32699a689ba6f3f
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 12:03:44 +00:00
Christian Stenger
c3a1b41fb3 Cppcheck: Fix handling of default executable
On Unix we set the default just to cppcheck and mark it even as
valid if it can be found in PATH.
But when running we silently fail as we expect a full path before
launching the executable.
Use the effective binary instead.

Change-Id: I03393b1d227c595da5142fce6b8bea5210a15747
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-03 12:03:40 +00:00
Christian Stenger
a6fabc48a3 Utils: Add effective binary getter to FilePathAspect
It is quite common to provide a single command as default value
for commands to be executed.
In several cases we fail to handle this correctly when trying
to validate or using the executable although it is validated
correctly inside the underlying path chooser.
This patch provides a method to explicitly get the effective
binary, means either the configured path or if it just had been
a single command it retrieves the full path information by
looking up the command in PATH.
This functionality is limited to non-device file paths which
are expected to be an (optionally existing) command.

Change-Id: I17db69f546f5fb9fec8809db91232f212d21e9a6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-03 12:03:29 +00:00
Eike Ziller
3d828123be Merge remote-tracking branch 'origin/13.0' into 14.0
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: I71bfee426a3e25ab7c7cd276ffe1e7d8fe550ffe
2024-06-03 12:23:06 +02:00
Jarek Kobus
100e106e70 MessageManager: Transform MessageManager class into namespace
Rename internal static m_messageOutputWindow into s_messageOutputWindow.
Make is a std::unique_ptr.

Change-Id: I27e9abf3dfa514d21f85d811e3647f65c26ddf31
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 09:52:28 +00:00
Jarek Kobus
8b5b914846 LocatorMatcher: Ensure the task list isn't empty
Change-Id: I4a8dac16e7f68df409bc7838ba0101732864a578
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 09:52:17 +00:00
Jarek Kobus
649d1cd6dc LocatorMatcher: Get rid of ResultCollectorTask
Simplify the implementation by creating and running the
ResultsDeduplicator directly on task tree start.

Change-Id: I08a0d2b924f92382c31771d4bbd878cc5506501e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 09:52:09 +00:00