Fixes a Windows test failure in CompilationDatabaseProjectManager.
Change-Id: Ic373b7a50b1374be4cf028fc304442c3cf077735
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Type annotations were being removed by the reformat action. Write out
the relavant annotations in ast to fix it.
Add exclusion mechanism in tst_qml_reformatter test since it performs
line by line comparison which doesn't fit all reformatting cases.
Introduce char-by-char data tests.
Fixes: QTCREATORBUG-29061
Change-Id: Ia52b51e6d7d938bdec325c4f426b11c722f85f8e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We don't pass the correct value "c++header" to the -x option, because to
clang that implies building a precompiled header, which apparently
switches on some different mode that breaks clang-tidy and clazy.
On the other hand, with "-x c++" clazy now thinks that this is a source
file and frowns at "#pragma once". Suppress this warning for header files.
Amends 60fca0596a.
We might run into similar "header vs source" problems in the future. I
don't see anything better than suppressing them one by one.
Fixes: QTCREATORBUG-29781
Change-Id: Ia15ac5b278777e2b2e089e9d58bb7537c38955ce
Reviewed-by: David Schulz <david.schulz@qt.io>
This is a workaround for the ugly hack that QmlDesigner forces the
EditorManager to send a currentEditorChanged signal with QmlDesigner's
custom, internal IEditor.
The currentEditorChanged signal triggered an update/re-creation of the
outline widget *for that editor*. Which is not the intended result in
the first place, but even aggrevated by the fact that QmlDesigner never
calls currentEditorChanged with the actual
EditorManager::currentEditor() again.
Work around that by only ever using the EditorManager::currentEditor()
for the outline widget.
Fixes: QTCREATORBUG-29653
Fixes: QTCREATORBUG-29702
Change-Id: I39c5bee94141a0d86c0e92879eb8b1c2b7ba64b9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
There is no need to have an extra file for one struct that is only used
inside texteditor.cpp
Change-Id: Iee8f7ce5e0d19da7b444660d81c350eb10b501ef
Reviewed-by: hjk <hjk@qt.io>
In case we have no Qt inside the current kit configured the
code model stumbles upon Qt constructs even if
CMAKE_PREFIX_PATH has been used correctly to allow cmake to
pick up a Qt.
Explicitly look into the found packages to see whether Qt
has been found and use this if possible for the codemodel.
This fixes some inline diagnostics as well as finding all
test information inside Qt Test related projects instead of
just the test cases when using a kit without a Qt.
Change-Id: Id3b5d2e818967cd3121948b818c75c4cf463546f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
findUsingLs did try to enter "." and "..", with especially "." leading
to an endless loop.
findUsingLs also did not correctly concatenate the parent folder
for sub directories.
Change-Id: Ieafad4d4ef38d2fb550ddef1d2edf8183ce8032e
Reviewed-by: hjk <hjk@qt.io>
FileExtractor::extract() creates a temporary folder for extraction
if target path is not specified. This temporary folder was never
cleaned up after it was no longer needed.
Fixes: QDS-11057
Change-Id: I7c39429eb4beeb84fcaee6e8dc4f42d70e4d3fc0
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
BaseAspect::setEnabler requires the settings to be read already.
This is because readSettings() does not emit "valueChanged", and so
the connections from the enabler to the target are not triggered.
Change-Id: I0c95e2b516cd03c1dbad653288b44510ec7ea800
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If the inferior did not start the TerminalInterface did not send an
error up the chain, which meant that the runcontrol does not exit.
This would lead to a crash.
Change-Id: Icf9f8f913d84a9ed6414e15ce3a3587b1580425e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
find and end of QMap potentially detach the container, so we have to use
constFind and constEnd
Fixes: QTCREATORBUG-29716
Change-Id: I2fef46580ff5b58a70201841423e5ca0a7b4d107
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Like it's done for all other TimeoutTasks.
Before it was flaky on mac.
Change-Id: I2999b1264d313dda5d614d9dbd7ae03b2bf00fb0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
QmlProject could be edited manually to add files into the project.
In case of the files are mising in the file system (or if there's
a typo in the file path) file names still shown in the project
explorer without any information. This patch brings a small overlay
on top of the original icon to notify the users that the file doesn't
exist.
Task-number: QDS-10344
Change-Id: Ia73699b048725bcc70a1ee0f52c34b55b081a779
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
If the outline view is set to not show all bindings, it can crash after
writing code that temporarily produces an element after the cursor that
is interpreted as the child of a NonElementBindingType. In the bug
report that is a temporary structure of
* Window (element)
* ...
* Rectangle (element)
* ...
* y (non-element binding)
* y (element binding)
* Text (element) <- this gets selected in the global outline
When an element is selected in the global outline, the outline view
searches for the first element in the parent hierarchy for which the
source index is successfully mapped to its filtermodel.
(QmlJSOutlineWidget::updateSelectionInTree)
Since filterAcceptsRow only explicitly filters out items that are non-
element bindings, the "Text" element in the above example is "not
filtered out", and is set as the selection in the outline view, even
though it is not visible because one of its parents is filtered out.
That leads to a crash later on.
Make sure that filterAcceptsRow explicitly filters out any item that has
a NonElementBindingType in its parent hierarchy.
Fixes: QTCREATORBUG-28862
Change-Id: I1091daae140f13ea7fea7bb637953f51348c3b63
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Ensure all fonts in the project are always loaded,
even if e.g. the project singleton is not created.
We search for the .qmlproject file and then load all
fonts.
Task-number: QDS-11108
Change-Id: I1117fa6ba9677c75fe8fce96bb349b5e825af7f3
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Fixes the initial value of the group mode as well as
storing and retrieving the values.
Also correctly updates the enabled state of the filter.
Change-Id: I083b783a60729cae795f0aaf1638da499737f545
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
FilePath::toUrl does not pass queries correctly to QUrl.
So we use QUrl::fromUserInput directly.
Fixes: QTCREATORBUG-29850
Change-Id: If0706b3b37d03eeea87247b44f07f8a0f8915a95
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
When using CMake package manager auto-setup the CMAKE_C|
XX_OUTPUT_EXTENSION is stored in the CMake cache.
This way CMake project manager can know about the correct extension when
building a single source file.
If CMAKE_C|XX_OUTPUT_EXTENSION is not found in cache it will only use
".obj" for Clang-Cl/MSVC/MinGW toolchains.
Task-number: QTCREATORBUG-27471
Change-Id: Ib9b75608d5a6834014150c57f3098f79284d8276
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This makes the dialog slightly bigger to avoid that horizontal
scrollbar (when using normal font sizes).
Also, the header sizing code is a bit cleaned up. The "Loaded" column
takes less unnecessary space.
Change-Id: Ic7db7595a88a6dcedd52dce608aa1c9c79c8a464
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Our approach was not fully thought through: When we got informed of a
file getting created by an ExtraCompiler, we would make it known to the
first client that came along and then forget about it. This means that
e.g. a source file including a UI header would parse fine with the first
client that opened it, but after switching the build configuration or
possibly even just touching the project file, the UI header would not be
found anymore.
Fix this by keeping the information about generated files around and
attaching them to every newly initialized client.
Note that this state should probably be kept somewhere more central.
Change-Id: Ib1d8cca9258d1962513d8d463f5d16f9ff91a048
Reviewed-by: David Schulz <david.schulz@qt.io>