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>
... to the only remaining user, and rename it there.
Change-Id: I0bdb3179282e323f5ad7b41d034bb5f3db8f6ffc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
They were identifying the same set of nodes.
Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Not the usual direction of change, but currently there are
several systems to identify or invoke node functionality.
Virtual functions are likely to stay in this context, so this
here attempts to help consolidation by reducing the influence
of the node type flags, hopefully leading to full removal
by making remaining functionality available through the
other mechanisms (virtual functions, asFooNode() 'casts',
less so the FileType flag).
Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
E.g. moving a file from one pri file to another is much simpler for the
user now.
[ChangeLog] Source files can now be drag-and-dropped between project
nodes in the project tree.
Fixes: QTCREATORBUG-6446
Change-Id: I8bd4a7588fc5f2830f6585dfcb54ab4a547bc6b0
Reviewed-by: hjk <hjk@qt.io>
On macOS shortcuts with "Alt" are used for entering special
characters, where "special" depends on keyboard layout and can
mean e.g. '|' or '~'.
Task-number: QTCREATORBUG-20873
Change-Id: Ifa70b95381ef48d2ba3b15a528a5dcfe43d53bfd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Resource files would not get the handling like files do, because they
are folder nodes.
For folders, if they provide the rename functionality at all, the file
extension can have similar influence on the type of folder like it does
for files (e.g. ".app", ".framework"), so just remove that restriction.
Task-number: QTCREATORBUG-20057
Change-Id: I3802f17695da9d323d4d60c14ecef5c39aeef576
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Rendering disabled nodes using the disabled state in the painter
breaks themes as it introduces a discrepancy between the actual
state of the node and its graphical representation.
IIRC this was introduced since there was no easy way to find what
color was supposed to be used for disabled items. That is no longer
the case, so let's clean this up.
Change-Id: Ic5653cd970e07eb680cb1d28d1feefd70aded540
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>