Commit Graph

1467 Commits

Author SHA1 Message Date
Christian Stenger
c6a8a76be0 Fix Qbs build
Change-Id: Ic02f12a08990bfa9eb3f0131141407373248bae1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-05 09:21:08 +00:00
Tim Jenssen
7fada70e8f unittest: fix linking problem on windows
Task-number: QDS-10245
Change-Id: Ie6baee6c9e5c8351fe67b2dd49ad4e80147ec48a
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-07-04 16:49:43 +00:00
Tim Jenssen
48230d63b8 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts:
 src/plugins/qmldesigner/CMakeLists.txt
 src/plugins/qmldesignerbase/CMakeLists.txt
 src/plugins/qmlprojectmanager/CMakeLists.txt
Change-Id: If706ae3fe7a7d0e17036ce6285bec772d1f6127d
2023-07-04 16:22:32 +00:00
Marco Bubke
941e890804 UnitTests: Fix flacky tests
There were multiple reasons why the tests were flacky. First
Utils::reverseCompare had a bug. Now

std::lexicographical_compare(first.rbegin(), first.rend(),
                             second.rbegin(), second.rend())

is used.

Second the check StorageCache::checkEntries was not const. So it would
change the vector which it was iterating. So the iterator could be an
dangling.

Fixes: QDS-10197
Change-Id: I84fca6a2b24e1cae9fb85a01b6208de7e58240df
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-29 18:06:25 +00:00
hjk
627cb353f6 Unittests: Avoid warnings about warnings
smallstring-test.cpp:1538:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]

Change-Id: Ibd3236734abd20c72a67efae0ab477cab6ae8b97
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-06-29 10:51:12 +00:00
Marco Bubke
f81ef9b2d6 Sqlite: Don't link to the internal Sqlite library
If you link to the internal Sqlite library you link actually twice. That
leads to strange bugs because you have an uninitialized object file. The
static linking workaround is now moved to cmake.

Change-Id: I51d966a623a18486ce5870d898999f3ce139f092
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-28 16:40:49 +00:00
Marco Bubke
b65ba2f702 QmlDesigner: Remove ProjectStorageSqliteFunctionRegistry
It is not used.

Change-Id: I7c2968a0a9876c04afffceedb87d46f19f0a7ace
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-28 16:40:44 +00:00
Marco Bubke
f36062c084 UnitTests: Temporary remove function registry
The function is not used but triggers strange accesses to null pointer.

Task-number: QDS-10178
Change-Id: Iea51609f7b8956a98fe9391aef8edac899e14c03
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-27 16:27:18 +00:00
Marco Bubke
5bd9721f01 UnitTests: Fix disabled test
Change-Id: I828ba785ac352a72b0fe7e3c3ea23c72df219fe5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-27 13:01:15 +00:00
Marco Bubke
90cfc2f7e8 QmlDesigner: Fix warnings
Change-Id: I2b9c2d024b1c09c157e448f590e2748337cbeb89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-27 13:00:46 +00:00
Marco Bubke
d7ee848efd QmlDesigner: Improve NodeMetaInfo
Change-Id: I1b31a1b08332f6bdba74c46af3d0a190901e9607
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-27 11:54:02 +00:00
Tim Jenssen
623ee60611 UnitTest: disabled needs to be DISABLED
Change-Id: Id6e4cb898934bcc2993c1e402ce7741162e0ab91
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-06-27 09:04:58 +00:00
Tim Jenssen
53579298c5 UnitTest: add mock property "layer.effect"
Change-Id: Ibd9698b8e4a365818ff9e5a3233a08eb891325c8
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-06-27 09:04:49 +00:00
Marco Bubke
5d4dffdc89 UnitTests: Remove unused matcher
There are no clang test anymore.

Change-Id: I2140c4ff97e0351d627ec7b0f7306e0158fb95ca
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-06-26 07:40:20 +00:00
Marco Bubke
57c4316e54 UnitTests: Fix dependencies
Change-Id: Ia5e3968aea4ae724f7554c2f7fa7223953236816
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
2023-06-26 07:40:10 +00:00
Tim Jenssen
846f8dba92 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts: src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
  src/plugins/qmldesigner/components/stateseditornew/stateseditorwidget.cpp
  tests/unit/unittest/qmlprojectmanager/projectitem-test.cpp

Change-Id: Icdb63851ec0162d82217e85b3beb0b6f9f12899e
2023-06-22 14:50:56 +00:00
Marco Bubke
44565bc39b GoogleTest: Hard wire google tests
There were problems with older google test versions which were found
instead. Now the google test version is always the same and there cannot
be "strange" compile bugs.

Change-Id: Ib3dc74d1abbe369fb37a4ee5616011d8e3696c01
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-22 10:19:50 +00:00
hjk
0415bea736 Tests: gtest unittest: improve compilability
... with recent (namespaced) Qt dev.

[...]tests/unit/unittest/3rdparty/googletest/googletest/include/gtest/gtest-matchers.h:184:14: error: invalid conversion from 'const char*' to 'ushort' {aka 'short unsigned int'} [-fpermissive]
In file included from /data/dev/qt-6-ns/qtbase/include/QtCore/qstring.h:1,
                 from /data/dev/qt-6-ns/qtbase/include/QtCore/QString:1,
                 from /data/dev/creator-out/src/libs/utils/smallstringview.h:9,
                 from /data/dev/creator-out/src/libs/utils/smallstringliteral.h:8,
                 from /data/dev/creator-out/src/libs/utils/smallstring.h:8,
                 from /data/dev/creator-out/src/libs/utils/smallstringvector.h:8,
                 from /data/dev/creator-out/src/libs/utils/smallstringio.h:6,
                 from /data/dev/creator-out/tests/unit/unittest/gtest-creator-printing.h:7,
                 from /data/dev/creator-out/tests/unit/unittest/googletest.h:17,
                 from /data/dev/creator-out/tests/unit/unittest/externaldependenciesmock.h:6,
                 from /data/dev/creator-out/tests/unit/unittest/modulescanner-test.cpp:4:
a/dev/qt-6-ns/qtbase/src/corelib/text/qstring.h:1006:61: note:   initializing argument 2 of 'bool Ns::operator==(const Ns::QString&, Ns::QChar)'
[104/1218] Building CXX object src/plugins/coreplugin/CMakeFiles/Core.dir/locator/executefilter.cpp.o^C

Change-Id: Id8d4533b9e53d7aa81edc64a99df31dd1d6ac5bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-06-13 08:41:23 +00:00
Tim Jenssen
66263782ec Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts:
  src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
  src/plugins/qmldesigner/components/stateseditornew/stateseditorview.cpp
  src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
  src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp

Change-Id: I4c8a33736b25c3bb24241224d0a1e7358bb7fd94
2023-06-08 16:35:56 +02:00
Marco Bubke
263152cc81 UnitTests: Cleanup
Instead of putting everything into one big target there are now
libraries which are used by the tests.

Change-Id: I15727924f76b5cb600b7e533e7a6b8701dba81e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-08 12:31:40 +00:00
Marco Bubke
eaf4391660 UnitTests: Make test names more readable
A majority prefers snake case for long names and because test names are
describtive they have to be long.

Change-Id: I898beb5c9f1b9ab7f7c285b6278454068744f5da
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-07 15:49:27 +00:00
Burak Hancerli
8af0c065ac QmlProject: Reorganize unittests
Task-number: QDS-9946
Change-Id: Ib165340d13e40c6e8fba08a828ceecb312dd5dde
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-06-07 13:14:27 +00:00
Jarek Kobus
abb85b073a QScopeGuard: Make all usages of QScopeGuard consistent
Change-Id: Icfc35ecbdbdee8dadbb1b17789694093427c3ed9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-07 10:35:01 +00:00
Marco Bubke
71e1a77197 QmlDesigner: Add removal for binding properties
If an id is present in a binding expression and the node with that id is
removed we remove the expression is removed too.

Task-number: QDS-10018
Change-Id: I6c33005edcbcafbff7dd82af47977b238068eba1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-06-07 08:09:40 +00:00
Burak Hancerli
5dadc57bc3 QmlProject: Fix escaping while rewriting the qmlproject file
Task-number: QDS-10032
Change-Id: I856d9935a1c77085f79008db19920f12af9e1a21
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-06 10:16:30 +00:00
Tim Jenssen
002d84cb15 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts: src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/auto/qml/qmlprojectmanager/fileformat/fileformat.qbs
  tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp

Change-Id: I257f1908917bcc58805619b53b6866f2f73ca544
2023-06-02 19:26:05 +00:00
Marco Bubke
cffd45890b UnitTests: Fix warning in ModelResourceManagement
Change-Id: I13e9bae5e3431ac131ce9a9de492a011f5e5a979
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-06-02 11:32:56 +00:00
Marco Bubke
1655f1f622 QmlDesigner: Remove FlowTransition if to or from targets are removed
Task-number: QDS-9766
Change-Id: I41c5d6769400772aa4b0d8b395b6a7ed79270cbd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-06-01 13:53:53 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
Jarek Kobus
936086745a FileSearch: Get rid of FileSearchResult
Use SearchResultItem instead.
This change should reduce the remaining freeze described in
a9eb732ce6 even more.

Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-09 11:03:48 +00:00