9124833a63 introduced an optional
parameter to removeChildren to suppress signal emitting, and
a61f9162f1 reimplemented that in a ABI
compatible way with a new removeChildrenSilently method instead.
The code now uses removeChildrenSilently, so the parameter to
removeChildren is no longer needed.
Change-Id: I8411d80f90e83b8746c2553dddb41c3f40a2bfc7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This led to an assert in QSFPM because it got confused by the
nested reset signals.
Detected by adding
new QAbstractItemModelTester(this,
QAbstractItemModelTester::FailureReportingMode::Fatal);
to the OutlineModel constructor, and just opening QtCreator on a small
qmake-based project.
Fixes: QTCREATORBUG-30035
Change-Id: I41dbc81b5a2275521ece6b865115e1428e07ecf7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 9124833a63)
Reviewed-by: David Faure <david.faure@kdab.com>
This led to an assert in QSFPM because it got confused by the
nested reset signals.
Detected by adding
new QAbstractItemModelTester(this, QAbstractItemModelTester::FailureReportingMode::Fatal);
to the OutlineModel constructor, and just opening QtCreator on a small
qmake-based project.
Change-Id: I41dbc81b5a2275521ece6b865115e1428e07ecf7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
- Use a proper sort model in the Kits settings widgets, so kits will
not just initially be sorted.
- Handle the top-level nodes in a special way, as not to rely on
"Auto-detected" coming before "Manual" in all languages.
Change-Id: I1eb8e1bee6836b47164d76b49435f8ff5120bb14
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Make usages of QList consistent. In some cases the
declaration contained QVector arg, while the definition
had QList arg.
Remove some unneeded includes of QList.
Change-Id: I7c15b39f261cefdeec6aaaf506ff4cc981432855
Reviewed-by: hjk <hjk@qt.io>
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>
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>
Round 1 - focus on headers.
For classes with initial in range [T-Z].
Replace QT_FORWARD_DECLARE_CLASS with QT_BEGIN_NAMESPACE and
QT_END_NAMESPACE and forward declare inside.
Change-Id: I4ac3a8391e6167aa2db3973a9f94a45ac3c8ebd1
Reviewed-by: hjk <hjk@qt.io>
Unchecking the recently added "Show Source and Header Groups" option removes
the Sources and Headers virtual folders from the Projects tree. This patch
additionally merges descendants of these folders with identical priorities,
display names and file paths.
For example, if a project contains a folder including both source and header
files, both the Sources and Headers virtual folders will have child nodes
representing that folder. Previously, unchecking "Show Source and Header
Groups" kept both these identically named nodes in the Projects tree (one
containing sources, the other headers). With this patch, these nodes are
merged into a single node containing both sources and headers.
Change-Id: I4786eee4a528ea141a7fe117e14a050f68411890
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
No need to have the same translatable string repeated at all these
places.
Also add tooltip to expand a bit on what "auto-detected" actually means.
Task-number: QTCREATORBUG-25291
Change-Id: I25d43486758ba17256cf7e1ea2eea0ec3d567b62
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Simplifies code and reduces (visible) static_casts on
the auto test plugin's side.
Change-Id: I31ae3e4f1a32d3e74527ccb36080944848f3b1fa
Reviewed-by: David Schulz <david.schulz@qt.io>
Many issues, mostly in headers, were not addressed in
e38410b76c
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
Change-Id: I320a51726db881e582b898948d53735ebb06887a
Reviewed-by: hjk <hjk@qt.io>
Basically this reverts 08e73d1a93, but adds an
additional check for the column as the BaseTreeModel
implementation just allows children at the first column.
Main reason for this revert is that the variable choosers
used across Qt Creator did no more populate their
respective macro lists automatically.
Change-Id: I172506a9dbe18f20b152ec797f35feff717dc3cf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Not needed and wrong, as it doesn't handle the case of column != 0.
Change-Id: I0ff62df0547a47ea80e1450b7cca1ecc86da7005
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
In addition to the already existing expansion request.
Change-Id: I5a60a2ae6d71bdd1fcf44af5554ca45212d9d5bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This changes the processing of children to step down into the children
first (and their children recursively) instead of just processing direct
children in reverse.
Fixes an issue with AutoTest plugin where results of data tags got a
new intermediate although there was already one present.
Change-Id: I1fe42942db975c7a1aa3ddb0b6596979c1164dd7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The base implementation uses the parent() index, which
in turn accesses the grand parent level. We can save
a few cycles here.
Change-Id: I3c3696118fe7c3d4563ee3cd28981fca62013828
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Together with the earlier fix for hiding generated files, this change makes
for a very clean CMake server-mode project tree:-)
Change-Id: Ib70fd66699eddf5d6e602f3f8848b31fd6d85b57
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
We normally add new results to the last added
item, so processing the search for the parent
from bottom to top makes more sense and avoids
iterating over almost every item.
Change-Id: Iede08b9c0d4c80227d2e8fea9b002354f01d5b35
Reviewed-by: hjk <hjk@qt.io>
Calls parent() only ~two out of three times and remove some
function calls in the TreeModel::parent() implementation,
reducing the overall footprint of this bit from ~5 to ~1.5%
when searching something in the project tree (test case
was Creator-in-Creator, and searching for 'dddddddddd',
resulting in 8 complete scans of the tree.
Task-number: QTCREATORBUG-17956
Change-Id: I4e46ef0467dd2aea58a7c944e1a2ee5c01e6fbba
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
... and use this to reduce the number of explicit uses of m_children.
Despite of being shorter code by itself it is a step towards having
an explicit LeafItem object that doesn't explicitly store a(n empty)
vector of child nodes.
Change-Id: If8db85e2f1134dd1578a78d31235bf57a28f863a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The FlatModel is essentially a proxy model keeping expansion and
filter state per ProjectTree(View). Using a Utils::TreeModel makes
it fast enough to allow recreation of the proxy structure on
structural changes simplifying the parent/child logic significantly.
The {Session,Project,Folder,File}Node hierarchy still is still primary
information and shared by all views.
Change-Id: Ic08180a19bda37908280ff30e0737d188ed93e92
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
To shorten user code and hide the ugly const_cast.
Change-Id: I798bd105932004ea17cb95b243fc38ccfcda0a2c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Not used, and easily done with rootItem()->childCount() in case it
is needed again.
Change-Id: I7e85ac1bb72b3a799987b1bf6bd54d21b7ab06ee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Use ' = delete' instead like everywhere else.
Change-Id: I63d0fd1adbc336f4b390b7c68d3f945e4045052c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The LeveledTreeModel case is general enough to cover
the UniformTreeModel case, so merge them and rename to
TreeModel. The former TreeModel is now BaseTreeModel.
BaseTreeModels should not be instantiated directly,
a tree model with non-uniform basic items is available
as TreeModel<>.
Done-with: Eike Ziller <eike.ziller@qt.io>
Change-Id: I64a65617ab68c0cde39cf65f4bc092ef808ee6fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Useful in cases where e.g. siblings are affected (e.g. font
changes to indicate active items).
Change-Id: Ib2f8018688d00bd682bb6aaff08156f0be04f5dc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Current usage is to use setRootItem() manually when needed, but
since the type is known in a LeveledTreeModel this can be automatic.
Change-Id: I511acdf9b9b3f4b67cf87d07b5446baa329a6a77
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We never used the possibility to overload the virtual child() and
rowCount() functions, it's unlikely to be needed in future.
Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... and use it to add a ParentType *parent() function.
Also, de-virtualize the TreeModel::parent(), this flexibility has not
been needed so far.
Change-Id: I0bcf930a0d6b05d5621753a5a8a1f8c3e5017386
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
More natural and easier to extend to use parameter packs later.
Adjust users.
Change-Id: Ic167196cc969d18bb1615084397e884f769d1e85
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This follows the rest of similar functions. It is arguably abusing the
C++ misfeature that 'const' only applies to the top level, but
avoids re-typing the same implementations stanzas for otherwise needed
const/non-const overloads.
Change-Id: If90fc879b406fd94714995ff4c42a4ebe3c69faa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
It's well covered by the more generic Utils::LeveledTreeModel now.
Change-Id: I3982ad39a64742b0a0a59433024457db3808bfc7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Covers the common case and hopefully avoids the recurring MSVC
problem with initializer lists in this location.
Change-Id: I1b2bbb083f9fc86af3b51b8f52615fb70c832b95
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This splits out the case of static string displays from the
TreeItem base class, making the base more lightweight.
Change-Id: If1f442011ec60094399a41b65d9b5015f432f82e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>