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>
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>
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>
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>
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>
In favor of the more evocative method names.
Fixes: QTCREATORBUG-24430
Change-Id: Iec9bcd4436807bfbf10f8dfa24d09c132706fe62
Reviewed-by: hjk <hjk@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Called with different timing, no real shared code currently.
Change-Id: I5a8cc32c5f38f533acfa4512518fb51932d8aab2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
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>
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>
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>
... 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>
... 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>
Allows e.g. distributions to adapt to system layout.
Fixes: QTCREATORBUG-25142
Change-Id: Ia6d759514fef5a154334bc3d7221ea4b970122f2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
And AttachCrashedExternal to AttachToCrashedProcess
And AttachCore to AttachToCore.
Clearer.
Change-Id: I47c2eca5cbdbbc0eb38b9f62b2504c96558ff112
Reviewed-by: David Schulz <david.schulz@qt.io>
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>