Commit Graph

8032 Commits

Author SHA1 Message Date
Marco Bubke
23c2668657 QmlDesigner: Update clang-format
Change-Id: I1793898e27a92aaf3f4f88390537c405d1f27427
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-06-01 12:20:14 +00:00
Jarek Kobus
3ee32c1a3b TaskTree: Reuse withTimeout()
Add static runBlocking() overloads.
Replace int timeout arg with std::chrono::milliseconds.

Change-Id: Id10a010f05eda8452cd7e4cd9ee46216087fc70e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-01 10:54:10 +00:00
Jarek Kobus
6f8e5c409f TaskTree: De-utils-ize manual test, rename it to demo
Change-Id: I80a2522f7ba12ee9b63c19d66e514d7047951733
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-01 10:53:35 +00:00
Jarek Kobus
b2dadeb30c TaskTree: Fix the empty Group's return result
Get back to the originally intended behavior
for StopOnDone and ContinueOnDone workflow policies.
By default, these policies report an error until
at least one child task finished with success.
Since the group is empty, no child finished with success,
so the group should report an error.

Change also the return result for the StopOnFinished policy
when placed in an empty group. The policy is meant to
report the finished child's result. Since no task finished,
report an error in this case.

Fix tests accordingly.

Amends c9638ff642

Change-Id: Idc449e8c68a658755bf566df56844126167f1751
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-01 10:53:28 +00:00
Jarek Kobus
619735d99d TaskTree: Introduce withTimeout()
Make it available for Group or CustomTask items.

Note, that when withTimeout() is used, the total
number of tasks grows by one.

Change-Id: Idc71737ba66b92bdc4bf17599c793b1127d22f5e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-01 10:53:21 +00:00
Jarek Kobus
1599106a22 TaskTree: Make the TimeoutTask reliable
Ensure the timeout tasks preserve the right order of
their done signals.

Change-Id: I62508d0710eb2324d7c347a9907a899c97d3975d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-01 10:53:12 +00:00
Jarek Kobus
f6e7dbd416 TaskTree: Introduce Timeout task
By default, when finished, it returns success.
In order to convert it into failing task,
enclose it inside a Group with finishAllAndError.

Reuse it in tasking tests.

Task-number: QTCREATORBUG-28741
Change-Id: Ic81203203e0b139d4f9bfd553279ecb01cd303f4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-01 10:53:04 +00:00
Jarek Kobus
5e9eadfc58 TaskTree: Introduce finishAllAndError workflow policy
It's going to be used in timeout task.

Change-Id: I2abd65b461cab445ada7a0ad5e1bbe07d1b6323b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-01 10:52:57 +00:00
Marco Bubke
4e91fd627a Don't add braces around single line scopes
There is a new option which adds braces:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#insertbraces

Change-Id: I1b0da930fa9faadb215fff4ed653bc95da0a6a17
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-06-01 09:03:18 +00:00
Marco Bubke
40954b8767 QmlDesigner: Handle invalid nodes and properties better
rMdel::removeModelNodes and Model::removeProperties should filter
invalid nodes.

Change-Id: I270f6712cbcc0cd672c9551cccd1de5e740eb549
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-06-01 08:07:35 +00:00
Marco Bubke
8a69afc1bd QmlDesigner: Fix model resource management bypass
Fixes: QDS-9766
Change-Id: I7a242b8e922140f7e100e90af1cd5029e82fcb5c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-05-31 14:48:57 +00:00
Marco Bubke
397a95689f QmlDesigner: Add removing of multiple nodes and properties
Sometimes multiple nodes or properties has to be removed. In that case
there is also the possibilty that we want to bypass the model resource
management.

Task-number: QDS-9766
Change-Id: I6c3cb0f682a7579f23d72431f641e2f812e2c63c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-05-31 14:02:16 +00:00
Jarek Kobus
29811f81dc FileSearch: Introduce FileContainer
That's going to replace FileIterator.

Benefits over FileIterator:

1. The FileContainer is a value type which may be
   freely copied.
2. Much faster iterating, especially for SubDirFileContainer
   with a big number of dirs / files (over 500000).

The FileContainer has begin() and end() functions returning
FileContainerIterator. The FileContainerIterator, when it's
not an end() iterator, contains the Item's value itself.
Whenever the iterator advances, the Item's value changes,
while the reference to Item's value remains unchanged inside
the iterator.

The SubDirFileContainer doesn't keep the references to all
visited Items anymore, contrary to the corresponding
SubDirFileInterator. The values of the individually visited
Items are kept only inside FileContainerIterator instances.

The progress information is available through the
FileContainerIterator's progressValue() / progressMaximum().

Task-number: QTCREATORBUG-28892
Change-Id: If89ac1121c21fa2fb7355aa12438dce3e85e465d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-31 13:33:09 +00:00
Jarek Kobus
3a75af3794 tst_SubDirFileIterator: Always generate ~700000 files
And ~175000 directories.
Distribute the generation and cleanup on all available cores.

With this patch I get the following config / measurements (linux):

Generating on 24 cores...
Generating 698881 files...
Generating 174721 dirs...
Generating inside "/tmp/tst_manual_subdirfileiterator-eHVKTL" dir...
GENERATING TEMPORARY FILES TREE stopped with timeout: 1777ms

ITERATING with SubDirFileIterator stopped with timeout: 92744ms
ITERATING with manual iterator stopped with timeout: 7905ms
ITERATING with QDirIterator stopped with timeout: 4706ms

CLEANING UP stopped with timeout: 1969ms

Amends 686a40d199

Change-Id: I7838e9cf73eae731a4dc3be02eeefa5caae8613d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-31 13:32:59 +00:00
Marcus Tillmanns
44e9d56c04 Utils: Fix macOS permissions parsing
Change-Id: I5fdde04c197b5db323fc8630c4ee4b2c197d947a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-31 13:15:07 +00:00
Robert Löhning
58fb6f88a6 SquishTests: Update reading build issues
Fixes tst_build_new_project, tst_CCOM02 et al.

tst_tasks_handling fails which might be an actual issue, reported in:

Task-number: QTCREATORBUG-29209
Change-Id: I5eae54df27d8ba8f441e5b9c4acdaa2b41716245
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-31 12:04:15 +00:00
Burak Hancerli
fbc4848f96 QmlProject: Support QDS. prefix when reading
This patch also includes a small update to skip creating 'shaderTool'
object in the json container if it doesn't exist in the qmlproject
file.

Task-number: QDS-9969
Change-Id: I1b8639c5e0a57aa77cbd417b51d57c1f4910613a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-05-31 09:44:23 +00:00
Christian Stenger
227c25ef2e Tests: Fix Qbs build
Change-Id: I26846091123f484f1906ce04c3c7d93134f17d80
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-31 08:37:08 +00:00
Marco Bubke
504d24db30 QmlDesigner: Model resource management
The model is now deleting and changing the dependencies by itself. That
has the advantage of consistency. So if a node is now removed all the
dependecies will be deleted changing in the same way.

Task-number: QDS-9766
Change-Id: I1edf9ce172e51b9f52b62612ed2bb7386bf5b221
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-31 08:05:59 +00:00
Christian Kandeler
8241fc87b4 CppEditor: Fix semantic highlighting
... for the case where the first line with semantic tokens has multiple
tokens.
This was not considered in the algorithm and uncovered by
d6f5d07639.
Also improve variable names and comments.

Fixes: QTCREATORBUG-29218
Change-Id: I0a1927c21edd70a3a91efc902e7e6ad2c734c91f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-31 07:46:04 +00:00
Jarek Kobus
4e01ca18d1 TaskTree: Rename optional into finishAllAndDone
Rationale:
1. More descriptive.
2. More consistent with a planned new finishAllAndError policy.
3. Limits the possibilities of making a conflict with std::optional.

Change-Id: I5155630188e4b699e6c18b13a101e0e2d4fe98f2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-30 15:23:31 +00:00
Jarek Kobus
cbca40401b TaskTree: Fix calling the proper group handler on stop
Add tests for it.

Change-Id: Ibb04b21c217196c9bbf6761851f4e1a300139a8c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-30 15:23:08 +00:00
Jarek Kobus
d69c3cec7d TaskTree tests: De-utils-ize TaskTree tests
Make the TaskTree tests dependent only on Tasking lib.

Introduce simple Timeout and Delay tasks for tests.
Using Timeout and Delay has a big advantage for these tests,
since e.g. when scheduling two parallel tasks with the same
timeout, we can expect the proper order in which they
finish. With AsyncTask it wasn't possible. Now, the tests
should be much more reliable and shouldn't exibit flakiness
anymore.

Use TickAndDone for Barrier tests.

Limit the tests' execution time from ~100ms into ~30ms.

Change-Id: Ifa08fd62c1a2759a877231c2220e353c1a26364f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-30 15:22:57 +00:00
Jarek Kobus
7625633ff2 TaskTree tests: Get rid of future synchronizer
The future synchronizer may abuse the subsequent test invocation
as it may still have spinning threads from the previous test run.

As all the started tasks should finish quickly on cancel,
we drop putting the canceled futures into the synchronizer.
Instead, we blocking wait for them to finish.

In this way, when the subsequent test is invoked, we should expect
the all available threads are ready to be used.

Change-Id: I9bb022b8c0950d27cb323ff83bf18148829160b3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-30 15:22:45 +00:00
Jarek Kobus
61f0bf479d FileSearch: Reuse searchInContents() inside findInFiles()
Get rid of findInFilesRegExp().

Change-Id: Iae47b023a1428a66fff165c0a0a4fa38d55ba132
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-30 12:07:38 +00:00
Marco Bubke
8330d4463a Sqlite: Fix that prepare is not checking that the database is locked
The database has to be locked because otherwise it is not thread save.
Because Sqlite connections are already called in different threads this
has to be enforced. The easiest way to lock a database is to put it in a
transaction.

It should be ok without locking so long the connection is only called
from one thread but I prefer to enforce it because I have already seen
code was preparing a statement not on initialization stage where it is
highly unlikely that there is more than one thread pre connection but in
the middle of the code. Because preparing is much more expensive than a
lock I prefer to enfore a lock here.

Change-Id: Id0b47f8d615a6697bb807392cafbe976bdd37233
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-30 11:20:00 +00:00
Marco Bubke
2981feefd7 Sqlite: Improve readCallback
There are many callback which do not control the flow and want to be
called for all steps. For that case we assume that a callback without a
return value will continue always.

Change-Id: I706123f2c425ac8c937d4d60ab977dae5ea9b030
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2023-05-30 09:59:19 +00:00
Eike Ziller
b9e316e8d1 Merge remote-tracking branch 'origin/11.0'
Change-Id: I057089d29f674e783011a22371f6499205bcf84b
2023-05-30 11:39:17 +02:00
Jarek Kobus
fa86a9dff0 TaskTree tests: Make test enums printable
In this way we see the name of the enum value instead
of an int on test fail.

Change-Id: I5eeae785c0bf1a85d7e5430b4b6b3aca8dd409ee
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-30 07:59:17 +00:00
Robert Löhning
db70923c6f SquishTests: Don't guess ABIs, use 64bit
Change-Id: I9c9ff40ff6064cc203d11cc273950d65ab4f983f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-26 13:09:10 +00:00
Robert Löhning
31da736e46 SquishTests: Remove outdated code
We don't have 32 bit packages anymore so the OS must be 64 bit.

Change-Id: If1ce6a502dd9c6b14d416915caf1d30bd5d01ddc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-26 13:08:34 +00:00
Robert Löhning
e2a4f0d701 SquishTests: Remove function for creating task file on error
Change-Id: I80b327da89f6c89a6b72a1df0f6ace0e5cf6b100
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-26 11:39:46 +00:00
Jarek Kobus
a78720060e FindFlags: Move it into Utils lib
It's going to be reused in filesearch.h API.

Change-Id: I7ef133368536a647e19949ba8623134cf078a87d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-26 07:59:41 +00:00
Burak Hancerli
dee8926bb5 QmlProject: Fix test data and rename the tests
Change-Id: I4b8ddf442fed0f1a38ca5cf642bd3f31a00e973b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-26 07:33:03 +00:00
Eike Ziller
90a6faed4e Merge remote-tracking branch 'origin/10.0' into 11.0
Conflicts:
	src/plugins/qtsupport/exampleslistmodel.cpp

Change-Id: Idbe0117ce810b4ab180a7c4f9b7b35c9c4b988e5
2023-05-25 15:49:57 +02:00
Christian Kandeler
c8f29b9e01 CppEditor: Add support for init statements in if conditions
Fixes: QTCREATORBUG-29182
Change-Id: I9b7969da694b368236246123ad0028d8e754e903
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-25 12:37:26 +00:00
Eike Ziller
dd1a69e05f Fix crash when examples are in multiple categories
When items are added into multiple categories, we got into a double
delete when cleaning up, e.g. when changing the shown examples to a
different Qt version.

Sort copies into categories and delete the originals as a quickfix.
Cleaner would be if we didn't allocate them on the heap in the first
place.

Fixes: QTCREATORBUG-29197
Change-Id: I6490111aba87335b0f7189c4957ed1da8681806f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-25 10:38:45 +00:00
Eike Ziller
6be33ccb1d Merge remote-tracking branch 'origin/master' into 11.0
Change-Id: I37adb8c1656cd5c979cd177eedef812ef093ad97
2023-05-25 09:34:25 +02:00
David Schulz
f235a72554 TextEditor: add tests for semantic highlighter
Change-Id: Id64c933f01c0dbc0e077656b6f4260b93e124311
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-25 07:01:35 +00:00
Eike Ziller
77c7a759b7 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	tests/unit/unittest/qmlprojectmanager/CMakeLists.txt

Change-Id: Ib6fd9bf09d654a7a2fe995dad3bcd93eacade2fb
2023-05-25 08:56:09 +02:00
Burak Hancerli
d47fd13058 QmlProject: Remove old test residuals
Change-Id: I800c3e9fe70725935aac5baf58763b7dabc6262a
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-24 12:09:38 +00:00
Alessandro Portale
9dcd2cf40b Add target condition to targets depending on QmlProjectManagerLib
The lib is only built with Qt 6.4.3 and higher

Change-Id: I825bab26b90565d315fed4a3ad1a3e6adf726ac6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
2023-05-23 14:21:18 +00:00
Christian Stenger
f248638a10 Re-enable test
Amends 590a6904b1.

Change-Id: I7ead3d44bf87d7eb22ebd18dadc9b2eb361850fd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-23 13:01:30 +00:00
Christian Stenger
cd267ca4bf Tests: Fix build before Qt 6.4.3
Change-Id: I6859b6c2a42f44e5bc24f569290869008f60d1b2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-23 11:54:20 +00:00
The Qt Project
34f4632228 Merge "Merge remote-tracking branch 'origin/11.0'" 2023-05-23 08:42:21 +00:00
Christian Stenger
590a6904b1 QmlDesigner: Fix qbs build and building with Qt6.2
Change-Id: Ic114c9eb830eed5cf0bef890007408694453791e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-23 08:40:09 +00:00
Eike Ziller
3dc5bbfa1f Merge remote-tracking branch 'origin/11.0'
Change-Id: Ic7bd1fb91f46c5f8fef47b2c442382186aeb7ad3
2023-05-23 10:17:31 +02:00
Christian Kandeler
8e7ad13ad2 Fix qbs build
Was broken in an impressive number of ways by latest Design Studio
merge.

Change-Id: I25f56827074a8c16a1a9c18884e1f63e8eaf6ef1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-23 07:24:49 +00:00
Tim Jenssen
1b6c0ff56c Merge remote-tracking branch 'origin/qds/dev'
Conflicts:
  coin/instructions/build.yaml
  doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc
  share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl
  src/libs/CMakeLists.txt
  src/libs/advanceddockingsystem/dockmanager.cpp
  src/libs/advanceddockingsystem/workspacedialog.cpp
  src/plugins/coreplugin/manhattanstyle.cpp
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmldesigner/components/formeditor/toolbox.cpp
  src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp
  src/plugins/qmldesigner/components/toolbar/toolbarbackend.cpp
  src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h
  src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp
  src/plugins/qmldesignerbase/qmldesignerbaseplugin.cpp
  src/plugins/qmldesignerbase/qmldesignerbaseplugin.h
  src/plugins/qmlprojectmanager/qmlproject.cpp
  src/tools/qml2puppet/CMakeLists.txt
  tests/unit/unittest/CMakeLists.txt

Change-Id: I2c5f18c4fca49471d02713ce5859032232cf7756
2023-05-22 21:13:40 +02:00
Marco Bubke
5eba056b73 QmlDesigner: Add callbacks for model resource management
As a node or property is removed there are now callbacks to generate
node, properties and expressions which should removed or adapt too.

Task-number: QDS-9766
Change-Id: I6d842006a6282af00ff644ffaa0f3102e14f13fa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-22 15:19:55 +00:00