... to simplify the user code.
Some, but not all, potential beneficiaries are adapted.
Change-Id: Ia7d514a0114a4f99f8ee745523435f5b990bd095
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This would make ProjectTreeWidget::nodeForFile pick the wrong node due
to nodeExpandCount having a lower count.
In case of qml files there is the source file node and the resource file
node pointing to the same file name, but the resource name has an invalid
index (not visible in the project view) and shouldn't be preffered!
Fixes: QTCREATORBUG-30571
Change-Id: I2aff7da9dd6d83222e341b5cbcb78db5cd6a9224
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@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>
The object that is installed as an event filter doesn't implement
eventFilter.
Change-Id: Icc51346e0c9eadf7448a4889df4c447d3bc3082c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Will ease transition to a key class that doen's have ::number()
Change-Id: Ib2f2957c916f41b0731a2033422bfbf7e429bcc8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Symmetric to saveSettings() now, and allows for central Key conversions
later.
Change-Id: I3fbf81c51197c9882b1f64ef591398b83aa0d633
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This introduces string constants in Utils::StyleHelper. They are used by
code all over in Qt Creator to tell ManhattanStyle how to paint certain
widgets.
Change-Id: Iecca36103f80084cd5fe93fcb6b18b8fbb3a32bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... out of SessionManager.
The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.
Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.
Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Mostly unused #include's, also sort them or reduce scope.
A few namespaces, ...
Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
When setting an external editor as the default editor in the MIME type
settings.
Other operations like File > Open, or when using navigation shortcuts
like Follow Symbol, and stepping with the debugger will still always
open the file within Qt Creator. The Open with... menu can still be used
to explicitly open a file in an external editor afterwards.
One of the use cases is to be able to open some files that would
otherwise unhelpfully be opened in Qt Creator's binary editor in the
systems default editor.
Fixes: QTCREATORBUG-13880
Change-Id: I852f097da8badd10de78b74e7078987447eebe98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
When renaming an item in the project tree widget which has concatenated
filename extensions like *.ui.qml the selection in the LineEdit will
reach till the last dot.
* Extend FilePath suffix and completeBaseName function so they will
treat the suffix *.ui.qml as one
* Make use of the function in ProjectTreeWidget::editCurrentItem
* Replace QFileInfo::suffix with Utils::FilePath::suffix in
FlatModel::setData
Task-number: QDS-2713
Change-Id: I30d0e6d87a7512d42fd3d40b2282b94e79b43684
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This patch renames the "Show Source and Header Groups" filter to "Hide
Source and Header Groups" for consistency with existing filters such as
"Hide Generated Files".
Change-Id: I34c204f7cae55bab60a50932cf307614987ef2ea
Reviewed-by: hjk <hjk@qt.io>
A new checkbox "Show Source and Header Groups" is added to
the filter menu in the project tree. It is checked by default.
Unchecking it removes the extra level of virtual folders containing
sources and headers.
Change-Id: I25f4514e7f1f6cdfcb531a911e54cc6e7e42a3e2
Fixes: QTCREATORBUG-25313
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Part of the overall FilePath migration. Keep the original version for
a while to allow using code to catch up.
Change-Id: Ia7c5ea14416a06e679e8661c0e4045981db87b9b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@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>
Writes less settings and makes it possible to change defaults in the
future.
Task-number: QTCREATORBUG-24762
Change-Id: I73873b3684827b4fe27cfa5ea2f62a76003f9750
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
From time to time, I find myself wanting to fully expand
a specific sub-tree.
Change-Id: Ie49b76a7a7a6fae3684bbdfb5735638bbc41b301
Reviewed-by: hjk <hjk@qt.io>
This reverts commit a5785e678e.
These actions are already available from the standard tree view UI...
Change-Id: If8dfe755ee450a89588ec944ae6ff7601250cdde
Reviewed-by: hjk <hjk@qt.io>
Project manager plugins can mark files as disabled, typically meaning
they are not part of the project in the current build configuration.
Let's allow users to hide such files altogether.
Fixes: QTCREATORBUG-22821
Change-Id: Ie92d523d1f895bee8076de1d7eea1d7a739fe11f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
If a user changes the name of a file abc.cpp to def.cpp, and there is a
file abc.h in the same directory, it's likely that the user wants to
rename that file to def.h. Detect such circumstances and offer the user
to automatically rename the sibling files.
Fixes: QTCREATORBUG-21738
Change-Id: Ib3ece08698a3341ef4087066d2289048f6b0fa61
Reviewed-by: hjk <hjk@qt.io>
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.
Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
For consistency, it's straight forwards access, similar to
currentProject, not much to search and find.
Change-Id: I7ce696bdc24b6a8713d6f11e02443a6f94c605f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>