Commit Graph

8097 Commits

Author SHA1 Message Date
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
Marco Bubke
be824148be Sqlite: Improve transaction by inversion of control
Using a callable makes it possible to omit the commit call. It is now
called by the withDeferredTransaction and withImmediateTransaction
function.

Change-Id: I9b7bfa7e32f269fe8fcba2fe5e1218e73f5846d1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2023-05-22 10:07:40 +00:00
Jarek Kobus
c9638ff642 TaskTree: Fix docs about empty Group and different workflows
Add tests for empty Group with different workflow policies.
Add tests for successful / failing task in a Group with
different workflow policies.

Change-Id: I50129713f836d2146b119ceb73b5ae43abf01639
Reviewed-by: hjk <hjk@qt.io>
2023-05-22 09:22:38 +00:00
Jarek Kobus
c098b261dc TaskTree: Refactor Group internal data
Introduce the GroupData structure. In this way it's easily
possible to add extra properties of already used types, e.g. int.

It's also possible to easily create elements with multiple
properties.

Simplify internal TaskItem::Type enum.

Get rid of special ParallelLimit and Workflow elements.
Provide global parallelLimit() and workflowPolicy() functions.

Make global items (e.g. parallel, stopOnDone, etc...) const.

Change-Id: Ic5628255b542fd6c5a5565b055ff11804c8d7b68
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-19 15:30:15 +00:00
Jarek Kobus
0793b945f3 TaskTree: Replace usages of OnGroup... with onGroup... functions
Change-Id: I06ce6c917ac28b6362ad2cdef42355e5aa28f4eb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 15:29:55 +00:00
Jarek Kobus
2274847bfe tst_SubDirFileIterator: Fix build with Qt < 6.3
QDirIterator::nextFileInfo() was introduced in Qt 6.3.

Change-Id: I3ed6293d4262b0ff2bb4423eb37c35c7b3650e97
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 14:54:27 +00:00
Jarek Kobus
7501d7587f TaskTree: Introduce WorkflowPolicy::StopOnFinished
The policy is useful mainly in parallel mode.
It stops executing the Group when any task finishes.
It reports the task's result.

Change-Id: I7aa98365cdc4c1eb869ab419d42d0cc5438d43bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 08:40:24 +00:00
Jarek Kobus
f0acaecc63 tst_Async: Reuse TaskTree:runBlocking()
Change-Id: Ia5dd76bed15014d920e44f51de1774323be0b9a6
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-05-19 07:19:46 +00:00
Jarek Kobus
6a8e8f5fbd tst_Tasking: Reuse TaskTree:runBlocking()
Get rid of the OnStart enum - that's checked indirectly
through the runBlocking() call.

Change-Id: I190de0f911c68195c31e722bcb1823b678cb0bd4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-19 07:19:33 +00:00
Jarek Kobus
686a40d199 SubDirFileIterator: Add manual performance test
Compare the total time spent on iterating a big file tree
with 3 different time iterators:
- Utils::SubDirFileIterator
- manually written iterator using QDir::entryInfoList()
- QDirIterator

The iterator run through about one million files (including
about ~100K directories). The more files above this
number to be iterated over, the bigger the relative time
difference of SubDirFileIterator compared to other iterators.

The number of generated files depends on the running
machine's core number. In my case:

Number of cores: 24
Number of generated files: 898753
Number of generated directories: 112345
Time spent on generating file tree: ~2 seconds
Time spent on iterating using SubDirIterator: ~80 seconds
Time spent on iterating using manual iterator: ~8 seconds
Time spent on iterating using QDirIterator: ~4 seconds
Time spent on removing generated file tree: ~2 seconds

Task-number: QTCREATORBUG-28892
Change-Id: I94d7cf0169a470820dc27f39c9cdb4150eea51c1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-19 07:17:01 +00:00
The Qt Project
7057962e44 Merge "Merge remote-tracking branch 'origin/10.0'" 2023-05-17 14:23:50 +00:00
Christian Stenger
23b0082b20 Tests: Build text tests with Qbs as well
Amends 1a98dda5c4.

Change-Id: If563437141ac75bb2b72a9d550d1fb507a89e63c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-17 13:36:18 +00:00
Eike Ziller
8e8ebc8f88 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	coin/instructions/build.yaml

Change-Id: I697b0107e75c6259989247de2180437d7987ff37
2023-05-17 14:55:02 +02:00
David Schulz
b2e30e7ef8 Utils: add Position::fromCursor with tests
Change-Id: I1cd989eaf7e75bc04f171989f9f9fe932402abef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-17 12:53:22 +00:00
Christian Stenger
a468bc2f02 Fix Qbs build
Amends f84199f8b7 and
reverts 796cfceb3a.

Change-Id: I7eb686c012bd99cddf36aa16219e3f33de2b15b2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-17 10:36:29 +00:00
hjk
8f5703a7b9 Tests: Add a test to feed shells via stdin
Change-Id: I7e19537d0a3015aeb329849758cc92da17a67606
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-17 08:21:09 +00:00
Christian Stenger
796cfceb3a Tests: Fix Qbs build
Amends f84199f8b7.

Change-Id: I6a233aca13f9908451748c20c1804fa2851043aa
Reviewed-by: hjk <hjk@qt.io>
2023-05-17 08:17:12 +00:00
Jarek Kobus
f84199f8b7 Solutions: Long live Solutions!
Short live Tasking in Solutions!

Add src/libs/solutions/README.md with the motivation and hints.

Move TaskTree and Barrier from Utils into Tasking object lib,
the first solution in Solutions project.

Tasking: Some more work is still required for adapting auto and
manual tests. Currently they use Async task, which stayed in Utils.
For Qt purposed we most probably need to have a clone of
Async task inside the Tasking namespace that is more Qt-like
(no Utils::FutureSynchronizer, no priority field,
global QThreadPool instead of a custom one for Creator).

Change-Id: I5d10a2d68170ffa467d8c299be5995b9aa4f8f77
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 06:29:03 +00:00
David Schulz
9758e71458 Utils: add tests for Position::fromPositionInDocument
Change-Id: I2b530cf62a4defe0292c51834b1e5093a7d5e55f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-16 10:30:15 +00:00
David Schulz
479d7e3732 Utils: remove duplicated test
Change-Id: I0391feb848af09295afd9d3e84e25337023c24b6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-16 08:55:21 +00:00
David Schulz
b4734ff727 Utils: add tests for Position::fromFileName
Change-Id: I321b91567e47e08883c7b991cd24d02bb8a9b9c6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-16 08:24:28 +00:00
Burak Hancerli
057b4428d8 QmlDesigner: Refactor QmlProjectManager tests
Task-number: QDS-9743
Change-Id: Ia5e788fcebacef59ba12226e2c873f5cbf8954ba
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-16 08:17:40 +00:00
Robert Löhning
e719a2b47a SquishTests: Update tst_create_proj_wizard
Change-Id: Id17f5d1a68da7fe7c9f45dc5b62ab3fe1039f753
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-15 14:13:41 +00:00
Robert Löhning
0b241f42f1 SquishTests: Make suite_tools Python3 compatible
Except for tst_designer_edit which needs a bigger update.

Change-Id: I8300a9491ec34b4d8deeed39f02fc59281cc20c9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-15 14:12:17 +00:00
Robert Löhning
a820b5490c SquishTests: Fix using invalid paste IDs
Change-Id: Ibc48506ff1632cbfe8d662cd00ed057af7d16a6a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-15 14:12:01 +00:00
David Schulz
1a98dda5c4 Utils: fix Text::Range length and remove mid
Those functions are based on the assumption that the passed text starts
at the begin position, which was good enough for search results, but if
used in other parts of the codebase it might give unwanted results.
Calculate the length of the range now as expected and subtract the
beginning lines.
In order to still got the correct results for the text result texts
modify the result range to always start at the first line before
calculating the length of the range.
Also add tests for the modified functionality

Change-Id: I7ccd75b642dda6dd4f738877cbe3543d46c03652
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-12 11:03:33 +00:00
Jarek Kobus
97a66067bb TaskTree: Prepare for de-utils-ization - part 2
Move TaskTree into Tasking namespace.
Move Tasking namespace out of Utils namespace.

Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 08:09:19 +00:00
David Schulz
1acd2499e2 Utils: replace LineColumn with Text::Position
Change-Id: Ia69547374efec7412717cbed1eb4162162a89d39
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-11 17:00:28 +00:00
Marco Bubke
a6ba2354cc QmlDesigner: Cleanup the Qt conditions
We have now demand QmlPrivate, QmlDomPrivate and QmlCompilerPrivate.

Change-Id: I77fa5b506c827b9ba2f7ea18e3ffdd176c1871ec
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-11 09:12:13 +00:00
Eike Ziller
7f5876b45a Merge remote-tracking branch 'origin/10.0'
Change-Id: I98e5e1ad43103984b490c65cdeed84b7414303b3
2023-05-11 10:33:18 +02:00
David Schulz
5b0c3258bb Utils: Make column of LineColumn consistently 0-based
Change-Id: I4ab153d1c55653936efbcdc13ac04463185930e0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-11 05:53:49 +00:00
Marcus Tillmanns
fc95d7a737 Utils: Improve FilePath::sort
Remove the conversion to/from QString for sorting.

Change-Id: I89921328b6d9e952c802d41998495bd2ffbb9f99
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 08:56:32 +00:00
Jarek Kobus
c68a013a3e Tasking::Tree: Rename Tree into TaskTreeTask
Task-number: QTCREATORBUG-29102
Change-Id: I70073bcb44a712c427c8c5aea42c48dbc30eebe0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:45 +00:00
Jarek Kobus
c75b59f9b4 Process: Rename QtcProcessPrivate -> ProcessPrivate
Rename the logging category for Process.
Fix inline comments accordingly.
Adapt warning/debug messages accordingly.

Change-Id: I2b1f0f558701def3afa3c1b04adf629833dba9e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:22 +00:00
hjk
2e7930b56e LayoutBuilder: Rename Id to ID
The Id was only used in the demo. "ID" is Not exactly canonical naming,
but this clashes often with Utils::Id, so mis-spell until we settle on a
proper name.

Change-Id: I6fdf806c41abf224f7422ec6c9263db3eb357190
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:59:13 +00:00
Marco Bubke
849b8cf000 QmlDesigner: Improve sqlite id
https://www.sqlite.org/autoinc.html says that "If no negative ROWID
values are inserted explicitly, then automatically generated ROWID
values will always be greater than zero."

So zero is an invalid value.

This changes reflect on it and makes it an invalid value too. Null is a
special value in SQL and it could cast to zero by accident. To prevent
that ambiguty we make zero an invalid value too.
You can explicit add negative rowids but that has size overhead because
positive values can be compressed. So explicit not positive values are
not supported.

Change-Id: I417ea9fec1573cfd9f1a98134f8adc567021988c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-09 13:42:31 +00:00