Commit Graph

67514 Commits

Author SHA1 Message Date
Aleksei German
865d87a75f QmlDesigner: Update QUL metadata
Task: QDS-3622

Change-Id: Ie152ded36293ae4cc28caac426185db70f3ed2aa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-16 13:32:46 +00:00
hjk
32394632d2 Utils: Add CommandLine::addArgs(const CommandLine &cmd) convenience
This adds cmd's executable and arguments one by one to this commandline.
Useful to construct command lines for 'sudo', 'nice', etc.

Change-Id: I76067bc10e269b8e7ff4d945449be3633b321281
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-16 12:53:55 +00:00
Leena Miettinen
01d7fcd8d8 Doc: Describe combining multiple logic helpers
Also update docs according to the API review results.

Fixes: QDS-3581
Change-Id: I163b75421432391f4ffea334ffbc4ddacbf3e4e6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
2021-02-16 12:12:41 +00:00
Leena Miettinen
89695402c5 Doc: Update the Concepts and Terms topic
Task-number: QDS-3475
Change-Id: I9486ac0cebeca927dcaafb78dbc5e624fa27d03a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
2021-02-16 12:11:57 +00:00
Christian Stenger
0cb6f07829 LanguageClient: Fix crash when language server dies
Do not remove items of a container while iterating over it
instead revert to old behavior of allocating a temporary.
Broke with cf010911f7.

Change-Id: Ie76974f1e74469f80ee28fb2011d66690dd9e917
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-16 11:55:39 +00:00
David Schulz
23611c3438 LanguageClient: export settings widgets
Change-Id: Ica348818955c7ef9173780c65e44ff48ead4b172
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 11:35:31 +00:00
David Schulz
8106a01e9c LanguageClient: Add generic way to provide specialized settings
Change-Id: Iab482220ec7fd73ecd4cbf3d8b1b121e93148059
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 11:35:24 +00:00
Erik Verbruggen
7dc82b1af9 MCU: Do not add fall-back path for QUL kits
Fixes: UL-3609
Change-Id: I9912c7476f3b45346835d60be61fed7399046162
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 10:33:52 +00:00
hjk
12a0934830 Utils: Add the ability to interrupt inferiors via the process stub
This will be handy once we want to debug processes running as root.

The mechanism is the same as for "killProcess", and currently unused.

Change-Id: I2c5e5b77577ca32ed1118fcc81c03c6320db8800
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-16 09:57:00 +00:00
Jarek Kobus
f200466066 ClassView: Stop the running timer in Parser thread on close
When we are going to delete Parser object, it may happen,
that its timer is still being active. A call to
parserThread.quit() won't stop the timer. When we quit the
thread and wait for it to finish, the thread's timer may
still be active. Then we delete the Parser in the main thread,
what cause the following warning to appear:
"QObject::killTimer: Timers cannot be stopped from another thread".
In order to fix it, we post a request to the parser's thread
for stopping the timer by a call to aboutToShutdown() with
Qt::BlockingQueuedConnection, just before quitting the thread,
as the thread's event loop should still be spinning and is
able to receive and handle our request. It's the only safe way
to stop the active timer that was started in another thread
- it must be stopped it the same thread it was started in.
Inside the call to aboutToShutdown() we mark that we don't want
to start the timer anymore with m_shuttingDown flag and we stop
the timer. After the blocking call returns to the main thread
we are sure that the timer is not active anymore and it won't
became active in the future, so we safely quit the thread and
delete the timer.

Task-number: QTCREATORBUG-25317
Change-Id: I3b95c062b5561588c45c223d8588b2b700ad4040
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:42:09 +00:00
Jarek Kobus
4a15f6d16b ClassView: Optimize operator== of internal data
Make all of the fields of SymbolLocation and SymbolInformation
const members. Optimize a bit operator== of these structures:
check first if hashes are non-equal - in this case return
false early. Fix hash type of SymbolInformation for porting
to Qt6 purpose.

Task-number: QTCREATORBUG-25317
Task-number: QTCREATORBUG-24098
Change-Id: I769f99ff3157093e9f10ee3929bc7f6eb83f34e3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:56 +00:00
Jarek Kobus
06f305265b ClassView: Minimize the mutating API of ParserTreeItem
Make the API of ParserTreeItem const only.
Reorganize the code a bit:

Transform ParserTreeItem::add() method into private
mergeWith() and add a static method
ParserTreeItem::mergeTrees().

Remove ParserTreeItem::copy(), as in case of adding
projects we may use directly the instance from cache.
Remove now unneeded Parser::addProject() and use
directly getCachedOrParseProjectTree().

Transform ParserTreeItem::copyTree() into private
cloneTree() and make it a const method.

Move document symbols parsing code from Parser into
ParserTreeItem and add a static method
ParserTreeItem::parseDocument().

Remove ParserTreeItem::addChild() and provide instead
an overloaded constructor.

Allocate QElapedTimer object only when debug is on.

Fix some const correctness.

Remove some ugly usings.

Added some TODOs.

Task-number: QTCREATORBUG-25317
Change-Id: I6e7c48bb118b0d826fbb463cae94d59bf43a6938
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:41 +00:00
Jarek Kobus
9c896aa291 ClassView: Remove unused ParserTreeItem::operator=
Task-number: QTCREATORBUG-25317
Change-Id: I43f1c87fb1340a4e70d3309aae0b40a0466c8f04
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:31 +00:00
Jarek Kobus
23047f16f7 ClassView: Get rid of project and document mutexes
In fact, all the methods inside Parser class are
called only in one thread (parser thread), which runs
his own event loop. The exception is 3 methods
(canFetchMore(), fetchMore() and hasChildren()),
which may be called concurrently from the main thread.
However, they are protected with another mutex.
So, project and document mutex were protecting
the access to internals only when called from
one, always the same thread, what is not needed at all.

Task-number: QTCREATORBUG-25317
Change-Id: I0b44b762b5d76d003035e9c3099c90568b7faf80
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:17 +00:00
Jarek Kobus
0907315f47 ClassView: Don't lock the mutex while parsing
When parsing is being done we are producing a new
ParserTreeItem structure from scratch. This includes
creating new ParserTreeItems or getting data from
caches. So, we are not interferring with the
data stored in the rootItem. After the rootItem
is set, Parser doesn't modify this structure
anymore. There is no need to protect the parsing
with the mutex, as only 3 methods which are called
concurrently operate only on the rootItem: fetchMore(),
canFetchMore() and hasChildren(). Instead, we
protect only the process of setting the rootItem
to the new value. Similarly, we protect only
the process of reading the rootItem inside
findItemByRoot().

Task-number: QTCREATORBUG-25317
Change-Id: Ieda10107137f5031a81d67f2d608a90f6e72902d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:40:49 +00:00
Jarek Kobus
cc6df4e707 ClassView: Clear the documentCache, too, when reset was requested
Otherwise when we switch session we still keep
the data about the old session in the cache, which is pointless.
Protect clearing both caches with both mutexes, so it comes
atomically.

Task-number: QTCREATORBUG-25317
Change-Id: Ic5bc7ae2b8640e9290024e00c394ca9608f88da9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:40:41 +00:00
Jarek Kobus
1364630d1f ClassView: Consolidate document caches into one
We had three different hashes that cached the document data.
Replace it with one cache. Provide a dedicated structure for it.

Task-number: QTCREATORBUG-25317
Change-Id: I6592de62b7c026a9236a295657c9c06f6e9e5b4c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:40:30 +00:00
Jarek Kobus
f6a194b7a7 ClassView: Consolidate project caches into one
We had three different hashes that cached the project data.
Replace it with one cache. Provide a dedicated structure for it.

Task-number: QTCREATORBUG-25317
Change-Id: Ib6bafd38ee3c48f3e4960be1650709af777f255a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-15 20:29:48 +00:00
Eike Ziller
a0500f5b9a Use qlitehtml from separate repository
qlitehtml moved into its own playground repository,
get it from there instead of carrying our copy around.

Change-Id: I0e267344e5ccf95f579e4fb239e6789d177d7b78
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-15 16:31:49 +00:00
David Schulz
b865fa5571 LanguageClient: Rename logger -> inspector
... to be able to add more features to this dialog.

Change-Id: If8692bee484e25c1ba5e4ea629a77d14ff5d92ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 14:33:15 +00:00
Eike Ziller
27300c66fe Improve plugin install wizard on macOS
Downloaded files get a quarantine flag on macOS, which prevents loading
them as a plugin in Qt Creator. Remove the quarantine flag when copying
the plugin.

Change-Id: I3edef3ddfbab299be750e728a9fac0536634ba1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 14:10:17 +00:00
hjk
5168af3144 Debugger: Always switch on central widget when entering debug mode
This is not exactly what the linked task complained about, but
solves the issue. Disabling the central editor is rarely useful
(it can be limited to three lines in height) but still temporarily
possible with this patch.

Task-number: QTCREATORBUG-25315
Change-Id: I18182e11d7d3e2167a24a340ab1ae7222009b8c9
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 13:25:16 +00:00
hjk
ade5b44297 Debugger: Show central widget by default when resetting view layout
Fixes: QTCREATORBUG-25314
Change-Id: Id827c71159b4d23de2ab5adf14521c758f8489ef
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 13:25:10 +00:00
David Schulz
7521334261 LSP: support WorkDoneProgressOptions in server capabilities
These options indicate whether a server provides extra messages to track
the status of specific requests.

Change-Id: I3fb78f7fa7144a5a9418b32cb5b33d55b668c484
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 13:19:56 +00:00
hjk
aec908180d Utils: Stop tracking deleted sub widgets in aspects
Change-Id: I41965c69d55be03d3b2018a2a96eb77c440669b1
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 12:31:32 +00:00
Christian Kandeler
74177a559e clangbackend: Work around libclang cursor bug
... involving accessing the member of a nested anonymous union from
within the surrounding class. libclang reports a CXCursor_CXXThisExpr
for this location instead of a CXCursor_MemberRefExpr. However, the
latter is still locatable in the AST, so we can correct this.

Fixes: QTCREATORBUG-25342
Change-Id: I1eba13d5153205a52b3689d8ad52493a56b76c07
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-15 12:18:36 +00:00
hjk
222e8c1286 Utils: Use QPointer for registered aspect subwidgets
Amends 67a3d2e3d1.

Change-Id: I4807fd3409f66b10de5c95d7b07ddfdc7cf9174f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 08:37:17 +00:00
Miikka Heikkinen
b42fa1fb9b QmlPreview: Don't force explicit restart on shader change
Shader changes seem to be reflected to preview even without explicit
restart, and the explicit restart will cause preview to crash when
shader files are modified in QDS.

Fixes: QDS-3741
Change-Id: Iacba712bcfe38831d76febd8074c683e2124223a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 08:36:55 +00:00
Eike Ziller
b72c1d11e6 CMake Wizards: Add properties that are required for iOS
Running applications on iOS requires declaring a bundle identifier and
version numbers in the application's Info.plist file.

Unconditionally add them, since they also make sense for desktop
applications, even if they are not strictly required.

Fixes: QTCREATORBUG-25297
Task-number: QTCREATORBUG-23574
Change-Id: I2269bec2d4eaf3e8dd3332a027b284049b3b8b42
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-15 08:21:58 +00:00
David Schulz
9dad47387f LanguageServerProtocol: add inserter for variants
Change-Id: I78ff4f34dfd19dceb1f2e0912ab1a0ea036e24a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 07:13:16 +00:00
David Schulz
26e540e73d LanguageClient: Add expand all action to the log context menu
Change-Id: I7418f6ab4c0c92287d2e9d9652f609b652c06e26
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 06:13:27 +00:00
hjk
a174dda862 CMake: Move CMakeBuildSettingswidget closer to CMakeBuildConfiguration
The next baby step towards full aspectification. Ultimate goal is
to dissolve CMakeBuildSettingswidget completely.

Change-Id: Idb2bb852d1010f69f11ec8ca87c4695361a38b83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-12 18:21:09 +00:00
Bernhard Beschow
06dd646370 AutoTest: Only expose ITestTreeItem in TestTreeModel's public methods
Change-Id: Ide2513c838178b841763fe781478748a852a258c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:44:16 +00:00
Bernhard Beschow
cba4d5de5c AutoTest: Mark method as static
Change-Id: I14f2f0acf266a0fb4f88e26f50cfbe2257e3ab9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:43:54 +00:00
Jarek Kobus
784de5fb6c ClassView: don't clear project's file list cache when files removed
Instead of clearing the project's file list completely,
remove just a project (in case a removed file was a project)
and remove from all project's lists the removed file (in case
a removed file was contained in any project).

Task-number: QTCREATORBUG-25317
Change-Id: I63a5f9eb1043bd0d9b835d55f4a16f7f6af7bc6e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-12 14:50:03 +00:00
Christian Kandeler
8dc4cb17c1 Designer: Re-use CppTools functionality
... for slot insertion logic.

Fixes: QTCREATORBUG-8220
Change-Id: I3516a62d62174b64d557c82ce38a9cc334790efc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 14:16:14 +00:00
David Schulz
29f1aca1c8 LanguageClient: remove unused formatting functions
The formatting functionality was moved into languageclientformatter.cpp

Change-Id: Ieeafd49c297a854e478a11d4fcb81062b9cfcf19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 14:15:13 +00:00
Eike Ziller
9ab6992922 GitHub: Recursively checkout submodules
This will become necessary when qlitehtml is a submodule with litehtml
as a sub-submodule.

Change-Id: I8a2ca47d24bc4b4f3ff88908a49d3f1933ec59ea
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-12 13:31:04 +00:00
David Schulz
e6d0ed3160 LanguageClient: support versioned diagnostics
Change-Id: Id182431f371201c7266fe0683e78fe56a8a9735b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 12:40:07 +00:00
David Schulz
5860addcd2 Python: Adjust wizards to PySide6
Fixes: QTCREATORBUG-25340
Change-Id: I8f22eac283893b2778b6854e1dcd4ae6048d4c84
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-02-12 10:00:49 +00:00
Dawid Śliwa
064df19bd3 Update of Qt for MCU project template
- Updating project template to match new CMake API of Qt for MCU v1.7
- Preserving backward compatibility with previous versions

Task-number: QTCREATORBUG-25307
Change-Id: I8e45b69f440c7b7b63d3803c315658c6ef618952
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2021-02-12 09:26:49 +00:00
Tom Praschan
d7acee920d FakeVim: Add emulation for argtextobj.vim plugin
Change-Id: I319d2b9fe9f0d145c2560cf03fecc50629c99006
Reviewed-by: hjk <hjk@qt.io>
2021-02-12 08:36:29 +00:00
Jarek Kobus
480220a7e7 Remove a code for Subprojects mode
After fixing QTCREATORBUG-17977 we don't have Subprojects
mode anymore, since currently Parser::addProjectTree() and
Parser::addFlatTree() are identical. For now, we just
remove this duplication. The subproject mode to be fixed later.

Amends 8634aa4cbd

Change-Id: I53d1b5a7354295449c2995c4421f8fa21a3ac2be
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-11 19:21:04 +00:00
Cristian Adam
ad2155d793 CMakeProjectManager: Add compiler for Visual Studio / Xcode imports
Visual Studio / Xcode generators are not setting the CMAKE_C|XX_COMPILER
variables, and when importing such a build the generated kit will have
no
compilers and won't be much of a use.

Luckily CMAKE_LINKER has the path to link.exe / ld, which is the same
path for the compiler cl.exe / clang.

Change-Id: Id21bb0ec2d5aa6ab5a185e03992477c433ac4798
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-11 17:38:50 +00:00
Alessandro Portale
395e7cbfb9 CppEditor: Default to .cpp for QuickFix creation of 1-line setter/getter
Until Qt Creator 4.14, the QuickFix for setter/getter creation for
simple members added the implementation in the .cpp file.

The new QuickFix settings in Qt Creator 4.15 in theory keep the default
like before, but the threshold of 2 lines is usually not reached, which
causes the getter/setter implementations to now land in the header file.

This change sets the default threshold to 1 to restore the previous
default behavior.

Fixes: QTCREATORBUG-25331
Change-Id: I570deaa8b81686dc31254e8261b59ddcf8731f91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-11 16:05:25 +00:00
Christian Kandeler
6829d92d38 qbs build: Add missing file
Change-Id: I7479b36e51464e8f982586a6c69207c074bfb4b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-11 15:11:44 +00:00
David Schulz
667f8563bc CppEditor: Move ast path checker to relevant quick fix provider
We have quick fix factories that do not require an ast path at the
cursor position nowadays, for example the quick fix factories that
provide fixes from the clang tools. Move the check to those factories
that rely on a valid ast.

Change-Id: Iab4b30d5935fbd32f101fb5fda60e994f14dc94c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-11 14:22:04 +00:00
David Schulz
0f315f62b1 update copyright template
Change-Id: I8e522f8b6e2be43095392569d6fb678762a76395
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-11 14:21:54 +00:00
Jarek Kobus
6a2088d8ec Provide empty implementation for ILocatorFilter::refresh()
Make this method just virtual, not a pure virtual.
Remove all empty reimplementations of this method.

Change-Id: Idf10e492355e8519172facd421ea0b2b13ce3b80
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-11 13:32:30 +00:00
Jarek Kobus
9ad5cd5f58 Wait for finished the canceled task before starting a new one
When Locator::refresh is called, the refresh may be currently
ongoing - in this case we cancel it (and don't wait for it to
be finished) and start a new refresh. So, in theory, refresh
may be running in parallel on more than one non-gui thread.

The consequence may be, that when we then shutdown, we wait
only for the last refresh to finish (we are connected to
m_refreshTask), and doesn't wait for the canceled one to be
finished. This may potentially cause a crash.

We fix it by ensuring, that only one refresh task is run.

Change-Id: I62eeb00375124cdc0ab4651e9280226071d47f3f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-11 09:52:26 +00:00