Commit Graph

1427 Commits

Author SHA1 Message Date
Marco Bubke
90b0fd2869 UnitTests: Fix warning
Change-Id: I834095e1e8f40cb063b6014e98bf79ae8d8e439b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-07-18 15:12:22 +00:00
Marco Bubke
2322313baf QmlDesigner: Remove typeName usage in binding editor
Task-number: QDS-10266
Change-Id: I91232c1296c4ed3b3148af9053d3db0f43a08e24
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Aleksei German <aleksei.german@qt.io>
2023-07-18 09:00:14 +00:00
Marco Bubke
3d5ceb795d QmlDesigner: NodeMetaInfo can now get exported type names
You can get all exported names. That can the C++ names too for C++
types. If you only want the types name which are imported in a document
you can provide the source id for the document and get only that. If
there are different version exports you get them too.

Task-number: QDS-10274
Change-Id: Iefc0b68ebfd65998cf0481961f8c7643cdf9e5b9
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2023-07-17 09:36:58 +00:00
Marco Bubke
f7f65b9ea4 QmlDesigner: Get exported type names for type id and source id
It is matching the document imports with the exported type names.

Task-number: DS-10265
Change-Id: I0623cd0b3d04fa1a8c05354a194f10f3d8948b21
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2023-07-17 09:36:49 +00:00
Marco Bubke
e7bc9846d1 QmlDesigner: Add exportedTypeNames(TypeId) to project storage
Task-number: QDS-10265
Change-Id: If440f87b6719b865216e3890c8492c3682cf42dd
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2023-07-17 09:36:39 +00:00
hjk
9f72b0519f Unittest: Work around warning for unused parameter
Amends 7fada70e8f.

Change-Id: Ic47526a497c67dab48903b6500a37bab742034fd
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-07-17 09:23:38 +00:00
Marco Bubke
e7a7914aa8 QmlDesigner: Fix skip auto moc
Actually the syntax was wrong.

You can use

SKIP_AUTOMOC foo.cpp

or

PROPERTIES SKIP_AUTOMOC ON

SKIP_AUTOGEN is skipping AUTOUIC and AUTORCC too.

Change-Id: Id4afdc2572fc287ae66368ba0fd70b3ce7fc04ba
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
2023-07-12 07:15:50 +00:00
Marco Bubke
98cff9e097 QmlDesigner: More test for NodeMetaInfo
Task-number: QDS-10055
Change-Id: I23a9d7ea87dff9f3e07f5beeb734cea7d01d2e94
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-07-12 07:13:39 +00:00
Marco Bubke
8ab4968278 QmlDesigner: Introduce origin flags
metaInfo.isProjectComponent() is signaling if a file component is
directly part of the project. metaInfo.isInProjectModule() otherwise
shows if a type is inside of the project as a qmldir module. Both cannot
be true. If a type is not part of either it is a system type.

Task-number: QDS-10251
Change-Id: Iae2270827a500ad6393e3751b3af276f9b030679
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-07-11 15:42:48 +00:00
Marco Bubke
a3f990d713 QmlDesigner: Add type lookup
Task-number: QDS-10246
Change-Id: I607f72e29734a3c59b7b5b33d96735d708cd18ec
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-07-11 15:42:06 +00:00
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