Commit Graph

67787 Commits

Author SHA1 Message Date
Jarek Kobus
0e7774e75d Refactor CppElementEvaluator
Separate the use of CppElementEvaluator for CppHoverHandler from
the use for CppTypeHierarchyWidget. They are in fact much
different things.

Fix CppHoverHandler (enabled when ClangCodeModel plugin is disabled)
showing tooltips for symbols other than class or template.
Fix CppHoverHandler showing full template arguments for typedefs.

Change-Id: I5c44016014749d0d958b91a9a1ee9b35d3ea5eaa
Reviewed-by: hjk <hjk@qt.io>
2021-01-13 07:13:27 +00:00
Jarek Kobus
661193f67b Show type hierarchy also for typedefs
Make it possible to show type hierarchy for
typedefs and unsings. Before, no type hierarchy
was shown.

Change-Id: I63ffa9c544072d66c42de8edf306c898d2fa90cb
Reviewed-by: hjk <hjk@qt.io>
2021-01-13 07:13:13 +00:00
Christian Stenger
1e2e3f8e48 CMakeProjectManager: Fix initial ctest call
CMake settings can avoid to create the build directory
automatically. If this is the case the ctest call fails
due to missing information that is present inside the
build directory.
In this case we need to use the temporary directory that
is used before the build directory is created.

Change-Id: Ie6581e53a671c3e5ad71474d9706285d29bd37a8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-13 05:27:32 +00:00
The Qt Project
26993a5799 Merge "Merge remote-tracking branch 'origin/4.14'" 2021-01-12 14:44:19 +00:00
Eike Ziller
b83c829e21 Fix project tree's "synchronize with editor"
When for example closing all editors, the selection in the project tree
is removed, but after re-opening the previously selected file, the
selection was still missing.

Qt item views differentiate between "current" item and "selection". The
code uses the "current" item for tracking, but when clearing the
selection in the project tree, the code did not "clear" the "current"
item.

Change-Id: I182c7b78bf8dcc51af71e860ac620310d472b7b5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-12 14:43:53 +00:00
Eike Ziller
d204065660 Fix that file from project is selected in file system node
The new file system node in CMake projects leads to funny selections in
the project tree when "Synchronize with Editor" is turned on.
Since the file system items are less deep in the tree than the files in
the "regular" CMake project tree, they were selected instead of the
regular project nodes.

Reduce the selection priority for the nodes in the file system sub-tree.
For this remove the hard-coded priorities when selecting nodes for
"Synchronize with Editor" and use the existing node priorities.

Amends 53115259ba

Fixes: QTCREATORBUG-25208
Change-Id: I69c08c4f0e7afa305141a0c475af515d9db1363b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-12 14:43:26 +00:00
Eike Ziller
7ce3ceabe9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I26a53ef81a54a2f7aa482448118298895b712941
2021-01-12 14:14:41 +01:00
David Schulz
dedae466fd ClangTools: Add copy to clipboard action to diagnostic mark
Fixes: QTCREATORBUG-25110
Change-Id: Ie20e85fc6690dd23f8cb1e28f9e2a593c8e0479e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-12 13:05:30 +00:00
Christian Kandeler
4231a88b67 ProjectExplorer: Add more variables for active project
Fixes: QTCREATORBUG-25206
Change-Id: I3826824de73ef15138e037a7134592e4aa13130f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-12 12:51:49 +00:00
David Schulz
c2faeaeeec Core: deqobjectify IDocumentFactory
Change-Id: Ic9b76d42e0c07503fb5b2454d08e42f61a9ad641
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-12 11:18:51 +00:00
David Schulz
f58cb346e5 Core: remove unused member
Change-Id: I3088055bd395a432b0da8d76b9179944c9a2ad80
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-12 10:59:14 +00:00
Eike Ziller
4dc136b75a MessageManager: Remove old API for writing messages
In favor of the more evocative method names.

Fixes: QTCREATORBUG-24430
Change-Id: Iec9bcd4436807bfbf10f8dfa24d09c132706fe62
Reviewed-by: hjk <hjk@qt.io>
2021-01-12 10:55:19 +00:00
Christian Stenger
fb64cb12bc CppEditor: Fix compile on Windows
Amends c960f279e6.

Change-Id: I87249b5cdd984c00e44fc21d32534174edea73d2
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-12 05:48:21 +00:00
Leander Schulten
c960f279e6 CppEditor: Add QuickFix to generate a constructor
Change-Id: Iba2ce3bfa1a1d1a325626a21f46b485d12cbb060
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-11 14:59:40 +00:00
Christian Stenger
85bdcf819f Utils: Only write data to process if there is any
This avoids the warning
QIODevice::write (QProcess): ReadOnly device
in cases where the process is run inside a read only
directory even when the process has no input.

Change-Id: I9434c738e9cf94c348f1437ebf15e1c7574cde94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-01-11 14:32:56 +00:00
David Schulz
d03f723060 TextEditor: add macro variable containing the word under cursor
Fixes: QTCREATORBUG-24836
Change-Id: Ib872fd12e5842bdb752dd3969ef9c5eb9dd2f650
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-11 12:44:40 +00:00
Eike Ziller
86348d5622 cmake build: Fix fallback LLVM/Clang paths
CLANG_INCLUDE_DIR and CLANG_BINDIR are the fallback paths that are used
if no bundled LLVM/Clang is found, so these must be absolute paths to
the build-time LLVM/Clang installation.

This also removes the need of copying LLVM/Clang into Qt Creator's
build directory.

Fixes: QTCREATORBUG-25147
Change-Id: I052138d894c316f493423b1da0ba79af633c4c37
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-11 12:42:14 +00:00
hjk
48a6f8ad82 Modeling: Rename D{Association,Connection}End::setCardina{t,}lity
Typos. Note that this doesn't fix the typos in the saved models yet.

Task-number: QTCREATORBUG-24543
Change-Id: I3317160692efdbaab10b00a76129ca128b57e259
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-11 10:53:43 +00:00
Eike Ziller
7644dae937 Add tool tip to REPL button in python editor
The individual tooltips on the menu items might not be shown (possibly
depending on platform).

Change-Id: I0adb3f938de23dad4b70fa1f73a0b6a277b0386c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-01-11 08:50:46 +00:00
Christian Stenger
5cdcb872df CPaster: Fix fetching from pastebin
Parsing HTML with QXmlStreamReader is a bad idea as it
may be malformed HTML.
Replace XML parsing by using regular expressions.

Change-Id: I230e9d2b8e13d8bd736cb3f05eb6de7f812aab5b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-11 05:26:02 +00:00
Orgad Shaneh
ac32cf56a1 Debugger: Add -file-exec-file when opening a core dump
-file-symbol-file alone doesn't cover all cases. Run -file-exec-file too.

Task-number: QTCREATORBUG-24541
Change-Id: Id4d8f7057f845bce32b28cc8f4db0eadcfcfab28
Reviewed-by: hjk <hjk@qt.io>
2021-01-11 05:19:08 +00:00
Cristian Adam
707a3cfaf3 CMakeProjectManager: Use CMAKE_HOME_DIRECTORY as source directory
The CMakeCache.txt file has CMAKE_HOME_DIRECTORY pointing to the
project source directory used to configure the project.

When importing a cmake build the CMAKE_HOME_DIRECTORY from
CMakeCache.txt might not point to the same CMakeLists.txt that was
opened as a project.

qt-cmake-standalone-test from Qt6 uses a CMake template project which
does a add_subdirectory with the test source directory, which will not
work if opened standalone.

Normally this is a user error though, so ask the user if this was
intended, before actually importing the build.

Task-number: QTBUG-88776
Change-Id: Ifdd5e1d1cb8a1ef9955d22493eba3a1a55dc689f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-08 16:25:24 +00:00
Tim Jenssen
ac378fbe2a Revert "Reduce allocations patches"
This reverts commit 4580a3b222.
This reverts commit e852173484.

We still have to support old gcc.

(🍒 picked from commit e9c6944479fad2288060c72bb4df8dcbab9e0b2c)

Change-Id: Ia8b198390a0f82c2104991900a3091c96d6e7f24
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-01-08 16:15:44 +00:00
Leander Schulten
c109b60cdf CPlusPlus lib: Add support for BINDABLE in Q_PROPERTY
Change-Id: I8ca00aff63261eea997267d41b12c2397d676748
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-08 14:53:17 +00:00
Christian Kandeler
47dfc16eee ClangCodeModel: Work around race condition when closing editors
The editor manager emits currentEditorChanged() before editorsClosed(),
which throws off the clangbackend. Fix this by sending an extra
DocumentVisibilityChangedMessage after the DocumentsClosedMessage.

Fixes: QTCREATORBUG-25193
Change-Id: Ic02ae174a2912d79aeded44ced13d962b53526b1
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-08 13:39:34 +00:00
David Schulz
7fc015aca9 UnitTest: Fix debug qbs build against release llvm
Change-Id: Iadc073f3904123f62b642843bd94935476055555
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-08 13:36:10 +00:00
David Schulz
834ff86a64 CppEditor: Fix mismatch parentheses highligh in cpp comment
...with continuation line.

Fixes: QTCREATORBUG-23297
Change-Id: I6f5ea4184bd991d219efae14fbef090c7874d283
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-08 13:35:57 +00:00
Eike Ziller
000268e40c Fix compilation with Qt 6
No QRegExp in Qt 6 anymore, use QRegularExpression.

Amends bebd70573e

Task-number: QTCREATORBUG-24098
Change-Id: I1f65a400d27d710b6393fb3568e8fc020ccb194e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-08 13:03:46 +00:00
Christian Kandeler
a0eff28c1c Utils: Fix crash in environment widget
We called QTreeView::visualRect() with a potentially invalid model
index, yielding a bogus QRect, from which we derived a bogus QPos, at
which we tried to show a tooltip, which crashed Qt.
While the whole logic around that code looks dubious, for now we just fix
the crash by using a persistent model index.

Fixes: QTCREATORBUG-25170
Change-Id: I5647d0ed04bd228bb2887ef06465212545b54f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-08 12:28:28 +00:00
hjk
1df9951d03 Debugger: Split remote and local attach handlers
Called with different timing, no real shared code currently.

Change-Id: I5a8cc32c5f38f533acfa4512518fb51932d8aab2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-08 10:37:38 +00:00
hjk
0cb171ac96 Debugger: Shift initial breakpoint setting even further down
In case of 'attach' this is still a bit too early to avoid pending
breakpoints, but we are getting there.

Also, lump in the commandsAfterConnect bits into the initial breakpoint
setting, as this is the right time. The function is mis-nomed now, will
be fixed in a later patch.

Change-Id: I8c4c53d02b4eab31e8e095865fc3cb24265c5028
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-08 10:37:33 +00:00
Christian Stenger
b4cc084a98 Utils: Add findAnyChild() to TypedTreeItem
Removes some static casts on the user side.

Change-Id: I0a9ae512f294c0e78e0a5890e557c483af86abfe
Reviewed-by: hjk <hjk@qt.io>
2021-01-08 05:58:54 +00:00
Vikas Pachdha
8e78b9a379 Docs: Update qml export docs
Document generating per component export

Task-number: QDS-3357
Change-Id: Ibdb34622318cf94823b5a3813f16a35f3dcca29c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-01-07 21:42:45 +00:00
Tim Jenssen
e852173484 qmljs: Reduce allocations in ComponentVersion
Change-Id: I37debafc09a2ad03dfb869686df5935fb22a94be
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-01-07 16:14:40 +00:00
Marco Bubke
4580a3b222 QmlDesigner: Reduce allocations
We use std::to_chars instead of QByteArray::number. In the normal case
we only allocate once but if the numbers are unusual long we
would allocate two or three times. But this is very very unlikely.

Change-Id: Ieb734d63962d4cc5a1c1da73f4ccb4acd7db2577
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-07 15:30:32 +00:00
The Qt Project
13fae30e88 Merge "Merge remote-tracking branch 'origin/4.14'" 2021-01-07 15:30:19 +00:00
Jarek Kobus
9462102245 Add cache to hierarchy visitor, fix following typedefs and usings
In case we already visited the same base class symbol in the same
scope we already know the fully qualified name for base class,
so no need to search it again. We store all visited symbols
with their scopes in cache. This speeds up building type hierarchy,
especially for large trees, like for creator project and showing
type hierarchy for QObject: build time before this change was
about 300 sec, now it's about 130 sec.

Sometimes the old code didn't follow properly base classes
that were typedefs to other classes (like in creator project:
Debugger::Internal::RegisterHandler is derived from RegisterModel,
and RegisterModel is a typedef to Utils::TreeModel). This caused
that some subclasses were omitted form resulting type hierarchy.
E.g. type hierarchy in creator project for QObject lacked
about 8 subclasses.

Change-Id: I03c5aef65b7d7cb0ed279d3558aebc8a55e856b4
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 14:58:19 +00:00
Jarek Kobus
167651b537 Properly annotate templates with full scope in type hierarchy
Fix activation of template classes.

Change-Id: I811f505c1c01fa95d74847cb91dd1cf37476534b
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 14:58:14 +00:00
Jarek Kobus
936b63b4fc Highlight old item after activating new class in type hierarchy
Highlight the old visible class after double click on a new
class in type hierarchy editor. Don't do that when
opening type hierarchy from cpp editor.

Change-Id: Ie9a1131cba9b5a35ab826909b994555188aaceb7
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 14:58:06 +00:00
Bernhard Beschow
f82692cc7f AutoTest: Make code more symmetric
... by assuming that active.keys() is a subset of
TestFrameworkManager::registeredFrameworks() which is used in the case
above. Also, TestFrameworkManager::registeredFrameworks() is already
sorted, as can be seen from the above case, too.

Change-Id: If82c8c998716fa56d6257d3ee0ec09c12d458bb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-07 14:54:34 +00:00
Christian Kandeler
6d2edf0613 ClangCodeModel: Fix header file completion weirdness
... when completing right after a dot.
It's unclear why the code uses half-baked heuristics all over the place
instead of simply employing the lexer (which is also used at some point)
for everything. For now, use it to determine the correct starting
location of string literals.

Fixes: QTCREATORBUG-25154
Change-Id: I14c4d71c4a9bc3e2407688ed9c908d1c99155c76
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-07 14:36:28 +00:00
Tim Jenssen
b801a9339d Merge remote-tracking branch 'origin/4.14'
Change-Id: I70504e096be620434f38cd990c593950da8b24ba
2021-01-07 14:23:46 +00:00
Leena Miettinen
19970878b8 Doc: Update info about Clang diagnostics
Task-number: QTCREATORBUG-25195
Change-Id: Idb8dee94fae29cb0f347decf50e686a3485d9139
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-07 14:16:56 +00:00
Vikas Pachdha
f1268a9f86 AssetExport: Enable generating multiple metadata files
Task-number: QDS-3357
Change-Id: Icc591d61d149ff92b6c415434e2a7574103802ae
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-01-07 13:31:10 +00:00
Vikas Pachdha
4618018c4b AssetExport: Improve json generating class names
Change-Id: Id9abcf1122ee4c2c53f886438958e38cc84a835d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-07 13:14:39 +00:00
Eike Ziller
c81baf1a9c cmake build: Use GNUInstallDirs for installation paths on Linux
Allows e.g. distributions to adapt to system layout.

Fixes: QTCREATORBUG-25142
Change-Id: Ia6d759514fef5a154334bc3d7221ea4b970122f2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-07 12:17:20 +00:00
hjk
da147880e8 Debugger: Rename 'AttachExternal' to 'AttachToLocalProcess'
And AttachCrashedExternal to AttachToCrashedProcess
And AttachCore to AttachToCore.

Clearer.

Change-Id: I47c2eca5cbdbbc0eb38b9f62b2504c96558ff112
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-07 12:11:42 +00:00
hjk
111cc934fd Debugger: Mark currently hit breakpoint in breakpoint view
Fixes: QTCREATORBUG-6999
Change-Id: I2b080de0096d1e2bc5b348666adcf4797589fe15
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-07 12:09:40 +00:00
Knud Dollereder
dd8b73cfd2 Rename ActionInterfaces Target to TargetView
Change-Id: I55692f9d773a1466fec5285fdc53149a3a1359f1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-07 11:36:31 +00:00
Christian Stenger
e7a65dd3c9 QmlJSEditor: Ensure extra selections are ordered
The code model may provide selections that are not ordered
as they appear inside the document due to the declarative
nature of QML.
Ordering before using them avoids couple of warnings stating
"overlay selections not in order".

Change-Id: Ie912e94aa01ffde52b01dca7a9bde24ae02e8b33
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-01-07 11:07:45 +00:00