Commit Graph

62421 Commits

Author SHA1 Message Date
Jarek Kobus
e2155a91df CppTypeHierarchy: Don't create/store QIcon in non-GUI thread
Store Utils::CodeModelIcon::Type enum instead.
Drop unneeded CPlusPlus::Symbol *declaration from CppDeclarableElement.
Remove unused CppClass::operator==().

Task-number: QTCREATORBUG-28529
Change-Id: Ie3487fa5f73d714ef375c42f1e64023ccc4194ee
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-07 11:24:34 +00:00
Eike Ziller
d8343b4b46 Fix crash after closing preferences opened from indexing progress
The preferences dialog is modal and creates an event loop that would be
running within the mouse event handler of the widget. When the dialog is
closed after the widget is destroyed (i.e. after indexing finished),
control would be passed back to the destroyed widget, and crash.

Fixes: QTCREATORBUG-28566
Change-Id: I71efa683822b5682ad1b38c39ce8f73c89bdd610
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-07 09:26:10 +00:00
Artem Sokolovskii
f93404d405 CodeStyle: Fix loading settings at the start in codestylesettingspage
Fixes: QTCREATORBUG-28450
Change-Id: I578c6cd102e4753d3af562986dad62e10e54d06d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-06 12:44:45 +00:00
Christian Stenger
538b77e376 CompilationDatabasePM: Fix test on Windows
Change-Id: Id771d3fbcb111ef3b8c4177981794c3bd841cedc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-06 12:30:04 +00:00
Ulf Hermann
d6484109b7 Add missing Q_OBJECT to PerfRunConfigurationAspect
Without this we cannot identify the aspect when trying to retrieve the
settings. Therefore, we always run without any settings, and in
particular with an empty command line for perf.

Fixes: QTCREATORBUG-28545
Change-Id: Ia419c939d57ff65eca4992faff02c121ca20c83f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-12-05 16:47:05 +00:00
Christian Kandeler
36ebb4bf22 CppEditor: Move "Show Preprocessed Source" action further down
... in the menus.

Fixes: QTCREATORBUG-28537
Change-Id: I51b4a258da8d654521d0e32256a7143960898227
Reviewed-by: hjk <hjk@qt.io>
2022-12-05 15:27:11 +00:00
Cristian Adam
9deef74d9e CMakePM: Allow presets inherits for deeper hierarchies
Fixes: QTCREATORBUG-28498
Change-Id: Idea5cdec6ad6acfba289dd77632770b7dfbf64f2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-02 16:23:46 +00:00
Alessandro Portale
5649fc30ca main: Prevent GTK3 platform theme plugin from enforcing a dark palette
Fixes: QTCREATORBUG-28497
Change-Id: Ib49b57aafe044d711940db3ea0e0778206221111
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-02 16:05:33 +00:00
Jarek Kobus
1755f208fb InfoBar: Ensure we don't access nullptr
Change-Id: I4bd7019ea424c04cc1f1e130d76033175ac3a5bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-02 14:12:57 +00:00
Jarek Kobus
c37ee615a6 ICore: Fix possible crash in raiseWindow()
Don't call else branch with nullptr when window is nullptr.

Amends 79be19a8a0

Change-Id: I4c1ee3783d36374cbc6ad9555328b5737f2ce348
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-02 14:00:07 +00:00
hjk
b88611f663 Core: Fix capitalization of external tools dir
Amends 451d02c88d.

Change-Id: I7e00c1f6262510f71d83a2f668b3b0353df6fce2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-02 11:26:21 +00:00
Jarek Kobus
10a306b3f4 DocumentModel: Fix possible use of deallocated memory
Setting entry to nullptr inside DocumentModelPrivate::addEntry()
sets it only locally inside this function, so the caller of
addEntry will still hold the originally passed pointer. So, if the
"if (previousEntry)" condition was hold, the caller of addEntry
operates on deleted pointer.

In order to fix it we return the valid pointer instead.

Change-Id: I3e4a5c3532ca942c43ab422a238f0a19ebd41794
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-02 11:11:53 +00:00
Christian Stenger
b43f9fd002 McuSupport: Fix tests
Change-Id: I17f4194f2e5be319e73834aa0f10e99821874c9a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-02 08:01:22 +00:00
Cristian Adam
e0a563b236 CMakePM: Migrate build environment settings also to configure step
This allows a project to be properly configured with Qt Creator 9 when
the build environment had user defined changes.

Qt Creator version prior to 9 had one setting for both configure and
build steps.

Fixes: QTCREATORBUG-28372
Change-Id: I0da8065085bd6628ba75923c17b46648eb031801
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-01 23:52:10 +00:00
David Schulz
69fef7480e LanguageClient: prevent nullptr access
Change-Id: Id0dc46d3775d5e765d1e7d2c2eac0d7f807f34ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-30 13:11:09 +00:00
David Schulz
7373193584 Debugger: map reported breakpoint file locations
Fixes: QTCREATORBUG-28521
Change-Id: I8229483df7fb0c51750e19d4558e81f5320e7f33
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-30 07:45:33 +00:00
Jarek Kobus
f3ce23230e TextEditor: Init markWidth variable
Otherwise some overrides of extraAreaWidth() may leave passed
value unmodified and we may end up with uninitialized value.

Change-Id: Ica89019fc2cff93f0bc7d784624730ec9d8c0224
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-30 07:22:09 +00:00
Jarek Kobus
05189a676f Squish: Init token variable
Otherwise it may be uninitialized when while loop finishes
immediately.

Change-Id: I7638025813d4353abc864e106ef0e09c7c218409
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-30 07:15:01 +00:00
Jarek Kobus
72a01bd00e ClangTools: FilterDialog: Capture by copy
A reference to buttonBox gets vahished after c'tor of FilterDialog
finished. Capture by copy the buttonBox.

Amends b72ae58629

Fixes: QTCREATORBUG-28524
Change-Id: Id6eaf826243e307f26a91c4bd6386cf836bce111
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-11-29 19:41:09 +00:00
Christian Kandeler
2f8e962f83 Debugger: Do not force cdb when no toolchain is configured
... in the kit settings widget.

Fixes: QTCREATORBUG-28458
Change-Id: I75907bfeeff56173fb9d92045345ba0ca15584b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-29 12:11:37 +00:00
Marcus Tillmanns
452e1ca232 Docker: Ensure workdir for processes is reachable
When starting a process, make sure that the working directory is
reachable.

Change-Id: I911239d03afd916411d7fb03da806211349ff7e4
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-29 10:03:34 +00:00
Christian Kandeler
ed06978830 ClangCodeModel: Switch off clangd persistently
... after failed machine suitability check.

Fixes: QTCREATORBUG-28441
Change-Id: Ic0fb956168204d8023ff96f92ae3fcd7cea8b0e9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-28 10:43:43 +00:00
Tim Jenssen
98a40b3690 CMake build: Make errors of execute_process fail the build
Instead of silenty failing and resulting in broken builds/packages.

The property is only available since CMake 3.19, so limit the feature to
that.

Change-Id: I82b06e78540e81a809f7fdfe130648becfc9672e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-28 08:29:42 +00:00
Eike Ziller
e24ad7ac55 JSON wizards: Print parsing issues only with -customwizard-verbose
Some wizards will miss required components when corresponding plugins
are disabled. That is fine, and not an error per se. When actually
developing a wizard, these kind of errors should of course be posted,
but that is what -customwizard-verbose is for.

Fixes: QTCREATORBUG-28502
Change-Id: I3647d37ef7ca4dace7592c5443bdd13720290016
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-25 15:04:52 +00:00
Christian Stenger
c210ffb2d6 AutoTest: Fix debugging of gtest based tests
Amends 6ae6390661.

Fixes: QTCREATORBUG-28504
Change-Id: I7617b080f4ac872c1f806a8e89fa9084a0ac948f
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-25 14:47:25 +00:00
Eike Ziller
cb8742ccab Make it possible to select default session from menu
when we are in the limbo state where no session has been loaded, and the
default session has not been explicitly created or loaded yet.

Fixes: QTCREATORBUG-28393
Change-Id: I66d69561e18b5073a477d90c1926074e3cd97cee
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-25 12:37:40 +00:00
David Schulz
3cd3bba720 Debugger: update thread selector after setting current thread manually
The issue is only reproducible when interrupting a running inferior with
cdb.

Change-Id: I336413d7f36aad28108623eb1bf8015b42f3dbb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-25 12:13:45 +00:00
Orgad Shaneh
4225f475a4 FilePath: Do not strip macros when normalizing path
Fixes: QTCREATORBUG-28484
Change-Id: Id6bcd2aef048bd355c196013c54799e4944135bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-25 11:57:04 +00:00
Christian Kandeler
0f202ea724 ClangCodeModel: Restrict opening non-project files to headers
We cannot tell clangd to opt out of indexing for certain files, so we
must prevent "foreign" sources from ever getting opened, or we will have
strange effects in the case of non-unique symbols.
Note that there are more (upstream) problems in this area, but this
patch limits the damage at least.
Amends 8ad7ab2d2a.

Fixes: QTCREATORBUG-28452
Change-Id: I131be699a35da8eacea6415c630e9012cc905a47
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-25 10:21:21 +00:00
Eike Ziller
a0e74ce3e0 UpdateInfo: Fix wrong properties for progress info
It was no longer showing "No updates found." in the status bar if the
progress details are off, and the progress details were no longer
directly hidden if updates were found.

Amends 93401c9c81

Change-Id: I53c441a990c9cbda1a49969f57eb76128ab020c1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-11-25 09:40:19 +00:00
Christian Kandeler
ea3e227944 CPlusPlus tools: Fix build
Catch up to recent refactorings.

Change-Id: I14e8fa03a50ea4169ccdd41ed0d147d6ecb8af8b
Reviewed-by: hjk <hjk@qt.io>
2022-11-24 15:42:41 +00:00
Eike Ziller
2ff5f18bff Transform doc.qt.io/qt-creator links to internal qthelp links, for links
that are found locally in the documentation. That opens such links in Qt
Creator, instead of in the web, if possible.

Change-Id: I2270c6947db22f4aeb4968bf5b7245de57521c92
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-11-24 15:10:05 +00:00
Eike Ziller
7a2901d502 JSON wizards: Read additional paths from settings
Opens possibilities like the installers writings some.

Change-Id: Ie8c87731fb6bb9c7129032f64878e42e9bcf4cf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-11-24 14:03:33 +00:00
Christian Stenger
27df715479 ClearCase: Fix display of mnemonic
Change-Id: Ic0f8e55ad2a141031d8540c6fdf7b0ed5a9b0aba
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-11-24 12:40:51 +00:00
Thomas Hartmann
5995810d34 FilePath: optimize comparison
* The QTC_ASSERT in pathView() is quite expensive
* Constructing the scheme using scheme() is not required

Change-Id: Ibea33dd6abf67c8bd184d118f23e2598075c362c
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit e471417539)
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-11-24 10:10:42 +00:00
hjk
3d492c47e7 FilePath: Backport some pathView() changes
After the change to a single-string representation, the QString
construction for path() is expensive for the comparison operators
and simple convienience functions.

Change-Id: I643c7115d3ad52f971d1692230b6eab82645b810
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-24 10:10:21 +00:00
Eike Ziller
373200accf Fix double * for long names of changed documents
We used to elide the right part of the name, and needed to take care of
not eliding the * away in that case. Now we elide in the middle, and in
that case the * may not be added to the elided text again.

Change-Id: I646b51d315e141a65df67841e163826e7136c118
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-23 10:17:25 +00:00
Eike Ziller
b7716087e1 tst_tracing_*: Fix build in certain configurations
There are Linux distributions that (at least for building packages)
separate the development packages for the various Qt modules.

So, to find the include <QtQml/qqml.h> in timelinemodel.h when
building the test, a dependency on QtQml is required.
Pass the dependency down to everyone depending on the tracing lib.

Fixes: QTCREATORBUG-28434
Change-Id: I58a534a9c25f1f6ecfc10a9ce8292b5983cdcbae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-23 08:38:02 +00:00
Marcus Tillmanns
0f8613f61b CPPEditor: Allow clangd from device
Change-Id: Ia9b59b374aaebf0bfb820b5a289c6e3c0599cb10
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-22 09:26:29 +00:00
Alessandro Portale
dfa5b54647 Utils: Fix StyleHelper::drawArrow workaround for 6.4.0
The workaround that fixed the drawing of arrows after a change between
6.4.0 and 6.4.1 broke the drawing of arrows with Qt 6.4.0.

This change add another enforced detachment of the palette (leading to a
modified cache key) that works with Qt 6.4.0. It still works with 6.4.1.

Amends: 9d32093421

Change-Id: I8917c99488cec4fb17ed148bb3b0f95d4ed7127c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-21 15:26:57 +00:00
Cristian Adam
61fcdcb4a1 CMakePM: Do not crash with invalid build presets
If a build preset doensn't reference a configurePreset, the preset is
invalid but Qt Creator crashes.

Task-number: QTCREATORBUG-24555
Change-Id: Ibf5dd7f1bb165d8b7f392e6a1aaa043548bb0f7a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-11-19 12:55:40 +00:00
Thomas Hartmann
4a556fef39 QmlProject: Check if .qmlproject file does exist
Task-number: QDS-7434
Change-Id: I3e6717dbab47fd9e5c9fb84c4131ac2f88984cd8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-18 17:09:45 +00:00
Alessandro Portale
9d32093421 Utils: Workaround StyleHelper::drawArrow for Qt 6.4.1
A change in Qt 6.4.1 influences the behavior of QPalette::setColor, so
that the arrows appear in a wrong color. An enforeced detachment of the
palette in style option works as a workaround.

Fixes: QTCREATORBUG-28470
Change-Id: I4a44ff59c368105fdf448152d83e96cdedd46495
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-18 16:27:46 +00:00
Eike Ziller
f5efd9acc0 JSON wizards: Don't add paths from environment over and over
It would add the paths from the environment variable again, each time
the searchPaths are requested

Change-Id: I2650ba832e23b5fcd6bfd363389e1eaf3beddb9d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-18 16:08:40 +00:00
Christian Stenger
c18d8773db Debugger: Fix interrupting Qml
Fixes: QTCREATORBUG-28469
Change-Id: I421dd18e0aedbe6628d4817fddf271c1a2bfbeb0
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:01:04 +00:00
Christian Stenger
966498f9a4 PerfProfiler: Be more verbose when running perf
If perf cannot be started for whatever reasons it is quite hard to
figure out its reason.
Add a note how perf is started and give some hint on the application
output pane as the message box points the user to it.

Task-number: QTCREATORBUG-28462
Change-Id: I4d386078f6e3719fefc9b3dc7d77fffbdb294030
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 14:20:01 +00:00
Christian Stenger
8d88932f41 PerfProfiler: Set working directory
Task-number: QTCREATORBUG-28462
Change-Id: Ie1f4cc505bb859abe40c6e95bb6733a54b8b610c
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 09:53:32 +00:00
hjk
dc620e987d Python: Avoid flashing a separate widget when opening settings
Change-Id: Id0518c222ffa91bc8791cfa71edb9b715ce65cde
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-18 08:39:12 +00:00
Christian Kandeler
4db30d9b60 Update qbs submodule to HEAD of 1.24 branch
Change-Id: I595bcd4789dfcf21a87391e465d33faf00bdd808
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-18 07:48:23 +00:00
Marcus Tillmanns
d7869967ce ProjectExplorer: Remove duplicate devices
In rare cases it can happen that the installer creates a device that happens
to have the same rootPath as a user created device. We need to filter
these out since otherwise it can be random which of the two devices
is selected.

Change-Id: I8269795a2e4f439fb2f02d819272723a504c6703
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 14:10:11 +00:00