Commit Graph

80509 Commits

Author SHA1 Message Date
Jarek Kobus
154e3df17e CppQuickFixes: Fix possible null dereference
It may happen that we dereference null inside the following
condition:

  if (declarator->postfix_declarator_list)

This may happen in case we entered the "if (!declarator)"
condition, but didn't fulfill the nested
"if (path.at(n - i++)->asPointer())" condition.

Detected by clazy analyzer.

Change-Id: I47135bc5648459e91664a4f65f9752b58248a496
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 14:10:53 +00:00
Jarek Kobus
b0e6943491 TextEditorWidget: Ensure non-null source is passed to insertFromMimeData
Detected by clazy analyzer. The possible context was
TextEditorWidget::dropEvent(). In some branches we ensure
that mime is not null, but later we call insertFromMimeData()
unconditionally.

Change-Id: Iee5138bc19d405050eafc9617d3c2ed123b767c7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-08 13:52:12 +00:00
Jarek Kobus
55ba10be38 RemoteLinux: Pass context object to lambda connections
Change-Id: I025c588e7d32be0f940b74acf9421965073cff5c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 13:51:06 +00:00
Mahmoud Badri
d0c9bc76cb QmlDesigner: Update textures sources on state change
Also small relevant fixes.

Fixes: QDS-8523
Change-Id: I8125b124024ee18de8c70afbc9f633c3b9265e82
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-12-08 13:49:21 +00:00
Jarek Kobus
b67201c410 Git: Simplify ConflictHandler
Don't create QObject instance when handling conflicts.
Operate on static functions only.
Replace destructor of ConflictHandler with finalize() method.

Change-Id: If579edc6213faa50c73a90cedf4b67cf985478ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-08 13:46:59 +00:00
Jarek Kobus
f9800bb790 ClangTools: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I502eb5cd89505fb77c02abf44b7ce19541a8ac2f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-08 13:46:41 +00:00
Aleksei German
37564d267b QmlDesigner: Fix Connections status in ContextMenu
Task-number: QDS-8521
Change-Id: Id0b835fb14b18563d4ecc0c1b2039b9bb181c32c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Aleksei German <aleksei.german@qt.io>
2022-12-08 13:22:37 +00:00
Miikka Heikkinen
636c9524f9 QmlDesigner: Work around the issue in QtQuick3D 6.4 geometry caching
QQuick3DGeometry::updateSpatialNode can create QSSGRenderGeometry
object with exact same address as a previously created and subsequently
deleted QSSGRenderGeometry object (i.e. the memory location is reused).
If the previous node was not used for the exact same logical geometry,
then you get these artifacts, as QSSGBufferManager uses
QSSGRenderGeometry object pointers in QSSGBufferManager::loadRenderMesh
function to determine if it needs to reload the geometry and what
geometry gets used for each model. The cache still contains data for
the deleted node, which is then matched for the new node with same
address.

This workaround ensures that none of our grid geometries will have the
same generation id and thus will never get improperly matched in
QSSGBufferManager cache.

Task-number: QDS-8516
Change-Id: I017a4ae4a59eef2bb26ade5abf13e8f74f57c4af
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-08 12:40:07 +00:00
Cristian Adam
6bef53a818 PE: Add ability to skip vcvarsall.bat /clean_env
By defining QTC_NO_MSVC_CLEAN_ENV one can skip the vcvarsall.bat /
clean_env functionality.

Task-number: QTCREATORBUG-28561
Change-Id: I6392b2278008607042a43a38a2c38669b4b52183
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-08 12:21:26 +00:00
hjk
b354421f27 CppEditor: Use FilePath in fileSizeExceedsLimit()
... and adapt caller side.

Change-Id: Idd832101962dcdc8b24f96bebbdb77fd3e29ba7c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-08 12:07:45 +00:00
Mahmoud Badri
e70f909bcf QmlDesigner: Update texture editor and browser after source reset
Fixes: QDS-8520
Change-Id: I9ceca64d75ef1c41633a89a79748265beecd16ea
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
2022-12-08 11:32:08 +00:00
Jarek Kobus
5c86f58bdd Boot2qt, Qnx: Pass context object to lambda connections
Change-Id: I64c5ed32035f161920a7ba08fa67de7bee6653a3
Reviewed-by: hjk <hjk@qt.io>
2022-12-08 11:28:24 +00:00
Jarek Kobus
c021fb5179 Don't call non-const methods on temporary QList
Otherwise it may unnecessarily detach. Either store a local
const reference or call const equivalent (e.g. constFirst()).

Change-Id: I96d665487cf28c17e72bea17f1b8f164ce06cc70
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-08 10:21:57 +00:00
Jarek Kobus
8e7e1dd5f2 Mark some virtual overrides final
These methods are being called from c'tor or from d'tor.
Make sure these methods will not get overridden by any possible
subclass, otherwise these calls won't be dispatched properly.

Change-Id: I3652d2f495940f13b48b494ab2cf06abb3d37e7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-08 10:21:44 +00:00
Jarek Kobus
42bc552f2b Beautifier: Pass context object to lambda connections
Change-Id: If1231b609e6987cbf9e26eb2f5a69da8e40e1363
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-08 09:58:26 +00:00
Jarek Kobus
c5a60d2dc2 Docker: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I2fcd83ec2e68a7aeb8f51fa39e7e69cc16e26bc8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-12-08 09:50:53 +00:00
Jarek Kobus
9e571931d0 AutoTest: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Glue lambda brackets with parameters brackets.

Change-Id: I414f7dbbaf60b452cb71f77d53d972937f121a47
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-08 09:32:42 +00:00
Jarek Kobus
f6913ce791 Squish: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Glue lambda brackets with parameters brackets.

Change-Id: I8f08699c23e2cb624ac32f0f11cfe8f5703a3d7c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-08 09:26:41 +00:00
Marcus Tillmanns
0ddc0eb8e9 ProjectExplorer: Re-layout target selector
When the summary changes, we need to recalculate the layout as it
might change the height of the target selector. Otherwise the selector
might move while the mouse is still pressed, leading to an unwanted
selection.

Change-Id: Ic1f1ffc89376caf33ecf1be80b7aeda52839bc5e
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-08 09:18:42 +00:00
Mahmoud Badri
b530f938ba QmlDesigner: Keep search on when adding a material or texture
Fixes: QDS-8487
Change-Id: Id02d693a5a707e97555450ce860ee4480e7742eb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-12-08 08:57:26 +00:00
Jarek Kobus
5769fd82d3 CorePlugin: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: Id664cfc3b46685f63fb205beaf16a7c271ad95d9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-08 08:50:07 +00:00
Jarek Kobus
94e98281e9 ScxmlEditor: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I12a3498c3c13121e021e13b763905fc6a41b214d
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-12-08 08:49:49 +00:00
Eike Ziller
deb454d8fb SaveItemsDialog: Fix default button
Changed when removing .ui file. Call order is important here.

Amends b3e3de517d

Task-number: QTCREATORBUG-28536
Change-Id: I04d9351f8bb7f2ed170f3643ba84af5f8afe35ab
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-12-08 08:05:13 +00:00
Eike Ziller
a499058a6f Utils: Add push button with menu and default click action
QPushButton has the functionality of setting a menu, but that replaces
the normal "click" functionality, and always opens the menu on click.

QToolButton can have a menu and the user can still click on it to just
click. But, QToolButton looks very different, and in combination with
other, normal push buttons very alien.

Create a push button that only shows the menu when clicking on/near the
menu indicator, and otherwise just sends the clicked() signal like a
non-menu push button.

Change-Id: Id6ba367e40c370275f67f0fbf77521c2e974b3b8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-08 07:36:28 +00:00
David Schulz
69ce2a4047 Editor: ensure something is selected after model update
Change-Id: I3fbf14cb7aa60caef43340302e74e80ed5e3ba4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-08 06:16:33 +00:00
Jarek Kobus
0313470db0 VcsBase: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I20e43625793401544e86efb627f5921c395026bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-07 21:54:39 +00:00
Kwangsub Kim
b4015fc345 BareMetal: Auto-detection of IAR toolchain version 9
The Windows registry node containing the installation path of IAR
workbench changed since version 9 that is the same as the one for
32-bit Windows host. Multiple registry keys will be used to identify
the latest IAR toolchain as well.

Task-number: QTCREATORBUG-28245
Change-Id: I92ed0c10a38e081ca45fcf9e543d902a3e98efc2
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2022-12-07 16:37:34 +00:00
Jarek Kobus
0d74be319a Android: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: Id00e2bc736683bb844cc7ba936ac9d21aa204416
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-07 16:30:13 +00:00
Jarek Kobus
9afcf870a1 Utils: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I6b7e07cad8a240a7021c6ddacc84a971809ee717
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-07 15:28:47 +00:00
hjk
166f710e62 ProjectExplorer: Simplify scanning for wizard.json files
No need to manually implement recursion when QDirIterator::Subdirectories exists.

Change-Id: I88f04da9a6138e3fc903016dd85b94ba431e3b1a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-07 15:11:01 +00:00
Christian Kandeler
89453faffe ClangFormat: Fix qbs build
Change-Id: I871a0606ab87bcdb5c554b37ac1a2887bb52acdc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-07 14:51:38 +00:00
Jarek Kobus
ecf83d667c AutoTestUnitTests: Remove TestStringTable scenario
Instead, we should provide tst_StringTable that would
run GC, make a sleep inside GC being run in other thread
and execute destructor of StringTable in main thread.
In this case the test should ensure that destructor of
StringTable waits for its internal thread to finish.

Amends 7a02b39f26

Change-Id: I017b5a8f98b41ef6884c43d319858dcb16f17fba
Reviewed-by: hjk <hjk@qt.io>
2022-12-07 14:46:24 +00:00
Christian Stenger
ea01c74d50 Squish: Ensure using correct case while debugging
Especially on non-casesensitive OS we may get the information
regarding break point locations with a wrong case which would
try to set a break point and silently fail as the files are
internally used with their correct case.

Change-Id: I32a780629e1b10ea075d669b8eca812fbd994600
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-07 14:42:06 +00:00
Mats Honkamaa
4b6c1c9f14 Doc: Add missing views to overview page
Task-number: QDS-8404
Change-Id: I071ee72d01f7bdf007fd4eee27e6e17f35f8b5e0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-12-07 14:28:12 +00:00
Christian Stenger
e620299fda McuSupport: Fix tests on Windows
Change-Id: I465fa2dc93ddeed2b3ef3d754b3992f88973862f
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-12-07 14:06:35 +00:00
hjk
9a8d34ecf8 CplusPlus: Pass FilePath to Preprocessor::run()
... and update caller sides.

Change-Id: I6a107e4a7fd9f7123cdc6f141da202845bcbbb66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-07 12:58:31 +00:00
Jarek Kobus
89f4381964 StringTable: Switch off debug printouts by default
Amends 7a02b39f26

Change-Id: Ie5ee3cd6119adf47149dcfaf4a6847474dcf4dbd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-12-07 11:45:37 +00:00
Jarek Kobus
0c9706ada9 CppTypeHierarchy: Don't keep pointers to temp objects
When building type hierarchy the pointers to list
elements were put into queue. Later, the list was
modified and it was possible that list detaches
causing stored pointers to be invalid.

Simplify building type hierarchy by adding helper recursive
methods.

Fixes: QTCREATORBUG-28529
Change-Id: I240513fc097536d2175e2242766127b92aaa6a82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-07 11:28:15 +00:00
Jarek Kobus
c5a27770f4 InfoBar: Always order buttons in the same order
Change-Id: Ic95aa15ba770b6c75eb3a48bdfabdb7420f8d6ae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-07 11:26:10 +00:00
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
David Schulz
8c8f3e30b5 LanguageClient: Fix handling of defective language server
If the language server cannot be started, the client might be already in
an error state before the language server gets initialized.

Change-Id: Ib6c9df13b381e7854806714c07f4830796bb2cd3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-07 10:58:31 +00:00
The Qt Project
b7e70592d6 Merge "Merge remote-tracking branch 'origin/9.0'" 2022-12-07 10:53:46 +00:00
Marcus Tillmanns
bd716a16bb languageclient: Write errors to log file
Helps the user to better understand why his language server might
have a problem.

Change-Id: I9440a28cb5d0d35808b497bcdcd545d7b10597a0
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-07 10:30:10 +00:00
David Schulz
d011733131 Core: never disable the replacement edit of search results
We need to be able to change the replacement text after a failed clangd
replacement request.

Change-Id: I0e97af18c6cbfd4bc4e4f8705a7b760dd97bd960
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-07 09:53:32 +00:00
Eike Ziller
b4fed03c27 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppeditorplugin.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: I41747ff9490e4ab20340d4d4acb4655100aaa3d2
2022-12-07 10:47:47 +01:00
Jarek Kobus
36ffacabe7 ExtensionSystem: Fix some clazy warnings
Fix use multi-arg.
Add a context object to lambda connections.

Change-Id: I02711c9ecc55188fb174895f7df59f25effd0834
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-07 09:28:32 +00:00
Artem Sokolovskii
0b9711b9c5 ClangFormat: Get rid of ui files
- new clangformatchecks files are generated based on
utils/layoutbuilder

Change-Id: Ie376755abc632083898e44ea57d2ff8600e47f34
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-12-07 09:26:11 +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
e58c60ec9d ClangFormat: Remove without margins layouting from script
Change-Id: Iddf69e73ca5df48541e83030b2a09e7833f9fa64
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-12-07 09:25:56 +00:00
Miikka Heikkinen
a5fb9fc95f QmlDesigner: Add "Apply as light probe" option to material browser
Textures in material browser can now be applied as light probes to
the active SceneEnvironment node.

Also changed the logic for resolving the active SceneEnvironment node
to prefer a currently single-selected SceneEnvironment node over
the SceneEnvironment node associated with currently active 3D scene.

Fixes: QDS-8472
Change-Id: I9a3a7b9c2fad3c8120e85ade507a7ea66de19f1d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-12-07 09:20:50 +00:00