From 402ac58d05bbb5e2427292db704959ef62e9f544 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 14 Mar 2024 10:02:37 +0100 Subject: QmlDesigner: Fix missing BreakTemplateDeclarations Change-Id: I00c042e5e0a04705e3c2773dca5499d9bfa32949 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Tim Jenssen Reviewed-by: --- tests/unit/.clang-format | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/unit/.clang-format b/tests/unit/.clang-format index d3695ac2982..366f82f76f2 100644 --- a/tests/unit/.clang-format +++ b/tests/unit/.clang-format @@ -2,6 +2,7 @@ Language: Cpp AccessModifierOffset: -4 AlignEscapedNewlines: DontAlign AllowShortFunctionsOnASingleLine: Inline +AlwaysBreakTemplateDeclarations: true # use with clang 19 BinPackArguments: false BinPackParameters: false BraceWrapping: @@ -15,6 +16,7 @@ BreakBeforeBinaryOperators: All BreakBeforeBraces: Custom BreakConstructorInitializers: BeforeComma BreakInheritanceList: AfterComma +# BreakTemplateDeclarations: Yes # use with clang 19 ColumnLimit: 100 IncludeCategories: - Regex: 'Q.*' -- cgit v1.2.3 From c9527e03419de8e5edd3527e4bc1be4497e0e3bd Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Fri, 15 Mar 2024 09:01:32 +0100 Subject: Sqlite: Improve tracing Change-Id: Id5d6ee448a7f2cf06cda2e2776f3dbbe7c8f66c4 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Tim Jenssen --- tests/unit/tests/mocks/mocksqlitestatement.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/mocks/mocksqlitestatement.h b/tests/unit/tests/mocks/mocksqlitestatement.h index f34b13f6d0f..1e55d4c74f1 100644 --- a/tests/unit/tests/mocks/mocksqlitestatement.h +++ b/tests/unit/tests/mocks/mocksqlitestatement.h @@ -50,6 +50,8 @@ public: SqliteDatabaseMock &database() { return *m_databaseMock; } + MOCK_METHOD(std::uintptr_t, handle, (), (const)); + private: SqliteDatabaseMock *m_databaseMock = nullptr; }; -- cgit v1.2.3 From 4fc1ca984f4e314ec8f7c769aec7f28c74a92427 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Fri, 15 Mar 2024 17:20:19 +0100 Subject: Utils: Add number Smallstring::append Saves some overhead. Change-Id: I7d46e41f29e66cd01f5a11f16e6f78ff7a4d0aa8 Reviewed-by: Tim Jenssen Reviewed-by: Qt CI Patch Build Bot --- .../unit/tests/unittests/utils/smallstring-test.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/unittests/utils/smallstring-test.cpp b/tests/unit/tests/unittests/utils/smallstring-test.cpp index bdcdb44019f..ac979ef65c3 100644 --- a/tests/unit/tests/unittests/utils/smallstring-test.cpp +++ b/tests/unit/tests/unittests/utils/smallstring-test.cpp @@ -941,6 +941,24 @@ TEST(SmallString, append_empty_initializer_list) ASSERT_THAT(text, Eq("some text")); } +TEST(SmallString, append_int) +{ + SmallString text("some text"); + + text += 123; + + ASSERT_THAT(text, Eq("some text123")); +} + +TEST(SmallString, append_float) +{ + SmallString text("some text"); + + text += 123.456; + + ASSERT_THAT(text, Eq("some text123.456")); +} + TEST(SmallString, to_byte_array) { SmallString text("some text"); @@ -1839,6 +1857,8 @@ TEST(SmallString, number_to_string) ASSERT_THAT(SmallString::number(std::numeric_limits::min()), "-9223372036854775808"); ASSERT_THAT(SmallString::number(1.2), "1.2"); ASSERT_THAT(SmallString::number(-1.2), "-1.2"); + ASSERT_THAT(SmallString::number(1.2f), "1.2"); + ASSERT_THAT(SmallString::number(-1.2f), "-1.2"); } TEST(SmallString, string_view_plus_operator) -- cgit v1.2.3 From cea24ad00b86f15fbe549c1177e1852c4bed30d7 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Fri, 15 Mar 2024 11:39:24 +0100 Subject: Utils: Add char append to SmallString Change-Id: I644db7635010da8bc29d87926a64c4e6939d7c83 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Tim Jenssen --- tests/unit/tests/unittests/utils/smallstring-test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/unittests/utils/smallstring-test.cpp b/tests/unit/tests/unittests/utils/smallstring-test.cpp index ac979ef65c3..3594c838c96 100644 --- a/tests/unit/tests/unittests/utils/smallstring-test.cpp +++ b/tests/unit/tests/unittests/utils/smallstring-test.cpp @@ -959,6 +959,15 @@ TEST(SmallString, append_float) ASSERT_THAT(text, Eq("some text123.456")); } +TEST(SmallString, append_character) +{ + SmallString text("some text"); + + text += 'x'; + + ASSERT_THAT(text, Eq("some textx")); +} + TEST(SmallString, to_byte_array) { SmallString text("some text"); -- cgit v1.2.3 From 26870406cdf45a56a95b9b00df7eff8828f124fc Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 18 Mar 2024 12:23:42 +0100 Subject: QmlDesigner: Trace project storage exceptions Change-Id: I58c261bea4cca6c5bede0d2ad504be8bc687ddc6 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Tim Jenssen --- .../unittests/projectstorage/projectstorageupdater-test.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp index d9578d2f1b6..a28c5e4935d 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp @@ -3210,7 +3210,8 @@ TEST_F(ProjectStorageUpdater, errors_for_watcher_updates_are_handled) SecondType 2.2 Second.qml)"}; setContent(u"/path/qmldir", qmldir); - ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Throw(QmlDesigner::ProjectStorageError{})); + ON_CALL(projectStorageMock, synchronize(_)) + .WillByDefault(Throw(QmlDesigner::NoSourcePathForInvalidSourceId{})); ASSERT_NO_THROW(updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}})); } @@ -3227,7 +3228,8 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens) {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); setFilesDontChanged({directoryPathSourceId, qmlDirPathSourceId}); - ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Throw(QmlDesigner::ProjectStorageError{})); + ON_CALL(projectStorageMock, synchronize(_)) + .WillByDefault(Throw(QmlDesigner::NoSourcePathForInvalidSourceId{})); updater.pathsWithIdsChanged( {{qmltypesProjectChunkId, {qmltypesPathSourceId, qmltypes2PathSourceId}}}); ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Return()); @@ -3286,7 +3288,8 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens_and_ {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); setFilesDontChanged({directoryPathSourceId, qmlDirPathSourceId}); - ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Throw(QmlDesigner::ProjectStorageError{})); + ON_CALL(projectStorageMock, synchronize(_)) + .WillByDefault(Throw(QmlDesigner::NoSourcePathForInvalidSourceId{})); updater.pathsWithIdsChanged( {{qmltypesProjectChunkId, {qmltypesPathSourceId, qmltypes2PathSourceId}}}); ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Return()); @@ -3348,7 +3351,8 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens_and_ {directoryPathSourceId, qmlDocumentSourceId1, QmlDesigner::ModuleId{}, FileType::QmlDocument}, {directoryPathSourceId, qmlDocumentSourceId1, QmlDesigner::ModuleId{}, FileType::QmlDocument}}); setFilesDontChanged({directoryPathSourceId, qmlDirPathSourceId}); - ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Throw(QmlDesigner::ProjectStorageError{})); + ON_CALL(projectStorageMock, synchronize(_)) + .WillByDefault(Throw(QmlDesigner::NoSourcePathForInvalidSourceId{})); updater.pathsWithIdsChanged( {{qmlDocumentProjectChunkId, {qmlDocumentSourceId1, qmlDocumentSourceId2}}}); ON_CALL(projectStorageMock, synchronize(_)).WillByDefault(Return()); -- cgit v1.2.3 From f63bd7f933829ca49d19d02cba294d7e0a3384a1 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 21 Mar 2024 14:46:40 +0100 Subject: QmlDesigner: Crash fix * Add QTC_CHECK for crash * ActionAreas should not be "garbage" collected if they have no target. * Initial ActionAreas do not have a target and ActionAreas without target make sense to a user. We do not want to delete them together with the target. Task-number: QDS-12181 Change-Id: Ie520c47aad990a8ff07fc3346e6772226d334ce5 Reviewed-by: Marco Bubke Reviewed-by: --- tests/unit/tests/unittests/model/modelresourcemanagement-test.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'tests') diff --git a/tests/unit/tests/unittests/model/modelresourcemanagement-test.cpp b/tests/unit/tests/unittests/model/modelresourcemanagement-test.cpp index 40b94f872d5..fd3d3c70c35 100644 --- a/tests/unit/tests/unittests/model/modelresourcemanagement-test.cpp +++ b/tests/unit/tests/unittests/model/modelresourcemanagement-test.cpp @@ -280,7 +280,6 @@ INSTANTIATE_TEST_SUITE_P( ForTarget, testing::Values(TargetData{"QtQuick.Item", "QtQuick.PropertyChanges", "target"}, TargetData{"QtQuick.Item", "QtQuick.Timeline.KeyframeGroup", "target"}, - TargetData{"FlowView.FlowTransition", "FlowView.FlowActionArea", "target"}, TargetData{"QtQuick.Item", "QtQuick.PropertyAnimation", "target"}, TargetData{"FlowView.FlowItem", "FlowView.FlowTransition", "to"}, TargetData{"FlowView.FlowItem", "FlowView.FlowTransition", "from"})); -- cgit v1.2.3 From fd3047bac2c551e6c1bcfa1a4a6d5562e8e67d35 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 22 Mar 2024 14:42:00 +0200 Subject: QmlDesigner: Join sleeping task queue thread Threads are still considered joinable after their execution. So sleeping thread have to be joinded first. Add test Fixes: QDS-12308 Change-Id: Ie01588293e3b7ce9fe149d52a25ba03d174cca88 Reviewed-by: Reviewed-by: Tim Jenssen --- .../unit/tests/unittests/imagecache/taskqueue-test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/unittests/imagecache/taskqueue-test.cpp b/tests/unit/tests/unittests/imagecache/taskqueue-test.cpp index 537f4b3ea32..ea295c57332 100644 --- a/tests/unit/tests/unittests/imagecache/taskqueue-test.cpp +++ b/tests/unit/tests/unittests/imagecache/taskqueue-test.cpp @@ -100,4 +100,22 @@ TEST_F(TaskQueue, clean_task_in_queue) queue.clean(); } +TEST_F(TaskQueue, sleeping_queue_is_recovering) +{ + Queue queue{mockDispatchCallback.AsStdFunction(), mockCleanCallback.AsStdFunction()}; + EXPECT_CALL(mockDispatchCallback, Call(IsTask(5))).WillRepeatedly([&](Task) { + notification.notify(); + }); + queue.addTask(5); + notification.wait(); + queue.putThreadToSleep(); + + EXPECT_CALL(mockDispatchCallback, Call(IsTask(22))).WillRepeatedly([&](Task) { + notification.notify(); + }); + + queue.addTask(22); + notification.wait(); +} + } // namespace -- cgit v1.2.3 From 6751fc82efefd4923990cd46a31d13e9c47326cb Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 26 Mar 2024 13:58:07 +0100 Subject: Sqlite: Prevent name collisions for indices There can be unique and not unique indices with the same columns. So we add that attribute to the name to distinguish between the indices. Change-Id: I96eac1f0e95c135d625f09fd5399b16f2293d645 Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- .../tests/unittests/sqlite/sqliteindex-test.cpp | 27 +++++++++--- .../tests/unittests/sqlite/sqlitetable-test.cpp | 48 +++++++++++----------- 2 files changed, 47 insertions(+), 28 deletions(-) (limited to 'tests') diff --git a/tests/unit/tests/unittests/sqlite/sqliteindex-test.cpp b/tests/unit/tests/unittests/sqlite/sqliteindex-test.cpp index 9d3fca88ffa..b065c0ab9a4 100644 --- a/tests/unit/tests/unittests/sqlite/sqliteindex-test.cpp +++ b/tests/unit/tests/unittests/sqlite/sqliteindex-test.cpp @@ -17,7 +17,9 @@ TEST(Index, one_column) auto sqlStatement = index.sqlStatement(); - ASSERT_THAT(sqlStatement, Eq("CREATE INDEX IF NOT EXISTS index_tableName_column1 ON tableName(column1)")); + ASSERT_THAT( + sqlStatement, + Eq("CREATE INDEX IF NOT EXISTS index_normal_tableName_column1 ON tableName(column1)")); } TEST(Index, two_column) @@ -26,7 +28,9 @@ TEST(Index, two_column) auto sqlStatement = index.sqlStatement(); - ASSERT_THAT(sqlStatement, Eq("CREATE INDEX IF NOT EXISTS index_tableName_column1_column2 ON tableName(column1, column2)")); + ASSERT_THAT(sqlStatement, + Eq("CREATE INDEX IF NOT EXISTS index_normal_tableName_column1_column2 ON " + "tableName(column1, column2)")); } TEST(Index, empty_table_name) @@ -49,7 +53,8 @@ TEST(Index, unique_index) auto sqlStatement = index.sqlStatement(); - ASSERT_THAT(sqlStatement, Eq("CREATE UNIQUE INDEX IF NOT EXISTS index_tableName_column1 ON tableName(column1)")); + ASSERT_THAT( + sqlStatement, Eq("CREATE UNIQUE INDEX IF NOT EXISTS index_unique_tableName_column1 ON tableName(column1)")); } TEST(Index, condition) @@ -58,8 +63,20 @@ TEST(Index, condition) auto sqlStatement = index.sqlStatement(); + ASSERT_THAT( + sqlStatement, + Eq("CREATE INDEX IF NOT EXISTS index_partial_tableName_column1 ON tableName(column1) WHERE " + "column1 IS NOT NULL")); +} + +TEST(Index, unique_index_with_condition) +{ + Index index{"tableName", {"column1"}, IndexType::Unique, "column1 IS NOT NULL"}; + + auto sqlStatement = index.sqlStatement(); + ASSERT_THAT(sqlStatement, - Eq("CREATE INDEX IF NOT EXISTS index_tableName_column1 ON tableName(column1) WHERE " - "column1 IS NOT NULL")); + Eq("CREATE UNIQUE INDEX IF NOT EXISTS index_unique_partial_tableName_column1 ON " + "tableName(column1) WHERE column1 IS NOT NULL")); } } diff --git a/tests/unit/tests/unittests/sqlite/sqlitetable-test.cpp b/tests/unit/tests/unittests/sqlite/sqlitetable-test.cpp index 7b8189b51e4..e1b0427f3c7 100644 --- a/tests/unit/tests/unittests/sqlite/sqlitetable-test.cpp +++ b/tests/unit/tests/unittests/sqlite/sqlitetable-test.cpp @@ -60,9 +60,9 @@ TEST_F(SqliteTable, add_index) auto index = table.addIndex({column, column2}); - ASSERT_THAT( - Utils::SmallStringView(index.sqlStatement()), - Eq("CREATE INDEX IF NOT EXISTS index_testTable_name_value ON testTable(name, value)")); + ASSERT_THAT(Utils::SmallStringView(index.sqlStatement()), + Eq("CREATE INDEX IF NOT EXISTS index_normal_testTable_name_value ON " + "testTable(name, value)")); } TEST_F(SqliteTable, initialize_table) @@ -92,10 +92,11 @@ TEST_F(SqliteTable, initialize_table_with_index) EXPECT_CALL(databaseMock, execute(Eq("CREATE TABLE testTable(name, value)"))); EXPECT_CALL(databaseMock, - execute(Eq("CREATE INDEX IF NOT EXISTS index_testTable_name ON testTable(name)"))); + execute(Eq( + "CREATE INDEX IF NOT EXISTS index_normal_testTable_name ON testTable(name)"))); EXPECT_CALL(databaseMock, - execute(Eq("CREATE INDEX IF NOT EXISTS index_testTable_value ON testTable(value) " - "WHERE value IS NOT NULL"))); + execute(Eq("CREATE INDEX IF NOT EXISTS index_partial_testTable_value ON " + "testTable(value) WHERE value IS NOT NULL"))); table.initialize(databaseMock); } @@ -110,13 +111,13 @@ TEST_F(SqliteTable, initialize_table_with_unique_index) table.addUniqueIndex({column2}, "value IS NOT NULL"); EXPECT_CALL(databaseMock, execute(Eq("CREATE TABLE testTable(name, value)"))); + EXPECT_CALL( + databaseMock, + execute(Eq( + "CREATE UNIQUE INDEX IF NOT EXISTS index_unique_testTable_name ON testTable(name)"))); EXPECT_CALL(databaseMock, - execute(Eq( - "CREATE UNIQUE INDEX IF NOT EXISTS index_testTable_name ON testTable(name)"))); - EXPECT_CALL(databaseMock, - execute(Eq( - "CREATE UNIQUE INDEX IF NOT EXISTS index_testTable_value ON testTable(value) " - "WHERE value IS NOT NULL"))); + execute(Eq("CREATE UNIQUE INDEX IF NOT EXISTS index_unique_partial_testTable_value " + "ON testTable(value) WHERE value IS NOT NULL"))); table.initialize(databaseMock); } @@ -351,8 +352,8 @@ TEST_F(StrictSqliteTable, add_index) auto index = table.addIndex({column, column2}); ASSERT_THAT(Utils::SmallStringView(index.sqlStatement()), - Eq("CREATE INDEX IF NOT EXISTS index_testTable_name_value ON testTable(name, " - "value)")); + Eq("CREATE INDEX IF NOT EXISTS index_normal_testTable_name_value ON " + "testTable(name, value)")); } TEST_F(StrictSqliteTable, initialize_table) @@ -382,10 +383,11 @@ TEST_F(StrictSqliteTable, initialize_table_with_index) EXPECT_CALL(databaseMock, execute(Eq("CREATE TABLE testTable(name ANY, value ANY) STRICT"))); EXPECT_CALL(databaseMock, - execute(Eq("CREATE INDEX IF NOT EXISTS index_testTable_name ON testTable(name)"))); + execute(Eq( + "CREATE INDEX IF NOT EXISTS index_normal_testTable_name ON testTable(name)"))); EXPECT_CALL(databaseMock, - execute(Eq("CREATE INDEX IF NOT EXISTS index_testTable_value ON testTable(value) " - "WHERE value IS NOT NULL"))); + execute(Eq("CREATE INDEX IF NOT EXISTS index_partial_testTable_value ON " + "testTable(value) WHERE value IS NOT NULL"))); table.initialize(databaseMock); } @@ -400,13 +402,13 @@ TEST_F(StrictSqliteTable, initialize_table_with_unique_index) table.addUniqueIndex({column2}, "value IS NOT NULL"); EXPECT_CALL(databaseMock, execute(Eq("CREATE TABLE testTable(name ANY, value ANY) STRICT"))); + EXPECT_CALL( + databaseMock, + execute(Eq( + "CREATE UNIQUE INDEX IF NOT EXISTS index_unique_testTable_name ON testTable(name)"))); EXPECT_CALL(databaseMock, - execute(Eq( - "CREATE UNIQUE INDEX IF NOT EXISTS index_testTable_name ON testTable(name)"))); - EXPECT_CALL(databaseMock, - execute(Eq( - "CREATE UNIQUE INDEX IF NOT EXISTS index_testTable_value ON testTable(value) " - "WHERE value IS NOT NULL"))); + execute(Eq("CREATE UNIQUE INDEX IF NOT EXISTS index_unique_partial_testTable_value " + "ON testTable(value) WHERE value IS NOT NULL"))); table.initialize(databaseMock); } -- cgit v1.2.3 From 4e5a0cd02b83f0ea2c7b6066ecb3465488b923de Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 27 Mar 2024 17:07:10 +0100 Subject: QmlDesigner: Improve performance of prototype walk The optimizer took quite often the slow join first. So now we have one method to walk the prototype chain and then use the type ids in simpler statements to get the end result. Task-number: QTCREATORBUG-30599 Change-Id: I3e9d4ec85ba75801769eb8760fda6e0400300899 Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- tests/unit/tests/mocks/projectstoragemock.cpp | 22 +++++++------ tests/unit/tests/mocks/projectstoragemock.h | 37 ++++++++++++---------- .../propertyeditorcomponentgenerator-test.cpp | 2 +- tests/unit/tests/unittests/model/model-test.cpp | 16 +++++++--- 4 files changed, 45 insertions(+), 32 deletions(-) (limited to 'tests') diff --git a/tests/unit/tests/mocks/projectstoragemock.cpp b/tests/unit/tests/mocks/projectstoragemock.cpp index 83ff85fe9a3..27e5c152d21 100644 --- a/tests/unit/tests/mocks/projectstoragemock.cpp +++ b/tests/unit/tests/mocks/projectstoragemock.cpp @@ -227,7 +227,9 @@ void ProjectStorageMock::setItemLibraryEntries( } namespace { -void addBaseProperties(TypeId typeId, TypeIds baseTypeIds, ProjectStorageMock &storage) +void addBaseProperties(TypeId typeId, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds, + ProjectStorageMock &storage) { for (TypeId baseTypeId : baseTypeIds) { for (const auto &propertyId : storage.localPropertyDeclarationIds(baseTypeId)) { @@ -254,7 +256,7 @@ TypeId ProjectStorageMock::createType(ModuleId moduleId, PropertyDeclarationTraits defaultPropertyTraits, TypeId defaultPropertyTypeId, Storage::TypeTraits typeTraits, - TypeIds baseTypeIds, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds, SourceId sourceId) { if (auto id = typeId(moduleId, typeName)) { @@ -290,10 +292,9 @@ TypeId ProjectStorageMock::createType(ModuleId moduleId, for (TypeId baseTypeId : baseTypeIds) ON_CALL(*this, isBasedOn(Eq(typeId), Eq(baseTypeId))).WillByDefault(Return(true)); - TypeIds selfAndPrototypes; - selfAndPrototypes.reserve(baseTypeIds.size() + 1); + QmlDesigner::SmallTypeIds<16> selfAndPrototypes; selfAndPrototypes.push_back(typeId); - selfAndPrototypes.insert(selfAndPrototypes.end(), baseTypeIds.begin(), baseTypeIds.end()); + std::copy(baseTypeIds.begin(), baseTypeIds.end(), std::back_inserter(selfAndPrototypes)); ON_CALL(*this, prototypeAndSelfIds(Eq(typeId))).WillByDefault(Return(selfAndPrototypes)); ON_CALL(*this, prototypeIds(Eq(typeId))).WillByDefault(Return(baseTypeIds)); @@ -314,7 +315,7 @@ void ProjectStorageMock::removeType(QmlDesigner::ModuleId moduleId, Utils::Small QmlDesigner::TypeId ProjectStorageMock::createType(QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName, QmlDesigner::Storage::TypeTraits typeTraits, - QmlDesigner::TypeIds baseTypeIds, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds, SourceId sourceId) { return createType(moduleId, typeName, {}, {}, TypeId{}, typeTraits, baseTypeIds, sourceId); @@ -325,7 +326,7 @@ TypeId ProjectStorageMock::createObject(ModuleId moduleId, Utils::SmallStringView defaultPropertyName, PropertyDeclarationTraits defaultPropertyTraits, QmlDesigner::TypeId defaultPropertyTypeId, - TypeIds baseTypeIds, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds, QmlDesigner::SourceId sourceId) { return createType(moduleId, @@ -340,19 +341,20 @@ TypeId ProjectStorageMock::createObject(ModuleId moduleId, TypeId ProjectStorageMock::createObject(ModuleId moduleId, Utils::SmallStringView typeName, - TypeIds baseTypeIds) + const QmlDesigner::SmallTypeIds<16> &baseTypeIds) { return createType(moduleId, typeName, Storage::TypeTraitsKind::Reference, baseTypeIds); } QmlDesigner::TypeId ProjectStorageMock::createValue(QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName, - QmlDesigner::TypeIds baseTypeIds) + const QmlDesigner::SmallTypeIds<16> &baseTypeIds) { return createType(moduleId, typeName, Storage::TypeTraitsKind::Value, baseTypeIds); } -void ProjectStorageMock::setHeirs(QmlDesigner::TypeId typeId, QmlDesigner::TypeIds heirIds) +void ProjectStorageMock::setHeirs(QmlDesigner::TypeId typeId, + const QmlDesigner::SmallTypeIds<64> &heirIds) { ON_CALL(*this, heirIds(typeId)).WillByDefault(Return(heirIds)); } diff --git a/tests/unit/tests/mocks/projectstoragemock.h b/tests/unit/tests/mocks/projectstoragemock.h index 198e54b370b..ed370bde96f 100644 --- a/tests/unit/tests/mocks/projectstoragemock.h +++ b/tests/unit/tests/mocks/projectstoragemock.h @@ -56,7 +56,7 @@ public: QmlDesigner::Storage::PropertyDeclarationTraits defaultPropertyTraits, QmlDesigner::TypeId defaultPropertyTypeId, QmlDesigner::Storage::TypeTraits typeTraits, - QmlDesigner::TypeIds baseTypeIds = {}, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds = {}, QmlDesigner::SourceId sourceId = QmlDesigner::SourceId{}); void removeType(QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName); @@ -64,27 +64,26 @@ public: QmlDesigner::TypeId createType(QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName, QmlDesigner::Storage::TypeTraits typeTraits, - QmlDesigner::TypeIds baseTypeIds = {}, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds = {}, QmlDesigner::SourceId sourceId = QmlDesigner::SourceId{}); - QmlDesigner::TypeId createObject( - QmlDesigner::ModuleId moduleId, - Utils::SmallStringView typeName, - Utils::SmallStringView defaultPropertyName, - QmlDesigner::Storage::PropertyDeclarationTraits defaultPropertyTraits, - QmlDesigner::TypeId defaultPropertyTypeId, - QmlDesigner::TypeIds baseTypeIds = {}, - QmlDesigner::SourceId sourceId = QmlDesigner::SourceId{}); + QmlDesigner::TypeId createObject(QmlDesigner::ModuleId moduleId, + Utils::SmallStringView typeName, + Utils::SmallStringView defaultPropertyName, + QmlDesigner::Storage::PropertyDeclarationTraits defaultPropertyTraits, + QmlDesigner::TypeId defaultPropertyTypeId, + const QmlDesigner::SmallTypeIds<16> &baseTypeIds = {}, + QmlDesigner::SourceId sourceId = QmlDesigner::SourceId{}); QmlDesigner::TypeId createObject(QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName, - QmlDesigner::TypeIds baseTypeIds = {}); + const QmlDesigner::SmallTypeIds<16> &baseTypeIds = {}); QmlDesigner::TypeId createValue(QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName, - QmlDesigner::TypeIds baseTypeIds = {}); + const QmlDesigner::SmallTypeIds<16> &baseTypeIds = {}); - void setHeirs(QmlDesigner::TypeId typeId, QmlDesigner::TypeIds heirIds); + void setHeirs(QmlDesigner::TypeId typeId, const QmlDesigner::SmallTypeIds<64> &heirIds); QmlDesigner::PropertyDeclarationId createProperty( QmlDesigner::TypeId typeId, @@ -215,9 +214,15 @@ public: propertyName, (QmlDesigner::PropertyDeclarationId propertyDeclarationId), (const, override)); - MOCK_METHOD(QmlDesigner::TypeIds, prototypeAndSelfIds, (QmlDesigner::TypeId type), (const, override)); - MOCK_METHOD(QmlDesigner::TypeIds, prototypeIds, (QmlDesigner::TypeId type), (const, override)); - MOCK_METHOD(QmlDesigner::TypeIds, heirIds, (QmlDesigner::TypeId type), (const, override)); + MOCK_METHOD(QmlDesigner::SmallTypeIds<16>, + prototypeAndSelfIds, + (QmlDesigner::TypeId type), + (const, override)); + MOCK_METHOD(QmlDesigner::SmallTypeIds<16>, + prototypeIds, + (QmlDesigner::TypeId type), + (const, override)); + MOCK_METHOD(QmlDesigner::SmallTypeIds<64>, heirIds, (QmlDesigner::TypeId type), (const, override)); MOCK_METHOD(bool, isBasedOn, (QmlDesigner::TypeId typeId, QmlDesigner::TypeId), (const, override)); MOCK_METHOD(bool, isBasedOn, diff --git a/tests/unit/tests/unittests/componentcore/propertyeditorcomponentgenerator-test.cpp b/tests/unit/tests/unittests/componentcore/propertyeditorcomponentgenerator-test.cpp index 3b9a8bbfe25..d2f2143a737 100644 --- a/tests/unit/tests/unittests/componentcore/propertyeditorcomponentgenerator-test.cpp +++ b/tests/unit/tests/unittests/componentcore/propertyeditorcomponentgenerator-test.cpp @@ -18,7 +18,7 @@ class PropertyEditorComponentGenerator : public ::testing::Test { protected: QmlDesigner::NodeMetaInfo createType(Utils::SmallStringView name, - QmlDesigner::TypeIds baseTypeIds = {}) + const QmlDesigner::SmallTypeIds<16> &baseTypeIds = {}) { auto typeId = projectStorageMock.createValue(qtQuickModuleId, name, baseTypeIds); diff --git a/tests/unit/tests/unittests/model/model-test.cpp b/tests/unit/tests/unittests/model/model-test.cpp index bda942fec0b..bd34a3a6b12 100644 --- a/tests/unit/tests/unittests/model/model-test.cpp +++ b/tests/unit/tests/unittests/model/model-test.cpp @@ -116,11 +116,11 @@ protected: NiceMock pathCacheMock{"/path/foo.qml"}; NiceMock projectStorageMock{pathCacheMock.sourceId}; NiceMock resourceManagementMock; + QmlDesigner::Imports imports = {QmlDesigner::Import::createLibraryImport("QtQuick")}; QmlDesigner::Model model{{projectStorageMock, pathCacheMock}, "Item", - -1, - -1, - nullptr, + imports, + pathCacheMock.path.toQString(), std::make_unique( resourceManagementMock)}; NiceMock viewMock; @@ -541,7 +541,10 @@ TEST_F(Model, by_default_remove_properties_removes_property) TEST_F(Model, by_default_remove_model_node_in_factory_method_calls_removes_node) { model.detachView(&viewMock); - auto newModel = QmlDesigner::Model::create({projectStorageMock, pathCacheMock}, "QtQuick.Item"); + auto newModel = QmlDesigner::Model::create({projectStorageMock, pathCacheMock}, + "Item", + imports, + pathCacheMock.path.toQString()); newModel->attachView(&viewMock); auto node = createNodeWithParent(viewMock.rootModelNode()); @@ -553,7 +556,10 @@ TEST_F(Model, by_default_remove_model_node_in_factory_method_calls_removes_node) TEST_F(Model, by_default_remove_properties_in_factory_method_calls_remove_property) { model.detachView(&viewMock); - auto newModel = QmlDesigner::Model::create({projectStorageMock, pathCacheMock}, "QtQuick.Item"); + auto newModel = QmlDesigner::Model::create({projectStorageMock, pathCacheMock}, + "Item", + imports, + pathCacheMock.path.toQString()); newModel->attachView(&viewMock); rootNode = viewMock.rootModelNode(); auto property = createProperty(rootNode, "yi"); -- cgit v1.2.3 From 4f3bf836a9739f5abd69b551814e0597561655c0 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 9 Apr 2024 15:20:24 +0200 Subject: QmlDesigner: Remove ScopeChain dependency for QDS_USE_PROJECTSTORAGE * possibleImports() and usedImports() has to be implemented for the project storage * getQMLSingletons() is not implemented for project storage and also does not belong into the rewriter. * semantic errors are fully disabled for QDS_USE_PROJECTSTORAGE, since they require the scope chain. Change-Id: I200ccbc1faf2631c4764a4676553a69cc0f5cf1f Reviewed-by: Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Marco Bubke --- tests/unit/tests/stubs/qmldesigner/designercore/include/rewriterview.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/tests/stubs/qmldesigner/designercore/include/rewriterview.h b/tests/unit/tests/stubs/qmldesigner/designercore/include/rewriterview.h index a10da0133c8..4c59440b0f8 100644 --- a/tests/unit/tests/stubs/qmldesigner/designercore/include/rewriterview.h +++ b/tests/unit/tests/stubs/qmldesigner/designercore/include/rewriterview.h @@ -128,8 +128,6 @@ public: void setCheckSemanticErrors(bool) {} - QString pathForImport(const Import &) { return {}; } - QStringList importDirectories() const { return {}; } QSet> qrcMapping() const { return {}; } -- cgit v1.2.3 From db84bc43a9086e1ebc2662f7f04a03ab1aed82ca Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 11 Apr 2024 18:13:10 +0200 Subject: QmlDesigner: Improve node creation with project storage The file url was missing, so no valid source id could be created. That lead to invalid imports. The qualified path for the node instances is now created in the node instance view. Change-Id: I2685ab2fdbdb0fa8a5f89793be52c8fae2b8db8c Reviewed-by: Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- tests/unit/tests/mocks/projectstoragemock.cpp | 13 +++++++++++++ tests/unit/tests/mocks/projectstoragemock.h | 8 ++++++++ tests/unit/tests/unittests/model/modelutils-test.cpp | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit/tests/mocks/projectstoragemock.cpp b/tests/unit/tests/mocks/projectstoragemock.cpp index 27e5c152d21..48357ff3e63 100644 --- a/tests/unit/tests/mocks/projectstoragemock.cpp +++ b/tests/unit/tests/mocks/projectstoragemock.cpp @@ -51,6 +51,7 @@ ModuleId ProjectStorageMock::createModule(Utils::SmallStringView moduleName) incrementBasicId(moduleId); ON_CALL(*this, moduleId(Eq(moduleName))).WillByDefault(Return(moduleId)); + ON_CALL(*this, moduleName(Eq(moduleId))).WillByDefault(Return(moduleName)); ON_CALL(*this, fetchModuleIdUnguarded(Eq(moduleName))).WillByDefault(Return(moduleId)); return moduleId; @@ -122,6 +123,14 @@ void ProjectStorageMock::addExportedTypeName(QmlDesigner::TypeId typeId, exportedTypeName[typeId].emplace_back(moduleId, typeName); } +void ProjectStorageMock::addExportedTypeNameBySourceId(QmlDesigner::TypeId typeId, + QmlDesigner::ModuleId moduleId, + Utils::SmallStringView typeName, + QmlDesigner::SourceId sourceId) +{ + exportedTypeNameBySourceId[{typeId, sourceId}].emplace_back(moduleId, typeName); +} + void ProjectStorageMock::removeExportedTypeName(QmlDesigner::TypeId typeId, QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName) @@ -364,6 +373,10 @@ ProjectStorageMock::ProjectStorageMock() ON_CALL(*this, exportedTypeNames(_)).WillByDefault([&](TypeId id) { return exportedTypeName[id]; }); + + ON_CALL(*this, exportedTypeNames(_, _)).WillByDefault([&](TypeId typeId, SourceId sourceId) { + return exportedTypeNameBySourceId[{typeId, sourceId}]; + }); } void ProjectStorageMock::setupQtQuick() diff --git a/tests/unit/tests/mocks/projectstoragemock.h b/tests/unit/tests/mocks/projectstoragemock.h index ed370bde96f..a68e37c2a15 100644 --- a/tests/unit/tests/mocks/projectstoragemock.h +++ b/tests/unit/tests/mocks/projectstoragemock.h @@ -46,6 +46,11 @@ public: QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName); + void addExportedTypeNameBySourceId(QmlDesigner::TypeId typeId, + QmlDesigner::ModuleId moduleId, + Utils::SmallStringView typeName, + QmlDesigner::SourceId sourceId); + void removeExportedTypeName(QmlDesigner::TypeId typeId, QmlDesigner::ModuleId moduleId, Utils::SmallStringView typeName); @@ -122,6 +127,7 @@ public: MOCK_METHOD(void, removeObserver, (QmlDesigner::ProjectStorageObserver *), (override)); MOCK_METHOD(QmlDesigner::ModuleId, moduleId, (::Utils::SmallStringView), (const, override)); + MOCK_METHOD(Utils::SmallString, moduleName, (QmlDesigner::ModuleId), (const, override)); MOCK_METHOD(std::optional, propertyDeclaration, @@ -331,6 +337,8 @@ public: QmlDesigner::Storage::Info::CommonTypeCache typeCache{*this}; std::map exportedTypeName; + std::map, QmlDesigner::Storage::Info::ExportedTypeNames> + exportedTypeNameBySourceId; }; class ProjectStorageMockWithQtQtuick : public ProjectStorageMock diff --git a/tests/unit/tests/unittests/model/modelutils-test.cpp b/tests/unit/tests/unittests/model/modelutils-test.cpp index c7a70cfbdb3..5a9e63b60da 100644 --- a/tests/unit/tests/unittests/model/modelutils-test.cpp +++ b/tests/unit/tests/unittests/model/modelutils-test.cpp @@ -141,7 +141,7 @@ TEST_F(ModelUtils, find_lowest_common_ancestor_when_one_of_the_nodes_is_parent) ASSERT_THAT(commonAncestor, parentNode); } -TEST_F(ModelUtils, lowest_common_ancestor_for_uncle_and_nephew_should_return_the_grandFather) +TEST_F(ModelUtils, lowest_common_ancestor_for_uncle_and_nephew_should_return_the_grandfather) { auto grandFatherNode = model.createModelNode("Item"); auto fatherNode = model.createModelNode("Item"); -- cgit v1.2.3 From afd1b3b6e95728f6bc1df76d647979a904234c23 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 3 Apr 2024 12:10:16 +0200 Subject: QmlDesigner: Lookup the default property in prototypes too The default property can be set too in any prototypes. Look them up there too. Because it is expensive we cache them in the node meta info to make hasDefaultProperty() followed by defaultProperty() cheaper. Change-Id: I3b9ec90fc1bc5f0228dad3b580c335734f03821d Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- tests/unit/tests/mocks/projectstoragemock.cpp | 6 +- tests/unit/tests/mocks/projectstoragemock.h | 4 ++ .../unit/tests/printers/gtest-creator-printing.cpp | 2 +- .../unittests/model/nodelistproperty-test.cpp | 4 +- .../projectstorage/projectstorage-test.cpp | 64 +++++++++++++++++++--- 5 files changed, 67 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/unit/tests/mocks/projectstoragemock.cpp b/tests/unit/tests/mocks/projectstoragemock.cpp index 48357ff3e63..6d5304879e6 100644 --- a/tests/unit/tests/mocks/projectstoragemock.cpp +++ b/tests/unit/tests/mocks/projectstoragemock.cpp @@ -293,8 +293,10 @@ TypeId ProjectStorageMock::createType(ModuleId moduleId, defaultPropertyTypeId); } - ON_CALL(*this, type(Eq(typeId))) - .WillByDefault(Return(Storage::Info::Type{defaultPropertyDeclarationId, sourceId, typeTraits})); + ON_CALL(*this, type(Eq(typeId))).WillByDefault(Return(Storage::Info::Type{sourceId, typeTraits})); + + ON_CALL(*this, defaultPropertyDeclarationId(Eq(typeId))) + .WillByDefault(Return(defaultPropertyDeclarationId)); ON_CALL(*this, isBasedOn(Eq(typeId), Eq(typeId))).WillByDefault(Return(true)); diff --git a/tests/unit/tests/mocks/projectstoragemock.h b/tests/unit/tests/mocks/projectstoragemock.h index a68e37c2a15..b534814c1d3 100644 --- a/tests/unit/tests/mocks/projectstoragemock.h +++ b/tests/unit/tests/mocks/projectstoragemock.h @@ -187,6 +187,10 @@ public: propertyDeclarationId, (QmlDesigner::TypeId typeId, ::Utils::SmallStringView propertyName), (const, override)); + MOCK_METHOD(QmlDesigner::PropertyDeclarationId, + defaultPropertyDeclarationId, + (QmlDesigner::TypeId typeId), + (const, override)); MOCK_METHOD(std::optional, type, (QmlDesigner::TypeId typeId), diff --git a/tests/unit/tests/printers/gtest-creator-printing.cpp b/tests/unit/tests/printers/gtest-creator-printing.cpp index 1bff6df492c..40f9c8db6da 100644 --- a/tests/unit/tests/printers/gtest-creator-printing.cpp +++ b/tests/unit/tests/printers/gtest-creator-printing.cpp @@ -675,7 +675,7 @@ std::ostream &operator<<(std::ostream &out, const PropertyDeclaration &propertyD std::ostream &operator<<(std::ostream &out, const Type &type) { - return out << "(" << type.defaultPropertyId << ")"; + return out << "(" << type.sourceId << ")"; } std::ostream &operator<<(std::ostream &out, const ExportedTypeName &name) diff --git a/tests/unit/tests/unittests/model/nodelistproperty-test.cpp b/tests/unit/tests/unittests/model/nodelistproperty-test.cpp index 6783bde3e75..aac2e729a29 100644 --- a/tests/unit/tests/unittests/model/nodelistproperty-test.cpp +++ b/tests/unit/tests/unittests/model/nodelistproperty-test.cpp @@ -61,8 +61,8 @@ protected: ++defaultPropertyIdNumber); ON_CALL(projectStorageMock, typeId(Eq(moduleId), Eq(typeName), _)).WillByDefault(Return(typeId)); - ON_CALL(projectStorageMock, type(Eq(typeId))) - .WillByDefault(Return(Info::Type{defaultPropertyId, QmlDesigner::SourceId{}, {}})); + ON_CALL(projectStorageMock, defaultPropertyDeclarationId(Eq(typeId))) + .WillByDefault(Return(defaultPropertyId)); ON_CALL(projectStorageMock, propertyName(Eq(defaultPropertyId))) .WillByDefault(Return(defaultPeopertyName)); } diff --git a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp index 4b3f0a18692..125e8df3aeb 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp @@ -253,17 +253,15 @@ MATCHER(StringsAreSorted, std::string(negation ? "isn't sorted" : "is sorted")) }); } -MATCHER_P3(IsInfoType, - defaultPropertyId, +MATCHER_P2(IsInfoType, sourceId, traits, std::string(negation ? "isn't " : "is ") - + PrintToString(Storage::Info::Type{defaultPropertyId, sourceId, traits})) + + PrintToString(Storage::Info::Type{sourceId, traits})) { const Storage::Info::Type &type = arg; - return type.defaultPropertyId == defaultPropertyId && type.sourceId == sourceId - && type.traits == traits; + return type.sourceId == sourceId && type.traits == traits; } class ProjectStorage : public testing::Test @@ -6683,12 +6681,10 @@ TEST_F(ProjectStorage, get_type) auto package{createSimpleSynchronizationPackage()}; storage.synchronize(package); auto typeId = fetchTypeId(sourceId1, "QQuickItem"); - auto defaultPropertyName = storage.fetchTypeByTypeId(typeId).defaultPropertyName; - auto defaultPropertyId = storage.propertyDeclarationId(typeId, defaultPropertyName); auto type = storage.type(typeId); - ASSERT_THAT(type, Optional(IsInfoType(defaultPropertyId, sourceId1, TypeTraitsKind::Reference))); + ASSERT_THAT(type, Optional(IsInfoType(sourceId1, TypeTraitsKind::Reference))); } TEST_F(ProjectStorage, dont_get_type_for_invalid_id) @@ -6701,6 +6697,58 @@ TEST_F(ProjectStorage, dont_get_type_for_invalid_id) ASSERT_THAT(type, Eq(std::nullopt)); } +TEST_F(ProjectStorage, get_default_property_declarartion_id) +{ + auto package{createSimpleSynchronizationPackage()}; + storage.synchronize(package); + auto typeId = fetchTypeId(sourceId1, "QQuickItem"); + auto defaultPropertyName = storage.fetchTypeByTypeId(typeId).defaultPropertyName; + auto defaultPropertyId = storage.propertyDeclarationId(typeId, defaultPropertyName); + + auto propertyId = storage.defaultPropertyDeclarationId(typeId); + + ASSERT_THAT(propertyId, defaultPropertyId); +} + +TEST_F(ProjectStorage, get_default_property_declarartion_id_in_base_type) +{ + auto package{createSynchronizationPackageWithAliases()}; + storage.synchronize(package); + auto baseTypeId = fetchTypeId(sourceId1, "QQuickItem"); + auto defaultPropertyName = storage.fetchTypeByTypeId(baseTypeId).defaultPropertyName; + auto defaultPropertyId = storage.propertyDeclarationId(baseTypeId, defaultPropertyName); + auto typeId = fetchTypeId(sourceId3, "QAliasItem"); + + auto propertyId = storage.defaultPropertyDeclarationId(typeId); + + ASSERT_THAT(propertyId, defaultPropertyId); +} + +TEST_F(ProjectStorage, do_not_get_default_property_declarartion_id_wrong_type_in_property_chain) +{ + auto package{createSynchronizationPackageWithAliases()}; + package.types[1].defaultPropertyName = "objects"; + storage.synchronize(package); + auto baseTypeId = fetchTypeId(sourceId1, "QQuickItem"); + auto defaultPropertyName = storage.fetchTypeByTypeId(baseTypeId).defaultPropertyName; + auto defaultPropertyId = storage.propertyDeclarationId(baseTypeId, defaultPropertyName); + auto typeId = fetchTypeId(sourceId3, "QAliasItem"); + + auto propertyId = storage.defaultPropertyDeclarationId(typeId); + + ASSERT_THAT(propertyId, defaultPropertyId); +} + +TEST_F(ProjectStorage, get_invalid_default_property_declarartion_id_for_invalid_type) +{ + auto package{createSimpleSynchronizationPackage()}; + storage.synchronize(package); + + auto propertyId = storage.defaultPropertyDeclarationId(TypeId()); + + ASSERT_FALSE(propertyId); +} + TEST_F(ProjectStorage, get_common_type) { auto package{createSimpleSynchronizationPackage()}; -- cgit v1.2.3 From 665d043e7244028ef766c3baf889179a793b2619 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 3 Apr 2024 12:48:37 +0200 Subject: QmlDesigner: Extract default property in qmltypes parser Change-Id: I0cc9ac71ba764db252e302d11d1cd3e4aff834f5 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Thomas Hartmann --- .../tests/unittests/projectstorage/qmltypesparser-test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp index 78f8f41d6c4..a6b85404364 100644 --- a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp @@ -838,4 +838,17 @@ TEST_F(QmlTypesParser, uses_no_custom_parser) ASSERT_THAT(types, ElementsAre(IsTypeTrait(UsesCustomParser(false)))); } +TEST_F(QmlTypesParser, default_property) +{ + QString source{R"(import QtQuick.tooling 1.2 + Module{ + Component { name: "QObject" + defaultProperty: "children" }})"}; + + parser.parse(source, imports, types, projectData); + + ASSERT_THAT(types, + ElementsAre(Field(&Synchronization::Type::defaultPropertyName, Eq("children")))); +} + } // namespace -- cgit v1.2.3 From 316d88bd1280693a9d1b16e4844819394a0292a6 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 3 Apr 2024 12:52:14 +0200 Subject: QmlDesigner: Extract default property in qml document parser Change-Id: I2b3576312cc2bec0c2e103fd3f342a5fe059b10c Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- .../unittests/projectstorage/qmldocumentparser-test.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp b/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp index f39dec121c6..affa645330e 100644 --- a/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp @@ -516,4 +516,16 @@ TEST_F(QmlDocumentParser, qualified_list_property) Storage::PropertyDeclarationTraits::IsList))); } +TEST_F(QmlDocumentParser, default_property) +{ + auto type = parser.parse(R"(import Example 2.1 as Example + Item{ + default property list foos + })", + imports, + qmlFileSourceId, + directoryPath); + + ASSERT_THAT(type.defaultPropertyName, Eq("foos")); +} } // namespace -- cgit v1.2.3 From b01522f102dea1d37a5f8cfd1d60db7e1e0e68a6 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 9 Apr 2024 19:11:21 +0200 Subject: QmlDesigner: Skip QQuickItem in QtQuick.Templates Otherwise we have to QQuickItem meta info objects and that creates bugs. Fixes: QDS-12460 Change-Id: Iaf76df6671c4ca73913285b78bf1d6408fbe93be Reviewed-by: Fabian Kosmale Reviewed-by: Reviewed-by: Qt CI Patch Build Bot --- .../projectstorage/qmltypesparser-test.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp index a6b85404364..a42a560d07d 100644 --- a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp @@ -851,4 +851,26 @@ TEST_F(QmlTypesParser, default_property) ElementsAre(Field(&Synchronization::Type::defaultPropertyName, Eq("children")))); } +TEST_F(QmlTypesParser, skip_template_item) +{ + ModuleId moduleId = storage.moduleId("QtQuick.Templates-cppnative"); + Synchronization::ProjectData projectData{qmltypesFileSourceId, + qmltypesFileSourceId, + moduleId, + Synchronization::FileType::QmlTypes}; + QString source{R"(import QtQuick.tooling 1.2 + Module{ + Component { name: "QQuickItem"} + Component { name: "QQmlComponent"}})"}; + + parser.parse(source, imports, types, projectData); + + ASSERT_THAT(types, + UnorderedElementsAre(IsType("QQmlComponent", + Synchronization::ImportedType{}, + Synchronization::ImportedType{}, + Storage::TypeTraitsKind::Reference, + qmltypesFileSourceId))); +} + } // namespace -- cgit v1.2.3 From e262ec1ebbb51402fdd8583e51f131ee5f04e3a6 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 3 Apr 2024 16:38:23 +0200 Subject: QmlDesigner: Integrate item library entries from project storage Task-number: QDS-12102 Change-Id: Id6fbfcfb44d3b8c290f5e5d74addf33ef4d9a5e5 Reviewed-by: Thomas Hartmann Reviewed-by: Qt CI Patch Build Bot --- tests/unit/tests/matchers/projectstorage-matcher.h | 21 + tests/unit/tests/matchers/unittest-matchers.h | 68 ++ tests/unit/tests/mocks/projectstoragemock.h | 5 + .../unit/tests/printers/gtest-creator-printing.cpp | 5 +- .../Controls/designer/qtquickcontrols2.metainfo | 575 ++++++++++++++ .../AssetUtils/designer/assetutils.metainfo | 21 + .../QtQuick3D/Effects/designer/effectlib.metainfo | 401 ++++++++++ .../QtQuick3D/Helpers/designer/helpers.metainfo | 261 +++++++ .../designer/particleeffects.metainfo | 246 ++++++ .../Particles3D/designer/particles3d.metainfo | 562 ++++++++++++++ .../QtQuick3D/Physics/designer/physics.metainfo | 261 +++++++ .../data/qml/QtQuick3D/designer/quick3d.metainfo | 861 +++++++++++++++++++++ .../projectstorage/projectstorage-test.cpp | 182 ++++- .../projectstorage/projectstorageupdater-test.cpp | 271 +++++-- .../projectstorage/typeannotationreader-test.cpp | 100 +-- .../tests/unittests/utils/smallstring-test.cpp | 13 + 16 files changed, 3731 insertions(+), 122 deletions(-) create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick/Controls/designer/qtquickcontrols2.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/AssetUtils/designer/assetutils.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Effects/designer/effectlib.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Helpers/designer/helpers.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/ParticleEffects/designer/particleeffects.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Particles3D/designer/particles3d.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/designer/physics.metainfo create mode 100644 tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/designer/quick3d.metainfo (limited to 'tests') diff --git a/tests/unit/tests/matchers/projectstorage-matcher.h b/tests/unit/tests/matchers/projectstorage-matcher.h index 5ce6512c14e..02861d7eea3 100644 --- a/tests/unit/tests/matchers/projectstorage-matcher.h +++ b/tests/unit/tests/matchers/projectstorage-matcher.h @@ -53,3 +53,24 @@ MATCHER_P3(IsItemLibraryProperty, return property.name == name && property.type == type && property.value == value; } + +template +auto IsTypeAnnotation(QmlDesigner::SourceId sourceId, + QmlDesigner::SourceId directorySourceId, + Utils::SmallStringView typeName, + QmlDesigner::ModuleId moduleId, + IconPathMatcher iconPath, + TypeTraitsMatcher traits, + HintsJsonMatcher hintsJsonMatcher, + ItemLibraryJsonMatcher itemLibraryJsonMatcher) +{ + using QmlDesigner::Storage::Synchronization::TypeAnnotation; + return AllOf(Field("sourceId", &TypeAnnotation::sourceId, sourceId), + Field("sourceId", &TypeAnnotation::directorySourceId, directorySourceId), + Field("typeName", &TypeAnnotation::typeName, typeName), + Field("moduleId", &TypeAnnotation::moduleId, moduleId), + Field("iconPath", &TypeAnnotation::iconPath, iconPath), + Field("traits", &TypeAnnotation::traits, traits), + Field("hintsJson", &TypeAnnotation::hintsJson, hintsJsonMatcher), + Field("itemLibraryJson", &TypeAnnotation::itemLibraryJson, itemLibraryJsonMatcher)); +} diff --git a/tests/unit/tests/matchers/unittest-matchers.h b/tests/unit/tests/matchers/unittest-matchers.h index 7c52d973b88..faa99a48a2f 100644 --- a/tests/unit/tests/matchers/unittest-matchers.h +++ b/tests/unit/tests/matchers/unittest-matchers.h @@ -95,6 +95,64 @@ private: const QString m_suffix; }; +template +class StartsWithMatcher +{ +public: + explicit StartsWithMatcher(const StringType &prefix) + : m_prefix(prefix) + {} + + template + bool MatchAndExplain(CharType *s, testing::MatchResultListener *listener) const + { + return s != NULL && MatchAndExplain(StringType(s), listener); + } + + template + bool MatchAndExplain(const MatcheeStringType &s, testing::MatchResultListener * /* listener */) const + { + return s.startsWith(m_prefix); + } + + void DescribeTo(::std::ostream *os) const { *os << "ends with " << m_prefix; } + + void DescribeNegationTo(::std::ostream *os) const { *os << "doesn't end with " << m_prefix; } + + StartsWithMatcher(const StartsWithMatcher &) = default; + StartsWithMatcher &operator=(const StartsWithMatcher &) = delete; + +private: + const StringType m_prefix; +}; + +class QStringStartsWithMatcher +{ +public: + explicit QStringStartsWithMatcher(const QString &prefix) + : m_prefix(prefix) + {} + + template + bool MatchAndExplain(const MatcheeStringType &s, testing::MatchResultListener * /* listener */) const + { + return s.startsWith(m_prefix); + } + + void DescribeTo(::std::ostream *os) const + { + *os << "ends with " << testing::PrintToString(m_prefix); + } + + void DescribeNegationTo(::std::ostream *os) const + { + *os << "doesn't end with " << testing::PrintToString(m_prefix); + } + +private: + const QString m_prefix; +}; + class IsEmptyMatcher { public: @@ -157,6 +215,16 @@ inline auto EndsWith(const QStringView &suffix) return ::testing::PolymorphicMatcher(Internal::QStringEndsWithMatcher(suffix.toString())); } +inline auto StartsWith(const Utils::SmallStringView &prefix) +{ + return ::testing::PolymorphicMatcher(Internal::StartsWithMatcher(prefix)); +} + +inline auto StartsWith(const QStringView &prefix) +{ + return ::testing::PolymorphicMatcher(Internal::QStringStartsWithMatcher(prefix.toString())); +} + inline auto IsEmpty() { return ::testing::PolymorphicMatcher(Internal::IsEmptyMatcher()); diff --git a/tests/unit/tests/mocks/projectstoragemock.h b/tests/unit/tests/mocks/projectstoragemock.h index b534814c1d3..8aa5979ddbe 100644 --- a/tests/unit/tests/mocks/projectstoragemock.h +++ b/tests/unit/tests/mocks/projectstoragemock.h @@ -195,6 +195,11 @@ public: type, (QmlDesigner::TypeId typeId), (const, override)); + MOCK_METHOD(QmlDesigner::SmallSourceIds<4>, + typeAnnotationSourceIds, + (QmlDesigner::SourceId directoryId), + (const, override)); + MOCK_METHOD(QmlDesigner::SmallSourceIds<64>, typeAnnotationDirectorySourceIds, (), (const, override)); MOCK_METHOD(Utils::PathString, typeIconPath, (QmlDesigner::TypeId typeId), (const, override)); MOCK_METHOD(QmlDesigner::Storage::Info::TypeHints, typeHints, diff --git a/tests/unit/tests/printers/gtest-creator-printing.cpp b/tests/unit/tests/printers/gtest-creator-printing.cpp index 40f9c8db6da..6bc78e99367 100644 --- a/tests/unit/tests/printers/gtest-creator-printing.cpp +++ b/tests/unit/tests/printers/gtest-creator-printing.cpp @@ -795,7 +795,10 @@ std::ostream &operator<<(std::ostream &out, const SynchronizationPackage &packag << ", projectDatas: " << package.projectDatas << ", propertyEditorQmlPaths: " << package.propertyEditorQmlPaths << ", updatedPropertyEditorQmlPathSourceIds: " - << package.updatedPropertyEditorQmlPathSourceIds << ")"; + << package.updatedPropertyEditorQmlPathSourceIds + << ", typeAnnotations: " << package.typeAnnotations + << ", updatedTypeAnnotationSourceIds: " << package.updatedTypeAnnotationSourceIds + << ")"; } std::ostream &operator<<(std::ostream &out, const ProjectData &data) diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick/Controls/designer/qtquickcontrols2.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick/Controls/designer/qtquickcontrols2.metainfo new file mode 100644 index 00000000000..0cd3959cf8a --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick/Controls/designer/qtquickcontrols2.metainfo @@ -0,0 +1,575 @@ +MetaInfo { + Type { + name: "QtQuick.Controls.BusyIndicator" + icon: "images/busyindicator-icon16.png" + + ItemLibraryEntry { + name: "Busy Indicator" + category: "Qt Quick - Controls 2" + libraryIcon: "images/busyindicator-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Indicates activity while, for example, content is being loaded.") + } + } + + Type { + name: "QtQuick.Controls.Button" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "Button" + category: "Qt Quick - Controls 2" + libraryIcon: "images/button-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Button\")" } + } + } + + Type { + name: "QtQuick.Controls.CheckBox" + icon: "images/checkbox-icon16.png" + + ItemLibraryEntry { + name: "Check Box" + category: "Qt Quick - Controls 2" + libraryIcon: "images/checkbox-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A checkbox with a text label.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Check Box\")" } + } + } + + Type { + name: "QtQuick.Controls.CheckDelegate" + icon: "images/checkbox-icon16.png" + + ItemLibraryEntry { + name: "Check Delegate" + category: "Qt Quick - Controls 2" + libraryIcon: "images/checkbox-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Presents items from a model as checkboxes.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Check Delegate\")" } + } + } + + Type { + name: "QtQuick.Controls.ComboBox" + icon: "images/combobox-icon16.png" + + ItemLibraryEntry { + name: "Combo Box" + category: "Qt Quick - Controls 2" + libraryIcon: "images/combobox-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("An editable drop-down list.") + } + } + + Type { + name: "QtQuick.Controls.Control" + icon: "images/control-icon16.png" + + ItemLibraryEntry { + name: "Control" + category: "Qt Quick - Controls 2" + libraryIcon: "images/control-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("An abstract base type for UI controls.") + } + } + + Type { + name: "QtQuick.Controls.DelayButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "Delay Button" + category: "Qt Quick - Controls 2" + libraryIcon: "images/delaybutton-icon.png" + version: "2.2" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A button with a delay preventing accidental presses.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Delay Button\")" } + } + } + + Type { + name: "QtQuick.Controls.Dial" + icon: "images/dial-icon16.png" + + ItemLibraryEntry { + name: "Dial" + category: "Qt Quick - Controls 2" + libraryIcon: "images/dial-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + + toolTip: qsTr("A circular dial that is rotated to set a value.") + } + } + + Type { + name: "QtQuick.Controls.Frame" + icon: "images/frame-icon16.png" + + ItemLibraryEntry { + name: "Frame" + category: "Qt Quick - Controls 2" + libraryIcon: "images/frame-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("An untitled container for a group of controls.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + } + } + + Type { + name: "QtQuick.Controls.GroupBox" + icon: "images/groupbox-icon16.png" + + ItemLibraryEntry { + name: "Group Box" + category: "Qt Quick - Controls 2" + libraryIcon: "images/groupbox-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A titled container for a group of controls.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + Property { name: "title"; type: "binding"; value: "qsTr(\"Group Box\")" } + } + } + + Type { + name: "QtQuick.Controls.ItemDelegate" + icon: "images/itemdelegate-icon16.png" + + ItemLibraryEntry { + name: "Item Delegate" + category: "Qt Quick - Controls 2" + libraryIcon: "images/itemdelegate-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Presents a standard view item. It can be used as a delegate in various views and controls, such as ListView and ComboBox.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Item Delegate\")" } + } + } + + Type { + name: "QtQuick.Controls.Label" + icon: "images/label-icon16.png" + + ItemLibraryEntry { + name: "Label" + category: "Qt Quick - Controls 2" + libraryIcon: "images/label-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A text label.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Label\")" } + } + } + + Type { + name: "QtQuick.Controls.Page" + icon: "images/page-icon16.png" + + ItemLibraryEntry { + name: "Page" + category: "Qt Quick - Controls 2" + libraryIcon: "images/page-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A page with header and footer.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + } + } + + Type { + name: "QtQuick.Controls.PageIndicator" + icon: "images/pageindicator-icon16.png" + + ItemLibraryEntry { + name: "Page Indicator" + category: "Qt Quick - Controls 2" + libraryIcon: "images/pageindicator-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Indicates the currently active page.") + + Property { name: "count"; type: "int"; value: 3 } + } + } + + Type { + name: "QtQuick.Controls.Pane" + icon: "images/pane-icon16.png" + + ItemLibraryEntry { + name: "Pane" + category: "Qt Quick - Controls 2" + libraryIcon: "images/pane-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Provides a background matching the application style and theme.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + } + } + + Type { + name: "QtQuick.Controls.ProgressBar" + icon: "images/progressbar-icon16.png" + + ItemLibraryEntry { + name: "Progress Bar" + category: "Qt Quick - Controls 2" + libraryIcon: "images/progressbar-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A bar indicating the progress of an operation.") + + Property { name: "value"; type: "real"; value: 0.5 } + } + } + + Type { + name: "QtQuick.Controls.RadioButton" + icon: "images/radiobutton-icon16.png" + + ItemLibraryEntry { + name: "Radio Button" + category: "Qt Quick - Controls 2" + libraryIcon: "images/radiobutton-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("An option button that you can toggle on or off.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Radio Button\")" } + } + } + + Type { + name: "QtQuick.Controls.RadioDelegate" + icon: "images/radiobutton-icon16.png" + + ItemLibraryEntry { + name: "Radio Delegate" + category: "Qt Quick - Controls 2" + libraryIcon: "images/radiobutton-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Presents items from a model as radio buttons.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Radio Delegate\")" } + } + } + + Type { + name: "QtQuick.Controls.RangeSlider" + icon: "images/rangeslider-icon16.png" + + ItemLibraryEntry { + name: "Range Slider" + category: "Qt Quick - Controls 2" + libraryIcon: "images/rangeslider-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A bar with adjustable start and end points.") + + Property { name: "first.value"; type: "real"; value: 0.25 } + Property { name: "second.value"; type: "real"; value: 0.75 } + } + } + + Type { + name: "QtQuick.Controls.RoundButton" + icon: "images/roundbutton-icon16.png" + + ItemLibraryEntry { + name: "Round Button" + category: "Qt Quick - Controls 2" + libraryIcon: "images/roundbutton-icon.png" + version: "2.1" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A round button with text.") + + Property { name: "text"; type: "string"; value: "+" } + } + } + + Type { + name: "QtQuick.Controls.Slider" + icon: "images/slider-icon16.png" + + ItemLibraryEntry { + name: "Slider" + category: "Qt Quick - Controls 2" + libraryIcon: "images/slider-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("An adjustable slider.") + + Property { name: "value"; type: "real"; value: 0.5 } + } + } + + Type { + name: "QtQuick.Controls.SpinBox" + icon: "images/spinbox-icon16.png" + + ItemLibraryEntry { + name: "Spin Box" + category: "Qt Quick - Controls 2" + libraryIcon: "images/spinbox-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A box with an adjustable number.") + } + } + + Type { + name: "QtQuick.Controls.ScrollView" + icon: "images/scrollview-icon16.png" + + ItemLibraryEntry { + name: "Scroll View" + category: "Qt Quick - Controls 2" + libraryIcon: "images/scrollview-icon.png" + version: "2.2" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A scrollable area.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + } + } + + Type { + name: "QtQuick.Controls.StackView" + icon: "images/stackview-icon16.png" + + ItemLibraryEntry { + name: "Stack View" + category: "Qt Quick - Controls 2" + libraryIcon: "images/stackview-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Provides a stack-based navigation for a set of pages.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + } + } + + Type { + name: "QtQuick.Controls.SwipeDelegate" + icon: "images/itemdelegate-icon16.png" + + ItemLibraryEntry { + name: "Swipe Delegate" + category: "Qt Quick - Controls 2" + libraryIcon: "images/itemdelegate-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Presents items from a model as items that you can swipe to expose more options.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Swipe Delegate\")" } + } + } + + Type { + name: "QtQuick.Controls.SwipeView" + icon: "images/swipeview-icon16.png" + + ItemLibraryEntry { + name: "Swipe View" + category: "Qt Quick - Controls 2" + libraryIcon: "images/swipeview-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Provides a view where you can navigate pages by swiping.") + + Property { name: "width"; type: "int"; value: 200 } + Property { name: "height"; type: "int"; value: 200 } + } + } + + Type { + name: "QtQuick.Controls.Switch" + icon: "images/switch-icon16.png" + + ItemLibraryEntry { + name: "Switch" + category: "Qt Quick - Controls 2" + libraryIcon: "images/switch-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A button that you can toggle on and off.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Switch\")" } + } + } + + Type { + name: "QtQuick.Controls.SwitchDelegate" + icon: "images/switch-icon16.png" + + ItemLibraryEntry { + name: "Switch Delegate" + category: "Qt Quick - Controls 2" + libraryIcon: "images/switch-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("Presents items from a model as toggle switches.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Switch Delegate\")" } + } + } + + Type { + name: "QtQuick.Controls.TabBar" + icon: "images/toolbar-icon16.png" + + ItemLibraryEntry { + name: "Tab Bar" + category: "Qt Quick - Controls 2" + libraryIcon: "images/toolbar-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A tab-based navigation model.") + + Property { name: "width"; type: "int"; value: 240 } + } + } + + Type { + name: "QtQuick.Controls.TabButton" + icon: "images/toolbutton-icon16.png" + + ItemLibraryEntry { + name: "Tab Button" + category: "Qt Quick - Controls 2" + libraryIcon: "images/toolbutton-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A button suitable for a tab bar.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Tab Button\")" } + } + } + + Type { + name: "QtQuick.Controls.TextArea" + icon: "images/textarea-icon16.png" + + ItemLibraryEntry { + name: "Text Area" + category: "Qt Quick - Controls 2" + libraryIcon: "images/textarea-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A multi-line text box.") + + Property { name: "placeholderText"; type: "binding"; value: "qsTr(\"Text Area\")" } + } + } + + Type { + name: "QtQuick.Controls.TextField" + icon: "images/textfield-icon16.png" + + ItemLibraryEntry { + name: "Text Field" + category: "Qt Quick - Controls 2" + libraryIcon: "images/textfield-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A single-line text box.") + + Property { name: "placeholderText"; type: "binding"; value: "qsTr(\"Text Field\")" } + } + } + + Type { + name: "QtQuick.Controls.ToolBar" + icon: "images/toolbar-icon16.png" + + ItemLibraryEntry { + name: "Tool Bar" + category: "Qt Quick - Controls 2" + libraryIcon: "images/toolbar-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A row that can hold actions and buttons.") + + Property { name: "width"; type: "int"; value: 360 } + } + } + + Type { + name: "QtQuick.Controls.ToolButton" + icon: "images/toolbutton-icon16.png" + + ItemLibraryEntry { + name: "Tool Button" + category: "Qt Quick - Controls 2" + libraryIcon: "images/toolbutton-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A button suitable for a tool bar.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Tool Button\")" } + } + } + + Type { + name: "QtQuick.Controls.ToolSeparator" + icon: "images/toolseparator-icon16.png" + + ItemLibraryEntry { + name: "Tool Separator" + category: "Qt Quick - Controls 2" + libraryIcon: "images/toolseparator-icon.png" + version: "2.1" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A line to separate sections in a tool bar.") + } + } + + Type { + name: "QtQuick.Controls.Tumbler" + icon: "images/tumbler-icon16.png" + + ItemLibraryEntry { + name: "Tumbler" + category: "Qt Quick - Controls 2" + libraryIcon: "images/tumbler-icon.png" + version: "2.0" + requiredImport: "QtQuick.Controls" + toolTip: qsTr("A spinnable wheel of selectable items.") + + Property { name: "model"; type: "int"; value: "10" } + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/AssetUtils/designer/assetutils.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/AssetUtils/designer/assetutils.metainfo new file mode 100644 index 00000000000..47abeea7a36 --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/AssetUtils/designer/assetutils.metainfo @@ -0,0 +1,21 @@ +MetaInfo { + Type { + name: "QtQuick3D.AssetUtils.RuntimeLoader" + icon: "images/runtimeloader16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Runtime Loader" + category: "AssetUtils" + libraryIcon: "images/runtimeloader.png" + version: "6.2" + requiredImport: "QtQuick3D.AssetUtils" + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Effects/designer/effectlib.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Effects/designer/effectlib.metainfo new file mode 100644 index 00000000000..7ad3357894c --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Effects/designer/effectlib.metainfo @@ -0,0 +1,401 @@ +MetaInfo { + Type { + name: "QtQuick3D.Effects.AdditiveColorGradient" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Additive Color Gradient" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Blur" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Blur" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.BrushStrokes" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Brush Strokes" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.ChromaticAberration" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Chromatic Aberration" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.ColorMaster" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Color Master" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.DepthOfFieldHQBlur" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Depth of Field HQ Blur" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Desaturate" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Desaturate" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.DistortionRipple" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Distortion Ripple" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.DistortionSphere" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Distortion Sphere" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.DistortionSpiral" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Distortion Spiral" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.EdgeDetect" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Edge Detect" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Emboss" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Emboss" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Flip" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Flip" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Fxaa" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Fxaa" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.GaussianBlur" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Gaussian Blur" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.HDRBloomTonemap" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "HDR Bloom Tonemap" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.MotionBlur" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Motion Blur" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Scatter" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Scatter" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.SCurveTonemap" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "SCurve Tonemap" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.TiltShift" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Tilt Shift" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } + Type { + name: "QtQuick3D.Effects.Vignette" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Vignette" + category: "Qt Quick 3D Effects" + libraryIcon: "images/effect.png" + version: "1.0" + requiredImport: "QtQuick3D.Effects" + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Helpers/designer/helpers.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Helpers/designer/helpers.metainfo new file mode 100644 index 00000000000..83492e2c811 --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Helpers/designer/helpers.metainfo @@ -0,0 +1,261 @@ +MetaInfo { + Type { + name: "QtQuick3D.Helpers.LookAtNode" + icon: "images/lookatnode16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Look-at Node" + category: "Helpers" + libraryIcon: "images/lookatnode.png" + version: "6.4" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.AxisHelper" + icon: "images/axishelper16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Axis Helper" + category: "Helpers" + libraryIcon: "images/axishelper.png" + version: "6.0" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.DebugView" + icon: "images/debugview16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: true + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Debug View" + category: "Helpers" + libraryIcon: "images/debugview.png" + version: "6.0" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.GridGeometry" + icon: "images/gridgeometry16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Grid Geometry" + category: "Helpers" + libraryIcon: "images/gridgeometry.png" + version: "6.0" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.HeightFieldGeometry" + icon: "images/heightfieldgeometry16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Height Field Geometry" + category: "Helpers" + libraryIcon: "images/heightfieldgeometry.png" + version: "6.4" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.InstanceModel" + icon: "images/instancemodel16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Instance Model" + category: "Helpers" + libraryIcon: "images/instancemodel.png" + version: "6.4" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.InstanceRepeater" + icon: "images/instancerepeater16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Instance Repeater" + category: "Helpers" + libraryIcon: "images/instancerepeater.png" + version: "6.4" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.WasdController" + icon: "images/wasdcontroller16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: true + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Wasd Controller" + category: "Helpers" + libraryIcon: "images/wasdcontroller.png" + version: "6.0" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.InfiniteGrid" + icon: "images/infinitegrid16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Infinite Grid" + category: "Helpers" + libraryIcon: "images/infinitegrid.png" + version: "6.5" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.OrbitCameraController" + icon: "images/orbitcameracontroller16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: true + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Orbit Camera Controller" + category: "Helpers" + libraryIcon: "images/orbitcameracontroller.png" + version: "6.4" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.ProceduralSkyTextureData" + icon: "images/proceduralskytexturedata16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Procedural Sky Texture Data" + category: "Helpers" + libraryIcon: "images/proceduralskytexturedata.png" + version: "6.4" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.ExtendedSceneEnvironment" + icon: "images/extendedsceneenvironment16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Extended Scene Environment" + category: "Helpers" + libraryIcon: "images/extendedsceneenvironment.png" + version: "6.5" + requiredImport: "QtQuick3D.Helpers" + } + } + + Type { + name: "QtQuick3D.Helpers.LodManager" + icon: "images/lodmanager16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Lod Manager" + category: "Helpers" + libraryIcon: "images/lodmanager.png" + version: "6.5" + requiredImport: "QtQuick3D.Helpers" + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/ParticleEffects/designer/particleeffects.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/ParticleEffects/designer/particleeffects.metainfo new file mode 100644 index 00000000000..d9bc305b4ae --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/ParticleEffects/designer/particleeffects.metainfo @@ -0,0 +1,246 @@ +MetaInfo { + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Clouds" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_clouds.qml" } + ExtraFile { source: "images/smoke_sprite2.png" } + } + } + + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Dust" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_dust.qml" } + ExtraFile { source: "images/sphere.png" } + } + } + + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Exhaust" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_exhaust.qml" } + ExtraFile { source: "images/smoke2.png" } + } + } + + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Fire" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_fire.qml" } + ExtraFile { source: "images/smoke_sprite.png" } + ExtraFile { source: "images/sphere.png" } + ExtraFile { source: "images/color_table.png" } + ExtraFile { source: "images/color_table2.png" } + } + } + + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Heavy Rain" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_heavyrain.qml" } + ExtraFile { source: "images/rain.png" } + ExtraFile { source: "images/sphere.png" } + ExtraFile { source: "images/ripple.png" } + ExtraFile { source: "images/splash7.png" } + } + } + + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Heavy Rain - Tire Spray" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_heavyrain_tirespray.qml" } + ExtraFile { source: "images/smoke2.png" } + } + } + + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Light Rain" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_lightrain.qml" } + ExtraFile { source: "images/rain.png" } + ExtraFile { source: "images/splash7.png" } + } + } + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Light Rain - Tire Spray" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_lightrain_tirespray.qml" } + ExtraFile { source: "images/smoke2.png" } + } + } + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Rain Mist" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_rainmist.qml" } + ExtraFile { source: "images/smoke2.png" } + } + } + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Snow" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_snow.qml" } + ExtraFile { source: "images/snowflake.png" } + } + } + Type { + name: "QtQuick3D.Particle3D.ParticleSystem3D" + icon: "images/dummy16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Steam" + category: "Qt Quick 3D Particle Effects" + libraryIcon: "images/dummy.png" + version: "6.2" + requiredImport: "QtQuick3D.ParticleEffects" + QmlSource { source: "./source/particleeffect_steam.qml" } + ExtraFile { source: "images/smoke2.png" } + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Particles3D/designer/particles3d.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Particles3D/designer/particles3d.metainfo new file mode 100644 index 00000000000..d2a2999c50a --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Particles3D/designer/particles3d.metainfo @@ -0,0 +1,562 @@ +MetaInfo { + Type { + name: "QtQuick3D.Particles3D.Attractor3D" + icon: "images/attractor-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Attractor" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/attractor-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.DynamicBurst3D" + icon: "images/emit-burst-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Dynamic Burst" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/emit-burst-24px.png" + version: "6.3" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.EmitBurst3D" + icon: "images/emit-burst-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Emit Burst" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/emit-burst-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleEmitter3D" + icon: "images/emitter-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Emitter" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/emitter-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.Gravity3D" + icon: "images/gravity-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Gravity" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/gravity-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ModelBlendParticle3D" + icon: "images/model-blend-particle-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Model Blend Particle" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/model-blend-particle-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ModelParticle3D" + icon: "images/model-particle-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Model Particle" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/model-particle-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleCustomShape3D" + icon: "images/particle-custom-shape-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Custom Shape" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/particle-custom-shape-24px.png" + version: "6.3" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleModelShape3D" + icon: "images/model-shape-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Model Shape" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/model-shape-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.PointRotator3D" + icon: "images/point-rotator-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Point Rotator" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/point-rotator-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleShape3D" + icon: "images/particle-shape-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Particle Shape" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/particle-shape-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.SpriteParticle3D" + icon: "images/sprite-particle-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Sprite Particle" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/sprite-particle-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.SpriteSequence3D" + icon: "images/sprite-sequence-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Sprite Sequence" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/sprite-sequence-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Particle System" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.TargetDirection3D" + icon: "images/target-direction-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Target Direction" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/target-direction-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.TrailEmitter3D" + icon: "images/trail-emitter-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Trail Emitter" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/trail-emitter-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.VectorDirection3D" + icon: "images/vector-direction-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Vector Direction" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/vector-direction-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.Wander3D" + icon: "images/wander-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Wander" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/wander-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Animated Sprite" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_animatedsprite_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Attractor System" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_attractor_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Burst" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_burst_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Model Blend" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_modelblend_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Model Shape" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_modelshape_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Particle Trail" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_particletrail_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Sprite" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_sprite_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.ParticleSystem3D" + icon: "images/particle-system-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Wander" + category: "Qt Quick 3D Particle System Templates" + libraryIcon: "images/particle-system-24px.png" + version: "6.2" + requiredImport: "QtQuick3D.Particles3D" + QmlSource { source: "./source/particlesystem_wander_template.qml" } + } + } + Type { + name: "QtQuick3D.Particles3D.LineParticle3D" + icon: "images/line-particle-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Line Particle" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/line-particle-24px.png" + version: "6.4" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.Repeller3D" + icon: "images/repeller-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Repeller" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/repeller-24px.png" + version: "6.4" + requiredImport: "QtQuick3D.Particles3D" + } + } + Type { + name: "QtQuick3D.Particles3D.ScaleAffector3D" + icon: "images/scale-affector-16px.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Scale Affector" + category: "Qt Quick 3D Particles 3D" + libraryIcon: "images/scale-affector-24px.png" + version: "6.4" + requiredImport: "QtQuick3D.Particles3D" + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/designer/physics.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/designer/physics.metainfo new file mode 100644 index 00000000000..874e209dc52 --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/designer/physics.metainfo @@ -0,0 +1,261 @@ +MetaInfo { + Type { + name: "QtQuick3D.Physics.PhysicsWorld" + icon: "images/physicsworld16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Physics World" + category: "Components" + libraryIcon: "images/physicsworld.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.TriggerBody" + icon: "images/triggerbody16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Trigger Body" + category: "Collision Bodies" + libraryIcon: "images/triggerbody.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.StaticRigidBody" + icon: "images/staticrigidbody16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Static Rigid Body" + category: "Collision Bodies" + libraryIcon: "images/staticrigidbody.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.DynamicRigidBody" + icon: "images/dynamicrigidbody16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Dynamic Rigid Body" + category: "Collision Bodies" + libraryIcon: "images/dynamicrigidbody.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.PhysicsMaterial" + icon: "images/physicsmaterial16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Physics Material" + category: "Components" + libraryIcon: "images/physicsmaterial.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.BoxShape" + icon: "images/boxshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Box Shape" + category: "Collision Shapes" + libraryIcon: "images/boxshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.CapsuleShape" + icon: "images/capsuleshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Capsule Shape" + category: "Collision Shapes" + libraryIcon: "images/capsuleshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.ConvexMeshShape" + icon: "images/convexmeshshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Convex Mesh Shape" + category: "Collision Shapes" + libraryIcon: "images/convexmeshshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.HeightFieldShape" + icon: "images/heightfieldshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Height Field Shape" + category: "Collision Shapes" + libraryIcon: "images/heightfieldshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.PlaneShape" + icon: "images/planeshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Plane Shape" + category: "Collision Shapes" + libraryIcon: "images/planeshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.SphereShape" + icon: "images/sphereshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Sphere Shape" + category: "Collision Shapes" + libraryIcon: "images/sphereshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.TriangleMeshShape" + icon: "images/trianglemeshshape16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Triangle Mesh Shape" + category: "Collision Shapes" + libraryIcon: "images/trianglemeshshape.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } + + Type { + name: "QtQuick3D.Physics.CharacterController" + icon: "images/charactercontroller16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Character Controller" + category: "Collision Bodies" + libraryIcon: "images/charactercontroller.png" + version: "6.5" + requiredImport: "QtQuick3D.Physics" + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/designer/quick3d.metainfo b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/designer/quick3d.metainfo new file mode 100644 index 00000000000..852f9081295 --- /dev/null +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/designer/quick3d.metainfo @@ -0,0 +1,861 @@ +MetaInfo { + Type { + name: "QtQuick3D.PerspectiveCamera" + icon: "images/camera16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Perspective Camera" + category: "Cameras" + libraryIcon: "images/camera.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "z"; type: "int"; value: 500; } + toolTip: qsTr("A camera that uses perspective projection.") + } + } + Type { + name: "QtQuick3D.OrthographicCamera" + icon: "images/camera16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Orthographic Camera" + category: "Cameras" + libraryIcon: "images/camera.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "z"; type: "int"; value: 500; } + toolTip: qsTr("A parallel projection Camera, in which an object's perceived scale is unaffected by its distance from the Camera.") + } + } + Type { + name: "QtQuick3D.FrustumCamera" + icon: "images/camera16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Frustum Camera" + category: "Cameras" + libraryIcon: "images/camera.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "z"; type: "int"; value: 500; } + toolTip: qsTr("A perspective camera with a custom frustum.") + } + } + Type { + name: "QtQuick3D.CustomCamera" + icon: "images/camera16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Custom Camera" + category: "Cameras" + libraryIcon: "images/camera.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "z"; type: "int"; value: 500; } + toolTip: qsTr("A camera with a custom projection matrix.") + } + } + Type { + name: "QtQuick3D.CustomMaterial" + icon: "images/custommaterial16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Custom Material" + category: "Materials" + libraryIcon: "images/custommaterial.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "fragmentShader"; type: "QUrl"; value: "custom_material_default_shader.frag"; } + ExtraFile { source: "source/custom_material_default_shader.frag" } + toolTip: qsTr("A material with customizable vertex and fragment shaders.") + } + } + Type { + name: "QtQuick3D.DefaultMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Default Material" + category: "Materials" + libraryIcon: "images/material.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "diffuseColor"; type: "color"; value: "#4aee45"; } + toolTip: qsTr("A material with a specular/glossiness properties.") + } + } + Type { + name: "QtQuick3D.PrincipledMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Principled Material" + category: "Materials" + libraryIcon: "images/material.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "baseColor"; type: "color"; value: "#4aee45"; } + toolTip: qsTr("A material with a PBR metal/roughness properties.") + } + } + Type { + name: "QtQuick3D.SpecularGlossyMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Specular Glossy" + category: "Materials" + libraryIcon: "images/material.png" + version: "6.4" + requiredImport: "QtQuick3D" + Property { name: "albedoColor"; type: "color"; value: "#4aee45"; } + Property { name: "specularColor"; type: "color"; value: "#000000"; } + toolTip: qsTr("A material with a PBR specular/glossiness properties.") + } + } + Type { + name: "QtQuick3D.Texture" + icon: "images/texture16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: false + } + + ItemLibraryEntry { + name: "Texture" + category: "Textures" + libraryIcon: "images/texture.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Defines a texture for 3D objects.") + } + } + Type { + name: "QtQuick3D.CubeMapTexture" + icon: "images/cubemaptexture16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: false + } + + ItemLibraryEntry { + name: "Cube Map Texture" + category: "Textures" + libraryIcon: "images/cubemaptexture.png" + version: "6.4" + requiredImport: "QtQuick3D" + toolTip: qsTr("Defines a cube map texture for 3D objects.") + } + } + Type { + name: "QtQuick3D.DirectionalLight" + icon: "images/lightdirectional16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Directional Light" + category: "Lights" + libraryIcon: "images/lightdirectional.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A light similar to sunlight. It emits light in one direction from an infinitely far away source.") + } + } + Type { + name: "QtQuick3D.PointLight" + icon: "images/lightpoint16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Point Light" + category: "Lights" + libraryIcon: "images/lightpoint.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A light similar to a light bulb. It emits light equally in all directions from a central source.") + } + } + Type { + name: "QtQuick3D.SpotLight" + icon: "images/lightspot16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Spotlight" + category: "Lights" + libraryIcon: "images/lightspot.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A spotlight emits light in one direction in a cone shape.") + } + } + Type { + name: "QtQuick3D.Model" + icon: "images/model16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + visibleNonDefaultProperties: "materials" + } + + ItemLibraryEntry { + name: "Model" + category: "Components" + libraryIcon: "images/group.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Allows you to load 3D mesh data.") + } + } + Type { + name: "QtQuick3D.Model" + icon: "images/model16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + visibleNonDefaultProperties: "materials" + } + + ItemLibraryEntry { + name: "Cube" + category: "Primitives" + libraryIcon: "images/cube.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "source"; type: "QUrl"; value: "#Cube"; } + toolTip: qsTr("A cube model.") + } + } + Type { + name: "QtQuick3D.Model" + icon: "images/model16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + visibleNonDefaultProperties: "materials" + } + + ItemLibraryEntry { + name: "Sphere" + category: "Primitives" + libraryIcon: "images/sphere.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "source"; type: "QUrl"; value: "#Sphere"; } + toolTip: qsTr("A sphere model.") + } + } + Type { + name: "QtQuick3D.Model" + icon: "images/model16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + visibleNonDefaultProperties: "materials" + } + + ItemLibraryEntry { + name: "Cylinder" + category: "Primitives" + libraryIcon: "images/cylinder.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "source"; type: "QUrl"; value: "#Cylinder"; } + toolTip: qsTr("A cylinder model.") + } + } + Type { + name: "QtQuick3D.Model" + icon: "images/model16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + visibleNonDefaultProperties: "materials" + } + + ItemLibraryEntry { + name: "Plane" + category: "Primitives" + libraryIcon: "images/plane.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "source"; type: "QUrl"; value: "#Rectangle"; } + toolTip: qsTr("A plane model.") + } + } + Type { + name: "QtQuick3D.Model" + icon: "images/model16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + visibleNonDefaultProperties: "materials" + } + + ItemLibraryEntry { + name: "Cone" + category: "Primitives" + libraryIcon: "images/cone.png" + version: "6.0" + requiredImport: "QtQuick3D" + Property { name: "source"; type: "QUrl"; value: "#Cone"; } + toolTip: qsTr("A cone model.") + } + } + Type { + name: "QtQuick3D.Node" + icon: "images/group16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Group" + category: "Components" + libraryIcon: "images/group.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A container to keep several QtQuick3D components or scenes together.") + } + } + Type { + name: "QtQuick3D.SceneEnvironment" + icon: "images/scene16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Scene Environment" + category: "Components" + libraryIcon: "images/scene.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Configures the render settings for a scene.") + } + } + Type { + name: "QtQuick3D.View3D" + icon: "images/view3D16.png" + + ItemLibraryEntry { + name: "View3D" + category: "Items" + libraryIcon: "images/view3D.png" + version: "6.0" + requiredImport: "QtQuick3D" + QmlSource { source: "./source/view3D_template.qml" } + toolTip: qsTr("A 2D surface where a 3D scene can be rendered.") + } + } + Type { + name: "QtQuick3D.Shader" + icon: "images/shaderutil16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Shader" + category: "Custom Shader Utils" + libraryIcon: "images/shaderutil.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A container for keeping the vertex or fragment shader codes to be used by post-processing effect.") + } + } + Type { + name: "QtQuick3D.TextureInput" + icon: "images/shaderutil16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Texture Input" + category: "Custom Shader Utils" + libraryIcon: "images/shaderutil.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Specifies a texture that gets exposed to the shader.") + } + } + Type { + name: "QtQuick3D.Pass" + icon: "images/shaderutil16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Pass" + category: "Custom Shader Utils" + libraryIcon: "images/shaderutil.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Holds a set of actions combining a list of executable render commands, an output buffer, and a list of shaders to use for rendering effects.") + } + } + Type { + name: "QtQuick3D.BufferInput" + icon: "images/shadercommand16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Buffer Input" + category: "Custom Shader Utils" + libraryIcon: "images/shadercommand.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A command that gets added to the list of commands in the Pass of an Effect when executed.") + } + } + Type { + name: "QtQuick3D.Buffer" + icon: "images/shaderutil16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Buffer" + category: "Custom Shader Utils" + libraryIcon: "images/shaderutil.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Creates or references a color buffer to be used for a pass of an Effect.") + } + } + Type { + name: "QtQuick3D.SetUniformValue" + icon: "images/shadercommand16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Set Uniform Value" + category: "Custom Shader Utils" + libraryIcon: "images/shadercommand.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A value that would be set when a single pass actions takes place.") + } + } + Type { + name: "QtQuick3D.Effect" + icon: "images/effect16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Effect" + category: "Components" + libraryIcon: "images/effect.png" + version: "6.0" + requiredImport: "QtQuick3D" + QmlSource { source: "./source/effect_template.qml" } + ExtraFile { source: "./source/effect_default_shader.frag" } + toolTip: qsTr("A method to allow the user to implement their post-processing effects on entire View3D.") + } + } + Type { + name: "QtQuick3D.Repeater3D" + icon: "images/repeater3d16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "3D Repeater" + category: "Components" + libraryIcon: "images/repeater3d.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Dynamically creates several copies of the same 3D object.") + } + } + Type { + name: "QtQuick3D.Loader3D" + icon: "images/loader3d16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Loader3D" + category: "Components" + libraryIcon: "images/loader3d.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Allows you to load 3D components dynamically.") + } + } + Type { + name: "QtQuick3D.Skeleton" + icon: "images/skeleton16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Skeleton" + category: "Components" + libraryIcon: "images/skeleton.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Defines a skeletal animation hierarchy.") + } + } + Type { + name: "QtQuick3D.MorphTarget" + icon: "images/morphtarget16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Morph Target" + category: "Components" + libraryIcon: "images/morphtarget.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("Defines the properties of a morph target.") + } + } + Type { + name: "QtQuick3D.InstanceListEntry" + icon: "images/instancelistentry16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Instance List Entry" + category: "Components" + libraryIcon: "images/instancelistentry.png" + version: "6.2" + requiredImport: "QtQuick3D" + toolTip: qsTr("One instance in an Instance List. The instance includes a set of property specifications.") + } + } + Type { + name: "QtQuick3D.InstanceList" + icon: "images/instancelist16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Instance List" + category: "Components" + libraryIcon: "images/instancelist.png" + version: "6.2" + requiredImport: "QtQuick3D" + toolTip: qsTr("Enables 3D model instancing, a lightweight 3D object replication method.") + } + } + Type { + name: "QtQuick3D.FileInstancing" + icon: "images/fileinstancing16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "File Instancing" + category: "Components" + libraryIcon: "images/fileinstancing.png" + version: "6.2" + requiredImport: "QtQuick3D" + toolTip: qsTr("A method that allows reading instance tables from XML or Qt-specific binary files.") + } + } + Type { + name: "QtQuick3D.Joint" + icon: "images/joint16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Joint" + category: "Components" + libraryIcon: "images/joint.png" + version: "6.0" + requiredImport: "QtQuick3D" + toolTip: qsTr("A transformable node that connects different parts in a skeletal animation.") + } + } + Type { + name: "QtQuick3D.ReflectionProbe" + icon: "images/reflectionProbe16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: true + } + + ItemLibraryEntry { + name: "Reflection Probe" + category: "Components" + libraryIcon: "images/reflectionProbe.png" + version: "6.3" + requiredImport: "QtQuick3D" + toolTip: qsTr("Reflects the current scene to the objects.") + } + } + Type { + name: "QtQuick3D.Fog" + icon: "images/fog16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Fog" + category: "Components" + libraryIcon: "images/fog.png" + version: "6.5" + requiredImport: "QtQuick3D" + } + } + Type { + name: "QtQuick3D.DebugSettings" + icon: "images/debugsettings16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Debug Settings" + category: "Components" + libraryIcon: "images/debugsettings.png" + version: "6.5" + requiredImport: "QtQuick3D" + } + } + + Type { + name: "QtQuick3D.Lightmapper" + icon: "images/lightmapper16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + // Split the name to avoid ellipsis in UI + name: "Light Mapper" + category: "Components" + libraryIcon: "images/lightmapper.png" + version: "6.5" + requiredImport: "QtQuick3D" + } + } + + Type { + name: "QtQuick3D.Skin" + icon: "images/skin16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Skin" + category: "Components" + libraryIcon: "images/skin.png" + version: "6.5" + requiredImport: "QtQuick3D" + } + } + + Type { + name: "QtQuick3D.ResourceLoader" + icon: "images/resourceLoader16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + + ItemLibraryEntry { + name: "Resource Loader" + category: "Components" + libraryIcon: "images/resourceLoader.png" + version: "6.2" + requiredImport: "QtQuick3D" + toolTip: qsTr("Pre-load resources for 3D scene. It makes sure that large resources are available before rendering a frame.") + } + } +} diff --git a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp index 125e8df3aeb..d16e007cc03 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp @@ -996,10 +996,10 @@ protected: package.updatedSourceIds = {sourceId1, sourceId2, sourceId3}; - package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "QtObject", sourceId1, sourceIdPath); - package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item", sourceId2, sourceIdPath); - package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item3D", sourceId3, sourceIdPath); - package.updatedPropertyEditorQmlPathSourceIds.emplace_back(sourceIdPath); + package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "QtObject", sourceId1, sourceIdPath6); + package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item", sourceId2, sourceIdPath6); + package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item3D", sourceId3, sourceIdPath6); + package.updatedPropertyEditorQmlPathSourceIds.emplace_back(sourceIdPath6); return package; } @@ -1013,6 +1013,7 @@ protected: traits.visibleInLibrary = FlagIs::True; annotations.emplace_back(sourceId4, + sourceIdPath6, "Object", qmlModuleId, "/path/to/icon.png", @@ -1034,6 +1035,32 @@ protected: "properties":[["color", "color", "#blue"]]}])xy"); annotations.emplace_back(sourceId5, + sourceIdPath6, + "Item", + qtQuickModuleId, + "/path/to/quick.png", + traits, + R"xy({"canBeContainer": "true", "forceClip": "false"})xy", + R"xy([{"name":"Item", + "iconPath":"/path/icon3", + "category":"Advanced Items", + "import":"QtQuick", + "toolTip":"Item is an Object", + "properties":[["x", "double", 1], ["y", "double", 2]]}])xy"); + + return annotations; + } + + auto createExtendedTypeAnnotations() const + { + auto annotations = createTypeAnnotions(); + annotations.pop_back(); + TypeTraits traits{TypeTraitsKind::Reference}; + traits.canBeContainer = FlagIs::True; + traits.visibleInLibrary = FlagIs::True; + + annotations.emplace_back(sourceId5, + sourceIdPath1, "Item", qtQuickModuleId, "/path/to/quick.png", @@ -1109,7 +1136,6 @@ protected: protected: inline static std::unique_ptr static_database; Sqlite::Database &database = *static_database; - //Sqlite::Database database{"/tmp/aaaaa.db", Sqlite::JournalMode::Wal}; inline static std::unique_ptr> static_projectStorage; QmlDesigner::ProjectStorage &storage = *static_projectStorage; QmlDesigner::SourcePathCache> sourcePathCache{ @@ -1120,14 +1146,16 @@ protected: QmlDesigner::SourcePathView path4{"/path4/to"}; QmlDesigner::SourcePathView path5{"/path5/to"}; QmlDesigner::SourcePathView path6{"/path6/to"}; - QmlDesigner::SourcePathView pathPath{"/path6/."}; + QmlDesigner::SourcePathView pathPath1{"/path1/."}; + QmlDesigner::SourcePathView pathPath6{"/path6/."}; SourceId sourceId1{sourcePathCache.sourceId(path1)}; SourceId sourceId2{sourcePathCache.sourceId(path2)}; SourceId sourceId3{sourcePathCache.sourceId(path3)}; SourceId sourceId4{sourcePathCache.sourceId(path4)}; SourceId sourceId5{sourcePathCache.sourceId(path5)}; SourceId sourceId6{sourcePathCache.sourceId(path6)}; - SourceId sourceIdPath{sourcePathCache.sourceId(path6)}; + SourceId sourceIdPath1{sourcePathCache.sourceId(pathPath1)}; + SourceId sourceIdPath6{sourcePathCache.sourceId(pathPath6)}; SourceId qmlProjectSourceId{sourcePathCache.sourceId("/path1/qmldir")}; SourceId qtQuickProjectSourceId{sourcePathCache.sourceId("/path2/qmldir")}; ModuleId qmlModuleId{storage.moduleId("Qml")}; @@ -7276,7 +7304,7 @@ TEST_F(ProjectStorage, synchronize_property_editor_adds_path) auto package{createPropertyEditorPathsSynchronizationPackage()}; package.propertyEditorQmlPaths.pop_back(); storage.synchronize(package); - package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item3D", sourceId3, sourceIdPath); + package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item3D", sourceId3, sourceIdPath6); storage.synchronize(package); @@ -7288,7 +7316,7 @@ TEST_F(ProjectStorage, synchronize_property_editor_adds_path) TEST_F(ProjectStorage, synchronize_property_editor_with_non_existing_type_name) { auto package{createPropertyEditorPathsSynchronizationPackage()}; - package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item4D", sourceId4, sourceIdPath); + package.propertyEditorQmlPaths.emplace_back(qtQuickModuleId, "Item4D", sourceId4, sourceIdPath6); storage.synchronize(package); @@ -7308,6 +7336,21 @@ TEST_F(ProjectStorage, call_remove_type_ids_in_observer_after_synchronization) storage.synchronize(package); } +TEST_F(ProjectStorage, do_not_synchronize_type_annotations_without_type) +{ + SynchronizationPackage package; + package.typeAnnotations = createTypeAnnotions(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + TypeTraits traits{TypeTraitsKind::Reference}; + traits.canBeContainer = FlagIs::True; + traits.visibleInLibrary = FlagIs::True; + + storage.synchronize(package); + + ASSERT_THAT(storage.allItemLibraryEntries(), IsEmpty()); +} + TEST_F(ProjectStorage, synchronize_type_annotation_type_traits) { auto package{createSimpleSynchronizationPackage()}; @@ -7460,6 +7503,18 @@ TEST_F(ProjectStorage, synchronize_removes_type_hints) } TEST_F(ProjectStorage, return_empty_type_hints_if_no_type_hints_exists) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.typeAnnotations[0].hintsJson.clear(); + storage.synchronize(package); + + auto typeHints = storage.typeHints(fetchTypeId(sourceId2, "QObject")); + + ASSERT_THAT(typeHints, IsEmpty()); +} + +TEST_F(ProjectStorage, return_empty_type_hints_if_no_type_annotaion_exists) { auto package{createSimpleSynchronizationPackage()}; storage.synchronize(package); @@ -7534,7 +7589,7 @@ TEST_F(ProjectStorage, synchronize_removes_item_library_entries) ASSERT_THAT(storage.allItemLibraryEntries(), IsEmpty()); } -TEST_F(ProjectStorage, synchronize_udpates_item_library_entries) +TEST_F(ProjectStorage, synchronize_updates_item_library_entries) { auto package{createSimpleSynchronizationPackage()}; package.typeAnnotations = createTypeAnnotions(); @@ -7560,6 +7615,59 @@ TEST_F(ProjectStorage, synchronize_udpates_item_library_entries) IsEmpty()))); } +TEST_F(ProjectStorage, synchronize_updates_item_library_entries_with_empty_entries) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + storage.synchronize(package); + package.typeAnnotations[0].itemLibraryJson.clear(); + + storage.synchronize(package); + + ASSERT_THAT(storage.itemLibraryEntries(fetchTypeId(sourceId2, "QObject")), IsEmpty()); +} + +TEST_F(ProjectStorage, synchronize_type_annotation_directory_source_id) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + + storage.synchronize(package); + + ASSERT_THAT(storage.typeAnnotationSourceIds(sourceIdPath6), + UnorderedElementsAre(sourceId4, sourceId5)); +} + +TEST_F(ProjectStorage, get_type_annotation_source_ids) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + storage.synchronize(package); + + auto sourceIds = storage.typeAnnotationSourceIds(sourceIdPath6); + + ASSERT_THAT(sourceIds, UnorderedElementsAre(sourceId4, sourceId5)); +} + +TEST_F(ProjectStorage, get_type_annotation_directory_source_ids) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createExtendedTypeAnnotations(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + storage.synchronize(package); + + auto sourceIds = storage.typeAnnotationDirectorySourceIds(); + + ASSERT_THAT(sourceIds, ElementsAre(sourceIdPath1, sourceIdPath6)); +} + TEST_F(ProjectStorage, get_all_item_library_entries) { auto package{createSimpleSynchronizationPackage()}; @@ -7605,6 +7713,31 @@ TEST_F(ProjectStorage, get_all_item_library_entries) IsEmpty()))); } +TEST_F(ProjectStorage, get_all_item_library_entries_handles_no_entries) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.typeAnnotations[0].itemLibraryJson.clear(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + storage.synchronize(package); + + auto entries = storage.allItemLibraryEntries(); + + ASSERT_THAT(entries, + UnorderedElementsAre( + IsItemLibraryEntry(fetchTypeId(sourceId1, "QQuickItem"), + "Item", + "/path/icon3", + "Advanced Items", + "QtQuick", + "Item is an Object", + "", + UnorderedElementsAre(IsItemLibraryProperty("x", "double", 1), + IsItemLibraryProperty("y", "double", 2)), + IsEmpty()))); +} + TEST_F(ProjectStorage, get_item_library_entries_by_type_id) { auto package{createSimpleSynchronizationPackage()}; @@ -7654,6 +7787,21 @@ TEST_F(ProjectStorage, get_no_item_library_entries_if_type_id_is_invalid) ASSERT_THAT(entries, IsEmpty()); } +TEST_F(ProjectStorage, get_no_item_library_entries_by_type_id_for_no_entries) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.typeAnnotations[0].itemLibraryJson.clear(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + storage.synchronize(package); + auto typeId = fetchTypeId(sourceId2, "QObject"); + + auto entries = storage.itemLibraryEntries(typeId); + + ASSERT_THAT(entries, IsEmpty()); +} + TEST_F(ProjectStorage, get_item_library_entries_by_source_id) { auto package{createSimpleSynchronizationPackage()}; @@ -7689,6 +7837,20 @@ TEST_F(ProjectStorage, get_item_library_entries_by_source_id) IsEmpty()))); } +TEST_F(ProjectStorage, get_no_item_library_entries_by_source_id_for_no_entries) +{ + auto package{createSimpleSynchronizationPackage()}; + package.typeAnnotations = createTypeAnnotions(); + package.typeAnnotations[0].itemLibraryJson.clear(); + package.updatedTypeAnnotationSourceIds = createUpdatedTypeAnnotionSourceIds( + package.typeAnnotations); + storage.synchronize(package); + + auto entries = storage.itemLibraryEntries(sourceId2); + + ASSERT_THAT(entries, IsEmpty()); +} + TEST_F(ProjectStorage, return_type_ids_for_module_id) { auto package{createBuiltinSynchronizationPackage()}; diff --git a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp index a28c5e4935d..a0ca9012629 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp @@ -9,6 +9,8 @@ #include "../mocks/qmldocumentparsermock.h" #include "../mocks/qmltypesparsermock.h" +#include + #include #include #include @@ -120,7 +122,8 @@ MATCHER(PackageIsEmpty, std::string(negation ? "isn't empty" : "is empty")) && package.moduleDependencies.empty() && package.updatedModuleDependencySourceIds.empty() && package.moduleExportedImports.empty() && package.updatedModuleIds.empty() && package.propertyEditorQmlPaths.empty() - && package.updatedPropertyEditorQmlPathSourceIds.empty(); + && package.updatedPropertyEditorQmlPathSourceIds.empty() + && package.typeAnnotations.empty() && package.updatedTypeAnnotationSourceIds.empty(); } template @@ -168,7 +171,8 @@ public: secondSourceId, thirdSourceId, qmltypes1SourceId, - qmltypes2SourceId}); + qmltypes2SourceId, + itemLibraryPathSourceId}); setFilesAdded({qmldir1SourceId, qmldir2SourceId, qmldir3SourceId}); @@ -298,6 +302,8 @@ public: EXPECT_CALL(fileSystemMock, contentAsQString(Eq(path))).WillRepeatedly(Return(content)); } + auto moduleId(Utils::SmallStringView name) const { return storage.moduleId(name); } + protected: NiceMock fileSystemMock; NiceMock projectStorageMock; @@ -328,6 +334,13 @@ protected: SourceId qmlDocumentSourceId1 = sourcePathCache.sourceId("/path/First.qml"); SourceId qmlDocumentSourceId2 = sourcePathCache.sourceId("/path/First2.qml"); SourceId qmlDocumentSourceId3 = sourcePathCache.sourceId("/path/Second.qml"); + const QString itemLibraryPath = QDir::cleanPath( + UNITTEST_DIR "/../../../../share/qtcreator/qmldesigner/itemLibrary/"); + const QString qmlImportsPath = QDir::cleanPath(UNITTEST_DIR "/projectstorage/data/qml"); + SourceId itemLibraryPathSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/."}); + SourceId qmlImportsPathSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{qmlImportsPath + "/."}); ModuleId qmlModuleId{storage.moduleId("Qml")}; ModuleId qmlCppNativeModuleId{storage.moduleId("Qml-cppnative")}; ModuleId exampleModuleId{storage.moduleId("Example")}; @@ -410,7 +423,7 @@ TEST_F(ProjectStorageUpdater, get_content_for_qml_dir_paths_if_file_status_is_di EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/one/qmldir")))); EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/two/qmldir")))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, request_file_status_from_file_system) @@ -419,7 +432,7 @@ TEST_F(ProjectStorageUpdater, request_file_status_from_file_system) EXPECT_CALL(fileSystemMock, fileStatus(Eq(directoryPathSourceId))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, get_content_for_qml_types) @@ -431,7 +444,7 @@ TEST_F(ProjectStorageUpdater, get_content_for_qml_types) EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/example.qmltypes")))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, get_content_for_qml_types_if_project_storage_file_status_is_invalid) @@ -444,7 +457,7 @@ TEST_F(ProjectStorageUpdater, get_content_for_qml_types_if_project_storage_file_ EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/example.qmltypes")))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, parse_qml_types) @@ -463,7 +476,7 @@ TEST_F(ProjectStorageUpdater, parse_qml_types) EXPECT_CALL(qmlTypesParserMock, parse(qmltypes2, _, _, Field(&ProjectData::moduleId, exampleCppNativeModuleId))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_is_empty_for_no_change) @@ -472,7 +485,7 @@ TEST_F(ProjectStorageUpdater, synchronize_is_empty_for_no_change) EXPECT_CALL(projectStorageMock, synchronize(PackageIsEmpty())); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_types) @@ -507,7 +520,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_types) Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_types_throws_if_qmltpes_does_not_exists) @@ -515,7 +528,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_types_throws_if_qmltpes_does_not_e Storage::Import import{qmlModuleId, Storage::Version{2, 3}, qmltypesPathSourceId}; setFilesDontExists({qmltypesPathSourceId}); - ASSERT_THROW(updater.update(directories, {}, {}), QmlDesigner::CannotParseQmlTypesFile); + ASSERT_THROW(updater.update(directories, {}, {}, {}), QmlDesigner::CannotParseQmlTypesFile); } TEST_F(ProjectStorageUpdater, synchronize_qml_types_are_empty_if_file_does_not_changed) @@ -528,7 +541,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_types_are_empty_if_file_does_not_c EXPECT_CALL(projectStorageMock, synchronize(PackageIsEmpty())); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, get_content_for_qml_documents) @@ -549,7 +562,7 @@ TEST_F(ProjectStorageUpdater, get_content_for_qml_documents) EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/OldSecond.qml")))); EXPECT_CALL(fileSystemMock, contentAsQString(Eq(QString("/path/Second.qml")))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, parse_qml_documents) @@ -570,7 +583,7 @@ TEST_F(ProjectStorageUpdater, parse_qml_documents) EXPECT_CALL(qmlDocumentParserMock, parse(qmlDocument2, _, _, _)); EXPECT_CALL(qmlDocumentParserMock, parse(qmlDocument3, _, _, _)); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, parse_qml_documents_with_non_existing_qml_document_throws) @@ -579,7 +592,7 @@ TEST_F(ProjectStorageUpdater, parse_qml_documents_with_non_existing_qml_document NonexitingType 1.0 NonexitingType.qml)"}; setContent(u"/path/qmldir", qmldir); - ASSERT_THROW(updater.update(directories, {}, {}), QmlDesigner::CannotParseQmlDocumentFile); + ASSERT_THROW(updater.update(directories, {}, {}, {}), QmlDesigner::CannotParseQmlDocumentFile); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents) @@ -652,7 +665,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_add_only_qml_document_in_directory) @@ -708,7 +721,7 @@ TEST_F(ProjectStorageUpdater, synchronize_add_only_qml_document_in_directory) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document) @@ -771,7 +784,7 @@ TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document_in_qmldir_only) @@ -826,7 +839,7 @@ TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document_in_qmldir_only) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_add_qml_document_to_qmldir) @@ -884,7 +897,7 @@ TEST_F(ProjectStorageUpdater, synchronize_add_qml_document_to_qmldir) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_remove_qml_document_from_qmldir) @@ -939,7 +952,7 @@ TEST_F(ProjectStorageUpdater, synchronize_remove_qml_document_from_qmldir) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_dont_update_if_up_to_date) @@ -1009,7 +1022,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_dont_update_if_up_to_dat ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed) @@ -1060,7 +1073,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed) qmlDocumentSourceId2)), Field(&SynchronizationPackage::projectDatas, IsEmpty())))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed_and_some_updated_files) @@ -1095,7 +1108,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed_and_some UnorderedElementsAre(qmltypesPathSourceId, qmlDocumentSourceId1)), Field(&SynchronizationPackage::projectDatas, IsEmpty())))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_not_changed_and_some_removed_files) @@ -1110,7 +1123,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_not_changed_and_some_rem setFilesDontChanged({qmlDirPathSourceId, qmltypes2PathSourceId, qmlDocumentSourceId2}); setFilesRemoved({qmltypesPathSourceId, qmlDocumentSourceId1}); - ASSERT_THROW(updater.update(directories, {}, {}), QmlDesigner::CannotParseQmlTypesFile); + ASSERT_THROW(updater.update(directories, {}, {}, {}), QmlDesigner::CannotParseQmlTypesFile); } TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_changed_and_some_removed_files) @@ -1162,7 +1175,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_changed_and_some_rem exampleCppNativeModuleId, FileType::QmlTypes)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_qml_types_files_is_empty) @@ -1177,7 +1190,7 @@ TEST_F(ProjectStorageUpdater, update_qml_types_files_is_empty) Field(&SynchronizationPackage::projectDatas, IsEmpty()), Field(&SynchronizationPackage::updatedProjectSourceIds, IsEmpty())))); - updater.update({}, {}, {}); + updater.update({}, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_qml_types_files) @@ -1205,7 +1218,7 @@ TEST_F(ProjectStorageUpdater, update_qml_types_files) Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId))))); - updater.update({}, {"/path/example.qmltypes", "/path/example2.qmltypes"}, {}); + updater.update({}, {"/path/example.qmltypes", "/path/example2.qmltypes"}, {}, {}); } TEST_F(ProjectStorageUpdater, dont_update_qml_types_files_if_unchanged) @@ -1230,7 +1243,7 @@ TEST_F(ProjectStorageUpdater, dont_update_qml_types_files_if_unchanged) Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(qmltypesPathSourceId))))); - updater.update({}, {"/path/example.qmltypes", "/path/example2.qmltypes"}, {}); + updater.update({}, {"/path/example.qmltypes", "/path/example2.qmltypes"}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_with_different_version_but_same_type_name_and_file_name) @@ -1273,7 +1286,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_with_different_version_b ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_with_different_type_name_but_same_version_and_file_name) @@ -1314,7 +1327,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_with_different_type_name ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, dont_synchronize_selectors) @@ -1332,7 +1345,7 @@ TEST_F(ProjectStorageUpdater, dont_synchronize_selectors) Contains(Field(&Storage::Synchronization::Type::exportedTypes, Contains(IsExportedType(exampleModuleId, "FirstType", 1, 0)))))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_dependencies) @@ -1357,7 +1370,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_dependencies) Field(&SynchronizationPackage::updatedModuleDependencySourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_dependencies_with_double_entries) @@ -1383,7 +1396,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_dependencies_with_double_entrie Field(&SynchronizationPackage::updatedModuleDependencySourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_dependencies_with_colliding_imports) @@ -1409,7 +1422,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_dependencies_with_colliding_imp Field(&SynchronizationPackage::updatedModuleDependencySourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_with_no_dependencies) @@ -1426,7 +1439,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_with_no_dependencies) Field(&SynchronizationPackage::updatedModuleDependencySourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_imports) @@ -1468,7 +1481,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_imports) Field(&SynchronizationPackage::updatedModuleIds, ElementsAre(exampleModuleId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_with_no_imports) @@ -1482,7 +1495,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_with_no_imports) Field(&SynchronizationPackage::updatedModuleIds, ElementsAre(exampleModuleId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_imports_with_double_entries) @@ -1525,7 +1538,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_imports_with_double_entries) Field(&SynchronizationPackage::updatedModuleIds, ElementsAre(exampleModuleId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qmldir_optional_imports) @@ -1567,7 +1580,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qmldir_optional_imports) Field(&SynchronizationPackage::updatedModuleIds, ElementsAre(exampleModuleId))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_directories) @@ -1577,7 +1590,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_directories) QmlDesigner::SourceType::Directory, {path1SourceId, path2SourceId, path3SourceId}}))); - updater.update(directories3, {}, {}); + updater.update(directories3, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_directory_does_not_exists) @@ -1589,7 +1602,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_directory_does_not_exists) QmlDesigner::SourceType::Directory, {path1SourceId, path3SourceId}}))); - updater.update(directories3, {}, {}); + updater.update(directories3, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_directory_does_not_changed) @@ -1601,7 +1614,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_directory_does_not_changed) QmlDesigner::SourceType::Directory, {path1SourceId, path2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_directory_removed) @@ -1612,7 +1625,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_directory_removed) updateIdPaths(Contains( IdPaths{projectPartId, QmlDesigner::SourceType::Directory, {path2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qmldirs) @@ -1622,7 +1635,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmldirs) QmlDesigner::SourceType::QmlDir, {qmldir1SourceId, qmldir2SourceId, qmldir3SourceId}}))); - updater.update(directories3, {}, {}); + updater.update(directories3, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qmldir_does_not_exists) @@ -1634,7 +1647,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmldir_does_not_exists) QmlDesigner::SourceType::QmlDir, {qmldir1SourceId, qmldir3SourceId}}))); - updater.update(directories3, {}, {}); + updater.update(directories3, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qmldir_does_not_changed) @@ -1646,7 +1659,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmldir_does_not_changed) QmlDesigner::SourceType::QmlDir, {qmldir1SourceId, qmldir2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qmldir_removed) @@ -1657,7 +1670,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmldir_removed) updateIdPaths(Contains( IdPaths{projectPartId, QmlDesigner::SourceType::QmlDir, {qmldir2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qml_files) @@ -1674,7 +1687,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qml_files) QmlDesigner::SourceType::Qml, {firstSourceId, secondSourceId, thirdSourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_only_qml_files_dont_changed) @@ -1692,7 +1705,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_only_qml_files_dont_changed) QmlDesigner::SourceType::Qml, {firstSourceId, secondSourceId, thirdSourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_only_qml_files_changed) @@ -1710,7 +1723,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_only_qml_files_changed) QmlDesigner::SourceType::Qml, {firstSourceId, secondSourceId, thirdSourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qml_files_and_directories_dont_changed) @@ -1733,7 +1746,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qml_files_and_directories_dont QmlDesigner::SourceType::Qml, {firstSourceId, secondSourceId, thirdSourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qmltypes_files_in_qmldir) @@ -1752,7 +1765,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmltypes_files_in_qmldir) QmlDesigner::SourceType::QmlTypes, {qmltypes1SourceId, qmltypes2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_only_qmltypes_files_in_qmldir_dont_changed) @@ -1770,7 +1783,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_only_qmltypes_files_in_qmldir_ QmlDesigner::SourceType::QmlTypes, {qmltypes1SourceId, qmltypes2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_only_qmltypes_files_changed) @@ -1787,7 +1800,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_only_qmltypes_files_changed) QmlDesigner::SourceType::QmlTypes, {qmltypes1SourceId, qmltypes2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_qmltypes_files_and_directories_dont_changed) @@ -1808,7 +1821,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmltypes_files_and_directories QmlDesigner::SourceType::QmlTypes, {qmltypes1SourceId, qmltypes2SourceId}}))); - updater.update(directories2, {}, {}); + updater.update(directories2, {}, {}, {}); } TEST_F(ProjectStorageUpdater, update_path_watcher_builtin_qmltypes_files) @@ -1823,7 +1836,7 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_builtin_qmltypes_files) QmlDesigner::SourceType::QmlTypes, {qmltypes1SourceId, qmltypes2SourceId}}))); - updater.update({}, {builtinQmltyplesPath1, builtinQmltyplesPath2}, {}); + updater.update({}, {builtinQmltyplesPath1, builtinQmltyplesPath2}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir) @@ -1890,7 +1903,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir) ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if_qml_document_does_not_exists) @@ -1898,7 +1911,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if setFilesDontExists({qmlDirPathSourceId, qmlDocumentSourceId1}); setFilesAdded({directoryPathSourceId}); - ASSERT_THROW(updater.update(directories, {}, {}), QmlDesigner::CannotParseQmlDocumentFile); + ASSERT_THROW(updater.update(directories, {}, {}, {}), QmlDesigner::CannotParseQmlDocumentFile); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if_directory_does_not_exists) @@ -1928,7 +1941,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if UnorderedElementsAre(directoryPathSourceId)), Field(&SynchronizationPackage::projectDatas, IsEmpty())))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_add_qml_document) @@ -1977,7 +1990,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_add_qml_d ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_removes_qml_document) @@ -2016,7 +2029,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_removes_q ModuleId{}, FileType::QmlDocument)))))); - updater.update(directories, {}, {}); + updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, watcher_updates_directories) @@ -3475,7 +3488,7 @@ TEST_F(ProjectStorageUpdater, update_property_editor_panes) Field(&SynchronizationPackage::updatedPropertyEditorQmlPathSourceIds, ElementsAre(directoryId))))); - updater.update({}, {}, propertyEditorQmlPath); + updater.update({}, {}, propertyEditorQmlPath, {}); } TEST_F(ProjectStorageUpdater, update_property_editor_specifics) @@ -3500,12 +3513,12 @@ TEST_F(ProjectStorageUpdater, update_property_editor_specifics) Field(&SynchronizationPackage::updatedPropertyEditorQmlPathSourceIds, ElementsAre(directoryId))))); - updater.update({}, {}, propertyEditorQmlPath); + updater.update({}, {}, propertyEditorQmlPath, {}); } TEST_F(ProjectStorageUpdater, update_property_editor_panes_is_empty_if_directory_has_not_changed) { - updater.update({}, {}, propertyEditorQmlPath); + updater.update({}, {}, propertyEditorQmlPath, {}); ON_CALL(fileSystemMock, fileStatus(_)).WillByDefault([](SourceId sourceId) { return FileStatus{sourceId, 1, 21}; }); @@ -3515,7 +3528,135 @@ TEST_F(ProjectStorageUpdater, update_property_editor_panes_is_empty_if_directory EXPECT_CALL(projectStorageMock, synchronize(PackageIsEmpty())); - updater.update({}, {}, propertyEditorQmlPath); + updater.update({}, {}, propertyEditorQmlPath, {}); +} + +TEST_F(ProjectStorageUpdater, update_type_annotations) +{ + auto itemSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/quick.metainfo"}); + auto buttonSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/qtquickcontrols2.metainfo"}); + setFilesChanged({itemLibraryPathSourceId, itemSourceId, buttonSourceId}); + auto qtQuickModuleId = moduleId("QtQuick"); + auto qtQuickControlsModuleId = moduleId("QtQuick.Controls.Basic"); + QmlDesigner::Storage::TypeTraits itemTraits; + itemTraits.canBeContainer = QmlDesigner::FlagIs::True; + + EXPECT_CALL(projectStorageMock, + synchronize(AllOf(Field(&SynchronizationPackage::typeAnnotations, + IsSupersetOf({IsTypeAnnotation(itemSourceId, + itemLibraryPathSourceId, + "Item", + qtQuickModuleId, + StartsWith(itemLibraryPath), + _, + _, + _), + IsTypeAnnotation(buttonSourceId, + itemLibraryPathSourceId, + "Button", + qtQuickControlsModuleId, + StartsWith(itemLibraryPath), + _, + _, + _)})), + Field(&SynchronizationPackage::updatedTypeAnnotationSourceIds, + IsSupersetOf({itemSourceId, buttonSourceId}))))); + + updater.update({}, {}, {}, {itemLibraryPath}); +} + +TEST_F(ProjectStorageUpdater, update_changed_type_annotation) +{ + auto itemSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/quick.metainfo"}); + auto buttonSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/qtquickcontrols2.metainfo"}); + setFilesDontChanged({itemLibraryPathSourceId}); + setFilesChanged({itemSourceId, buttonSourceId}); + auto qtQuickModuleId = moduleId("QtQuick"); + auto qtQuickControlsModuleId = moduleId("QtQuick.Controls.Basic"); + QmlDesigner::Storage::TypeTraits itemTraits; + itemTraits.canBeContainer = QmlDesigner::FlagIs::True; + + EXPECT_CALL(projectStorageMock, + synchronize(AllOf(Field(&SynchronizationPackage::typeAnnotations, + IsSupersetOf({IsTypeAnnotation(itemSourceId, + itemLibraryPathSourceId, + "Item", + qtQuickModuleId, + StartsWith(itemLibraryPath), + _, + _, + _), + IsTypeAnnotation(buttonSourceId, + itemLibraryPathSourceId, + "Button", + qtQuickControlsModuleId, + StartsWith(itemLibraryPath), + _, + _, + _)})), + Field(&SynchronizationPackage::updatedTypeAnnotationSourceIds, + IsSupersetOf({itemSourceId, buttonSourceId}))))); + + updater.update({}, {}, {}, {itemLibraryPath}); +} + +TEST_F(ProjectStorageUpdater, update_type_annotations_removed_meta_info_file) +{ + ON_CALL(fileSystemMock, fileStatus(_)).WillByDefault([](SourceId sourceId) { + return FileStatus{sourceId, 1, 21}; + }); + ON_CALL(projectStorageMock, fetchFileStatus(_)).WillByDefault([](SourceId sourceId) { + return FileStatus{sourceId, 1, 21}; + }); + auto itemSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/quick.metainfo"}); + auto buttonSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/qtquickcontrols2.metainfo"}); + ON_CALL(projectStorageMock, typeAnnotationDirectorySourceIds()) + .WillByDefault(Return(QmlDesigner::SmallSourceIds<64>{itemLibraryPathSourceId})); + ON_CALL(projectStorageMock, typeAnnotationSourceIds(itemLibraryPathSourceId)) + .WillByDefault(Return(QmlDesigner::SmallSourceIds<4>{itemSourceId, buttonSourceId})); + setFilesChanged({itemLibraryPathSourceId}); + setFilesDontChanged({itemSourceId, buttonSourceId}); + + EXPECT_CALL(projectStorageMock, + synchronize(AllOf(Field(&SynchronizationPackage::typeAnnotations, IsEmpty()), + Field(&SynchronizationPackage::updatedTypeAnnotationSourceIds, + IsSupersetOf({itemSourceId, buttonSourceId}))))); + + updater.update({}, {}, {}, {itemLibraryPath}); +} + +TEST_F(ProjectStorageUpdater, update_type_annotations_removed_directory) +{ + ON_CALL(fileSystemMock, fileStatus(_)).WillByDefault([](SourceId sourceId) { + return FileStatus{sourceId, 1, 21}; + }); + ON_CALL(projectStorageMock, fetchFileStatus(_)).WillByDefault([](SourceId sourceId) { + return FileStatus{sourceId, 1, 21}; + }); + auto itemSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/quick.metainfo"}); + auto buttonSourceId = sourcePathCache.sourceId( + QmlDesigner::SourcePath{itemLibraryPath + "/qtquickcontrols2.metainfo"}); + ON_CALL(projectStorageMock, typeAnnotationDirectorySourceIds()) + .WillByDefault(Return(QmlDesigner::SmallSourceIds<64>{ + itemLibraryPathSourceId, + })); + ON_CALL(projectStorageMock, typeAnnotationSourceIds(itemLibraryPathSourceId)) + .WillByDefault(Return(QmlDesigner::SmallSourceIds<4>{itemSourceId, buttonSourceId})); + setFilesDontExists({itemLibraryPathSourceId, buttonSourceId, itemSourceId}); + + EXPECT_CALL(projectStorageMock, + synchronize(AllOf(Field(&SynchronizationPackage::typeAnnotations, IsEmpty()), + Field(&SynchronizationPackage::updatedTypeAnnotationSourceIds, + IsSupersetOf({buttonSourceId, itemSourceId}))))); + + updater.update({}, {}, {}, {itemLibraryPath}); } } // namespace diff --git a/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp b/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp index ed5c1a0778b..b90a4adf1be 100644 --- a/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp @@ -3,6 +3,7 @@ #include "../utils/googletest.h" +#include #include #include @@ -11,24 +12,6 @@ namespace { -template -auto IsTypeAnnotation(QmlDesigner::SourceId sourceId, - Utils::SmallStringView typeName, - QmlDesigner::ModuleId moduleId, - Utils::SmallStringView iconPath, - QmlDesigner::Storage::TypeTraits traits, - HintsJsonMatcher hintsJsonMatcher, - ItemLibraryJsonMatcher itemLibraryJsonMatcher) -{ - using QmlDesigner::Storage::Synchronization::TypeAnnotation; - return AllOf(Field("sourceId", &TypeAnnotation::sourceId, sourceId), - Field("typeName", &TypeAnnotation::typeName, typeName), - Field("moduleId", &TypeAnnotation::moduleId, moduleId), - Field("iconPath", &TypeAnnotation::iconPath, iconPath), - Field("traits", &TypeAnnotation::traits, traits), - Field("hintsJson", &TypeAnnotation::hintsJson, hintsJsonMatcher), - Field("itemLibraryJson", &TypeAnnotation::itemLibraryJson, itemLibraryJsonMatcher)); -} class TypeAnnotationReader : public testing::Test { @@ -56,6 +39,7 @@ protected: QmlDesigner::ProjectStorage &storage = *static_projectStorage; QmlDesigner::Storage::TypeAnnotationReader reader{storage}; QmlDesigner::SourceId sourceId = QmlDesigner::SourceId::create(33); + QmlDesigner::SourceId directorySourceId = QmlDesigner::SourceId::create(77); }; TEST_F(TypeAnnotationReader, parse_type) @@ -73,10 +57,11 @@ TEST_F(TypeAnnotationReader, parse_type) })xy"}; QmlDesigner::Storage::TypeTraits traits; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, UnorderedElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -84,6 +69,7 @@ TEST_F(TypeAnnotationReader, parse_type) IsEmpty(), IsEmpty()), IsTypeAnnotation(sourceId, + directorySourceId, "Item", moduleId("QtQuick"), "/path/images/item-icon16.png", @@ -109,10 +95,11 @@ TEST_F(TypeAnnotationReader, parse_true_canBeContainer) QmlDesigner::Storage::TypeTraits traits; traits.canBeContainer = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -138,10 +125,11 @@ TEST_F(TypeAnnotationReader, parse_true_forceClip) QmlDesigner::Storage::TypeTraits traits; traits.forceClip = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -167,10 +155,11 @@ TEST_F(TypeAnnotationReader, parse_true_doesLayoutChildren) QmlDesigner::Storage::TypeTraits traits; traits.doesLayoutChildren = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -196,10 +185,11 @@ TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInFormEditor) QmlDesigner::Storage::TypeTraits traits; traits.canBeDroppedInFormEditor = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -225,10 +215,11 @@ TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInNavigator) QmlDesigner::Storage::TypeTraits traits; traits.canBeDroppedInNavigator = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -254,10 +245,11 @@ TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInView3D) QmlDesigner::Storage::TypeTraits traits; traits.canBeDroppedInView3D = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -283,10 +275,11 @@ TEST_F(TypeAnnotationReader, parse_true_isMovable) QmlDesigner::Storage::TypeTraits traits; traits.isMovable = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -312,10 +305,11 @@ TEST_F(TypeAnnotationReader, parse_true_isResizable) QmlDesigner::Storage::TypeTraits traits; traits.isResizable = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -341,10 +335,11 @@ TEST_F(TypeAnnotationReader, parse_true_hasFormEditorItem) QmlDesigner::Storage::TypeTraits traits; traits.hasFormEditorItem = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -370,10 +365,11 @@ TEST_F(TypeAnnotationReader, parse_true_isStackedContainer) QmlDesigner::Storage::TypeTraits traits; traits.isStackedContainer = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -399,10 +395,11 @@ TEST_F(TypeAnnotationReader, parse_true_takesOverRenderingOfChildren) QmlDesigner::Storage::TypeTraits traits; traits.takesOverRenderingOfChildren = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -428,10 +425,11 @@ TEST_F(TypeAnnotationReader, parse_true_visibleInNavigator) QmlDesigner::Storage::TypeTraits traits; traits.visibleInNavigator = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -457,10 +455,11 @@ TEST_F(TypeAnnotationReader, parse_true_visibleInLibrary) QmlDesigner::Storage::TypeTraits traits; traits.visibleInLibrary = FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -485,10 +484,11 @@ TEST_F(TypeAnnotationReader, parse_false) })xy"}; QmlDesigner::Storage::TypeTraits traits; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -526,10 +526,11 @@ TEST_F(TypeAnnotationReader, parse_complex_expression) QmlDesigner::Storage::TypeTraits itemTraits; itemTraits.canBeContainer = QmlDesigner::FlagIs::True; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, UnorderedElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -538,6 +539,7 @@ TEST_F(TypeAnnotationReader, parse_complex_expression) "visibleNonDefaultProperties":"layer.effect"})xy"), IsEmpty()), IsTypeAnnotation(sourceId, + directorySourceId, "Item", moduleId("QtQuick"), "/path/images/item-icon16.png", @@ -573,10 +575,11 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry) })xy"}; QmlDesigner::Storage::TypeTraits traits; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -584,12 +587,12 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry) IsEmpty(), StrippedStringEq(R"xy([ {"category":"Qt Quick - Controls 2", - "iconPath":"images/frame-icon.png", + "iconPath":"/path/images/frame-icon.png", "import":"QtQuick.Controls", "name":"Frame", "toolTip":"qsTr(\"An untitled container for a group of controls.\")"}, {"category":"Qt Quick - Controls 2", - "iconPath":"images/frame-icon.png", + "iconPath":"/path/images/frame-icon.png", "import":"QtQuick.Controls", "name":"Large Frame", "toolTip":"qsTr(\"An large container for a group of controls.\")"}] @@ -629,10 +632,11 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry_with_properties) })xy"}; QmlDesigner::Storage::TypeTraits traits; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), "/path/images/frame-icon16.png", @@ -640,13 +644,13 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry_with_properties) IsEmpty(), StrippedStringEq(R"xy([ {"category":"Qt Quick - Controls 2", - "iconPath":"images/frame-icon.png", + "iconPath":"/path/images/frame-icon.png", "import":"QtQuick.Controls", "name":"Frame", "properties":[["width","int",200.0],["height","int",100.0]], "toolTip":"qsTr(\"An untitled container for a group of controls.\")"}, {"category":"Qt Quick - Controls 2", - "iconPath":"images/frame-icon.png", + "iconPath":"/path/images/frame-icon.png", "import":"QtQuick.Controls", "name":"Large Frame", "properties":[["width","int",2000.0],["height","int",1000.0]], @@ -679,13 +683,14 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry_template_path) })xy"}; QmlDesigner::Storage::TypeTraits traits; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), - {}, + Utils::SmallStringView{}, traits, IsEmpty(), StrippedStringEq(R"xy([ @@ -693,9 +698,10 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry_template_path) "templatePath":"/path/templates/frame.qml"}] )xy")), IsTypeAnnotation(sourceId, + directorySourceId, "Item", moduleId("QtQuick"), - {}, + Utils::SmallStringView{}, traits, IsEmpty(), StrippedStringEq(R"xy([ @@ -730,13 +736,14 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry_extra_file_paths) })xy"}; QmlDesigner::Storage::TypeTraits traits; - auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId); + auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId); ASSERT_THAT(annotations, ElementsAre(IsTypeAnnotation(sourceId, + directorySourceId, "Frame", moduleId("QtQuick.Controls"), - {}, + Utils::SmallStringView{}, traits, IsEmpty(), StrippedStringEq(R"xy([ @@ -744,9 +751,10 @@ TEST_F(TypeAnnotationReader, parse_item_library_entry_extra_file_paths) "name":"Frame"}] )xy")), IsTypeAnnotation(sourceId, + directorySourceId, "Item", moduleId("QtQuick"), - {}, + Utils::SmallStringView{}, traits, IsEmpty(), StrippedStringEq(R"xy([ diff --git a/tests/unit/tests/unittests/utils/smallstring-test.cpp b/tests/unit/tests/unittests/utils/smallstring-test.cpp index 3594c838c96..71090f8760a 100644 --- a/tests/unit/tests/unittests/utils/smallstring-test.cpp +++ b/tests/unit/tests/unittests/utils/smallstring-test.cpp @@ -1326,6 +1326,19 @@ TEST(SmallString, starts_with_string_view) ASSERT_FALSE(text.startsWith('@')); } +TEST(SmallString, starts_with_qstringview) +{ + using namespace Qt::StringLiterals; + SmallString text("$column"); + + ASSERT_FALSE(text.startsWith(u"$columnxxx"_s)); + ASSERT_TRUE(text.startsWith(u"$column"_s)); + ASSERT_TRUE(text.startsWith(u"$col"_s)); + ASSERT_FALSE(text.startsWith(u"col"_s)); + ASSERT_TRUE(text.startsWith(u"$"_s)); + ASSERT_FALSE(text.startsWith(u"@"_s)); +} + TEST(SmallString, ends_with) { SmallString text("/my/path"); -- cgit v1.2.3 From b74c47ec66d99d9ade7621bdae2a76fd10be5f11 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 22 Apr 2024 14:29:50 +0200 Subject: QmlDesigner: Remove template parameter from project storage There are now other ways to prevent locking bugs. So we don't need the template parameter anymore. That makes it possible to move much of the code to a cpp file. Maybe later we have to move some functions back for performance reasons. Change-Id: I01269912618d7cf5e070219e7edaa3a00623b7cf Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Tim Jenssen Reviewed-by: Reviewed-by: Thomas Hartmann --- .../tests/unittests/projectstorage/projectstorage-test.cpp | 14 +++++++------- .../projectstorage/projectstoragepathwatcher-test.cpp | 8 ++++---- .../projectstorage/projectstorageupdater-test.cpp | 8 ++++---- .../unittests/projectstorage/qmldocumentparser-test.cpp | 4 ++-- .../tests/unittests/projectstorage/qmltypesparser-test.cpp | 4 ++-- .../unittests/projectstorage/typeannotationreader-test.cpp | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp index d16e007cc03..4034ae58f9f 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp @@ -202,7 +202,7 @@ class HasNameMatcher public: using is_gtest_matcher = void; - HasNameMatcher(const QmlDesigner::ProjectStorage &storage, + HasNameMatcher(const QmlDesigner::ProjectStorage &storage, Utils::SmallStringView name) : storage{storage} , name{name} @@ -231,7 +231,7 @@ public: void DescribeNegationTo(std::ostream *os) const { *os << "is not '" << name << "'"; } private: - const QmlDesigner::ProjectStorage &storage; + const QmlDesigner::ProjectStorage &storage; Utils::SmallStringView name; }; @@ -271,7 +271,7 @@ protected: { static_database = std::make_unique(":memory:", Sqlite::JournalMode::Memory); - static_projectStorage = std::make_unique>( + static_projectStorage = std::make_unique( *static_database, static_database->isInitialized()); } @@ -1136,9 +1136,9 @@ protected: protected: inline static std::unique_ptr static_database; Sqlite::Database &database = *static_database; - inline static std::unique_ptr> static_projectStorage; - QmlDesigner::ProjectStorage &storage = *static_projectStorage; - QmlDesigner::SourcePathCache> sourcePathCache{ + inline static std::unique_ptr static_projectStorage; + QmlDesigner::ProjectStorage &storage = *static_projectStorage; + QmlDesigner::SourcePathCache sourcePathCache{ storage}; QmlDesigner::SourcePathView path1{"/path1/to"}; QmlDesigner::SourcePathView path2{"/path2/to"}; @@ -5102,7 +5102,7 @@ TEST_F(ProjectStorage, populate_module_cache) { auto id = storage.moduleId("Qml"); - QmlDesigner::ProjectStorage newStorage{database, database.isInitialized()}; + QmlDesigner::ProjectStorage newStorage{database, database.isInitialized()}; ASSERT_THAT(newStorage.moduleName(id), Eq("Qml")); } diff --git a/tests/unit/tests/unittests/projectstorage/projectstoragepathwatcher-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstoragepathwatcher-test.cpp index d6ed96d0cfc..26d5af8af8a 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstoragepathwatcher-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstoragepathwatcher-test.cpp @@ -16,7 +16,7 @@ #include namespace { -using SourcePathCache = QmlDesigner::SourcePathCache>; +using SourcePathCache = QmlDesigner::SourcePathCache; using Watcher = QmlDesigner::ProjectStoragePathWatcher, NiceMock, SourcePathCache>; @@ -43,7 +43,7 @@ protected: { static_database = std::make_unique(":memory:", Sqlite::JournalMode::Memory); - static_projectStorage = std::make_unique>( + static_projectStorage = std::make_unique( *static_database, static_database->isInitialized()); } @@ -81,8 +81,8 @@ protected: NiceMock mockFileSystem; inline static std::unique_ptr static_database; Sqlite::Database &database = *static_database; - inline static std::unique_ptr> static_projectStorage; - QmlDesigner::ProjectStorage &storage = *static_projectStorage; + inline static std::unique_ptr static_projectStorage; + QmlDesigner::ProjectStorage &storage = *static_projectStorage; SourcePathCache pathCache{storage}; Watcher watcher{pathCache, mockFileSystem, ¬ifier}; NiceMock &mockQFileSytemWatcher = watcher.fileSystemWatcher(); diff --git a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp index a0ca9012629..96909857b32 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp @@ -144,7 +144,7 @@ public: { static_database = std::make_unique(":memory:", Sqlite::JournalMode::Memory); - static_projectStorage = std::make_unique>( + static_projectStorage = std::make_unique( *static_database, static_database->isInitialized()); } @@ -312,9 +312,9 @@ protected: QmlDesigner::FileStatusCache fileStatusCache{fileSystemMock}; inline static std::unique_ptr static_database; Sqlite::Database &database = *static_database; - inline static std::unique_ptr> static_projectStorage; - QmlDesigner::ProjectStorage &storage = *static_projectStorage; - QmlDesigner::SourcePathCache> sourcePathCache{ + inline static std::unique_ptr static_projectStorage; + QmlDesigner::ProjectStorage &storage = *static_projectStorage; + QmlDesigner::SourcePathCache sourcePathCache{ storage}; NiceMock patchWatcherMock; QmlDesigner::ProjectPartId projectPartId = QmlDesigner::ProjectPartId::create(1); diff --git a/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp b/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp index affa645330e..513fbf2ec01 100644 --- a/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/qmldocumentparser-test.cpp @@ -143,8 +143,8 @@ class QmlDocumentParser : public ::testing::Test public: protected: Sqlite::Database database{":memory:", Sqlite::JournalMode::Memory}; - QmlDesigner::ProjectStorage storage{database, database.isInitialized()}; - QmlDesigner::SourcePathCache> sourcePathCache{ + QmlDesigner::ProjectStorage storage{database, database.isInitialized()}; + QmlDesigner::SourcePathCache sourcePathCache{ storage}; QmlDesigner::QmlDocumentParser parser{storage, sourcePathCache}; Storage::Imports imports; diff --git a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp index a42a560d07d..64f3631a68f 100644 --- a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp @@ -168,8 +168,8 @@ class QmlTypesParser : public ::testing::Test public: protected: Sqlite::Database database{":memory:", Sqlite::JournalMode::Memory}; - QmlDesigner::ProjectStorage storage{database, database.isInitialized()}; - QmlDesigner::SourcePathCache> sourcePathCache{ + QmlDesigner::ProjectStorage storage{database, database.isInitialized()}; + QmlDesigner::SourcePathCache sourcePathCache{ storage}; QmlDesigner::QmlTypesParser parser{storage}; Storage::Imports imports; diff --git a/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp b/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp index b90a4adf1be..a614a5c7cf2 100644 --- a/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/typeannotationreader-test.cpp @@ -20,7 +20,7 @@ protected: { static_database = std::make_unique(":memory:", Sqlite::JournalMode::Memory); - static_projectStorage = std::make_unique>( + static_projectStorage = std::make_unique( *static_database, static_database->isInitialized()); } @@ -35,8 +35,8 @@ protected: protected: inline static std::unique_ptr static_database; Sqlite::Database &database = *static_database; - inline static std::unique_ptr> static_projectStorage; - QmlDesigner::ProjectStorage &storage = *static_projectStorage; + inline static std::unique_ptr static_projectStorage; + QmlDesigner::ProjectStorage &storage = *static_projectStorage; QmlDesigner::Storage::TypeAnnotationReader reader{storage}; QmlDesigner::SourceId sourceId = QmlDesigner::SourceId::create(33); QmlDesigner::SourceId directorySourceId = QmlDesigner::SourceId::create(77); -- cgit v1.2.3 From 59ebb8a6a70c6d0864915da05850b35e090b6ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 18 Apr 2024 21:15:00 +0200 Subject: SquishTests: Autodetect cdb Creator automatically detects the debuggers anyway and then can't handle the fixed ID. Change-Id: I732f86649b02016be2ca513c896a80ce254d721f Reviewed-by: Christian Stenger Reviewed-by: --- .../windows/QtProject/qtcreator/debuggers.xml | 19 +--------------- .../windows/QtProject/qtcreator/profiles.xml | 3 --- tests/system/shared/qtcreator.py | 26 ---------------------- 3 files changed, 1 insertion(+), 47 deletions(-) (limited to 'tests') diff --git a/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml b/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml index b8d5b705e11..64016440ae7 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml @@ -4,23 +4,6 @@ DebuggerItem.0 - - - x86-windows-msvc2015-pe-SQUISH_DEBUGGER_BITNESSbit - - true - - C:/Program Files (x86)/Windows Kits/10/Debuggers/SQUISH_DEBUGGER_ARCHITECTURE/cdb.exe - Auto-detected CDB at C:\Program Files (x86)\Windows Kits\10\Debuggers\SQUISH_DEBUGGER_ARCHITECTURE\cdb.exe - 4 - {1b25f20a-d584-4fb7-85b3-74dd15b82f6f} - - - - - - - DebuggerItem.1 x86-windows-msys-pe-unknown @@ -36,7 +19,7 @@ DebuggerItem.Count - 2 + 1 Version diff --git a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml index 1a46caa099c..ecb22a0459b 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml @@ -37,7 +37,6 @@ - {1b25f20a-d584-4fb7-85b3-74dd15b82f6f} Desktop Device Desktop @@ -65,7 +64,6 @@ - {1b25f20a-d584-4fb7-85b3-74dd15b82f6f} Desktop Device Desktop @@ -94,7 +92,6 @@ false - {1b25f20a-d584-4fb7-85b3-74dd15b82f6f} Desktop Device Desktop diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index f1d4078fb52..12d6fc364b8 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -201,31 +201,6 @@ def substituteDefaultCompiler(settingsDir): __substitute__(qtversion, "SQUISH_DEFAULT_COMPILER", compiler) test.log("Injected default compiler '%s' to qtversion.xml..." % compiler) -def substituteCdb(settingsDir): - def canUse64bitCdb(): - try: - serverIni = readFile(os.path.join(os.getenv("APPDATA"), "froglogic", - "Squish", "ver1", "server.ini")) - autLine = next(iter(filter(lambda line: "AUT/qtcreator" in line, - serverIni.splitlines()))) - autPath = autLine.split("\"")[1] - return os.path.exists(os.path.join(autPath, "..", "lib", "qtcreatorcdbext64")) - except: - test.fatal("Something went wrong when determining debugger bitness", - "Did Squish's file structure change? Guessing 32-bit cdb can be used...") - return True - - if canUse64bitCdb(): - architecture = "x64" - bitness = "64" - else: - architecture = "x86" - bitness = "32" - debuggers = os.path.join(settingsDir, "QtProject", 'qtcreator', 'debuggers.xml') - __substitute__(debuggers, "SQUISH_DEBUGGER_ARCHITECTURE", architecture) - __substitute__(debuggers, "SQUISH_DEBUGGER_BITNESS", bitness) - test.log("Injected architecture '%s' and bitness '%s' in cdb path..." % (architecture, bitness)) - def substituteMsvcPaths(settingsDir, version, targetBitness=64): if not version in ['2017', '2019']: @@ -298,7 +273,6 @@ def copySettingsToTmpDir(destination=None, omitFiles=[]): substituteTildeWithinQtVersion(tmpSettingsDir) substituteDefaultCompiler(tmpSettingsDir) elif platform.system() in ('Windows', 'Microsoft'): - substituteCdb(tmpSettingsDir) substituteMsvcPaths(tmpSettingsDir, '2017', 64) substituteMsvcPaths(tmpSettingsDir, '2017', 32) substituteMsvcPaths(tmpSettingsDir, '2019', 64) -- cgit v1.2.3 From 93d008551756abd34821f1d58cb9ee40949f5c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 19 Apr 2024 20:53:09 +0200 Subject: SquishTests: Avoid using occurrence values for OutputPaneToggleButtons The occurrence count can't be understood without looking at the running application and can even change at runtime. Change-Id: I34677fd2fe2a0a8a7f2cdcd9f37ec938efe1a5ea Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/objects.map | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index 66681c6b056..d9379812ab3 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -141,11 +141,11 @@ :Qt Creator.WelcomeScreenStackedWidget {name='WelcomeScreenStackedWidget' type='QStackedWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.replaceEdit_Utils::FilterLineEdit {name='replaceEdit' type='Utils::FancyLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {toolTip?='*Application Output*' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_BinEditor::BinEditorWidget {type='BinEditor::Internal::BinEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Bookmarks_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {occurrence='4' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {toolTip?='*Compile Output*' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::CommandComboBox {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::MainWindow {type='Utils::AppMainWindow' visible='1' windowTitle?='*Qt Creator'} :Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -159,11 +159,11 @@ :Qt Creator_Find::Internal::SearchResultTreeView {type='Core::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {toolTip?='*Issues*' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QHelpContentWidget {name='helpContentWidget' type='QTreeView' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView {type='QmlJSEditor::Internal::QmlJSOutlineTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::QmlJSEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {toolTip?='*Search Results*' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_TextEditor::TextEditorWidget {type='TextEditor::TextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::BuildDirectoryLineEdit {name='LineEdit' type='Utils::FancyLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {name='projectTreeView' type='QTreeView' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -- cgit v1.2.3 From 457488a1065889c238e3f3d747de9eede67dbe93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Mon, 22 Apr 2024 12:15:33 +0200 Subject: SquishTests: Avoid using occurrence value for IconButton Change-Id: I0a4d9497801dbd39c2c735cac760c5dc6a0298fd Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/objects.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index d9379812ab3..dd5db34925c 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -12,7 +12,7 @@ :*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FancyLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Core::Internal::FancyToolButton {name='KitSelector.Button' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Utils::FilterLineEdit {type='Utils::FancyLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator_Utils::IconButton {occurrence='5' type='Utils::FancyIconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:*Qt Creator_Utils::IconButton {toolTip='Clear text' type='Utils::FancyIconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :About Qt Creator_Core::Internal::VersionDialog {type='Core::Internal::VersionDialog' unnamed='1' visible='1' windowTitle='About Qt Creator'} :Activate completion:_QComboBox {buddy=':Behavior.Activate completion:_QLabel' type='QComboBox' unnamed='1' visible='1'} :Add Bookmark.ExpandBookmarksList_QToolButton {text='+' type='QToolButton' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'} -- cgit v1.2.3 From ec33fc0476413e7f79fae24834755374b6b7bacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Mon, 22 Apr 2024 13:00:52 +0200 Subject: SquishTests: Avoid using occurrence value for SideDiffEditorWidgets Change-Id: I7c519347a25b0c541b019dd1cae65df4a74c8826 Reviewed-by: Christian Stenger Reviewed-by: --- tests/system/objects.map | 4 ++-- tests/system/suite_tools/tst_git_first_commit/test.py | 2 +- tests/system/suite_tools/tst_git_local/test.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index dd5db34925c..bd8c30bce2d 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -153,8 +153,8 @@ :Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::CppEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_DiffEditor::Internal::DescriptionEditorWidget {type='DiffEditor::Internal::DescriptionEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_DiffEditor::SideDiffEditorWidget {type='DiffEditor::Internal::SideDiffEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_DiffEditor::SideDiffEditorWidget2 {occurrence='2' type='DiffEditor::Internal::SideDiffEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_DiffEditor::SideDiffEditorWidgetChanged {type='DiffEditor::Internal::SideDiffEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' x~='[1-9][0-9]*'} +:Qt Creator_DiffEditor::SideDiffEditorWidgetOriginal {type='DiffEditor::Internal::SideDiffEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' x='0'} :Qt Creator_FilenameQComboBox {leftWidget=':Qt Creator.DragDoc_QToolButton' type='QComboBox' unnamed='1' visible='1'} :Qt Creator_Find::Internal::SearchResultTreeView {type='Core::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/suite_tools/tst_git_first_commit/test.py b/tests/system/suite_tools/tst_git_first_commit/test.py index 1ef7090602b..0ee8f2505bf 100644 --- a/tests/system/suite_tools/tst_git_first_commit/test.py +++ b/tests/system/suite_tools/tst_git_first_commit/test.py @@ -35,7 +35,7 @@ def main(): test.verify(" files changed, 229938 insertions(+)" in commitDetails, "Summary in details view?") clickButton(waitForObject(":Select a Git Commit.Show_QPushButton")) - changedEdit = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget") + changedEdit = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidgetChanged") waitFor("len(str(changedEdit.plainText)) > 0 and " "str(changedEdit.plainText) != 'Waiting for data...'", 40000) diffPlainText = str(changedEdit.plainText) diff --git a/tests/system/suite_tools/tst_git_local/test.py b/tests/system/suite_tools/tst_git_local/test.py index c74ad6e20cf..1c9cd01712a 100644 --- a/tests/system/suite_tools/tst_git_local/test.py +++ b/tests/system/suite_tools/tst_git_local/test.py @@ -105,8 +105,8 @@ def verifyClickCommit(): for i in range(1, 3): if not __clickCommit__(i): continue - changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget") - original = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget2") + changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidgetChanged") + original = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidgetOriginal") waitFor('str(changed.plainText) != "Waiting for data..." ' 'and str(original.plainText) != "Waiting for data..."', 5000) # content of diff editors is merge of modified files @@ -202,7 +202,7 @@ def main(): type(gitEditor, "") rect = gitEditor.cursorRect(gitEditor.textCursor()) mouseClick(gitEditor, rect.x+rect.width/2, rect.y+rect.height/2, 0, Qt.LeftButton) - changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget") + changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidgetChanged") waitFor('str(changed.plainText) != "Waiting for data..."', 5000) test.compare(str(changed.plainText), "Retrieving data failed.", "Showing an invalid commit can't succeed but Creator survived.") -- cgit v1.2.3 From facd32b2e07b3d2a13f26b99ed08ccf1eb174397 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 23 Apr 2024 08:54:37 +0200 Subject: SquishTests: Remove duplicate object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7ceed8ef40684323b8404c3fe7c529fbd5b7be74 Reviewed-by: Robert Löhning --- tests/system/objects.map | 4 +--- tests/system/shared/project.py | 2 +- tests/system/suite_debugger/tst_debug_empty_main/test.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index bd8c30bce2d..6ad38f58318 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -92,7 +92,6 @@ :JsonWizard_ProjectExplorer::JsonFieldPage {type='ProjectExplorer::JsonFieldPage' unnamed='1' visible='1' window=':New_ProjectExplorer::JsonWizard'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':QtVersionLabel_KitPage' type='QComboBox' unnamed='1' visible='1'} :Locals and Expressions_Debugger::Internal::WatchTreeView {container=':Debugger.Docks.LocalsAndWatchersDockWidget.Inspector_QFrame' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1'} -:New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New_ProjectExplorer::JsonWizard'} :New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit {name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'} :New.comboBox_QComboBox {type='QComboBox' unnamed='1' visible='1' window=':New_Core::Internal::NewDialog'} :New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'} @@ -205,8 +204,7 @@ :headerFileLineEdit_Utils::FileNameValidatingLineEdit {name='HdrFileName' type='Utils::FancyLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'} :popupFrame_Proposal_QListView {container=':popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'} :popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'} -:projectComboBox_QComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'} -:projectComboBox_Utils::TreeViewComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'} +:projectComboBox_QComboBox {name='projectComboBox' type='QComboBox' visible='1'} :qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'} :qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'} :qt_tabwidget_stackedwidget_QScrollArea {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'} diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 2ff44dc3737..cdf5290d895 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -662,7 +662,7 @@ def addCPlusPlusFile(name, template, projectName, forceOverwrite=False, addToVCS test.compare(str(waitForObject("{name='HdrFileName' type='QLineEdit' visible='1'}").text), expectedHeaderName) clickButton(waitForObject(":Next_QPushButton")) - projectComboBox = waitForObjectExists(":projectComboBox_Utils::TreeViewComboBox") + projectComboBox = waitForObjectExists(":projectComboBox_QComboBox") test.compare(projectComboBox.enabled, projectName != None, "Project combo box must be enabled when a project is open") projectNameToDisplay = "" diff --git a/tests/system/suite_debugger/tst_debug_empty_main/test.py b/tests/system/suite_debugger/tst_debug_empty_main/test.py index 019b55e5f00..d62f76cdebf 100644 --- a/tests/system/suite_debugger/tst_debug_empty_main/test.py +++ b/tests/system/suite_debugger/tst_debug_empty_main/test.py @@ -14,8 +14,7 @@ def addFileToProject(projectPath, category, fileTemplate, fileName): projectPath, "Verifying whether path is correct."): replaceEditorContent(pathLineEdit, projectPath) clickButton(waitForObject(":Next_QPushButton")) - projCombo = findObject("{buddy={name='projectLabel' text='Add to project:' type='QLabel' " - "visible='1'} name='projectComboBox' type='QComboBox' visible='1'}") + projCombo = waitForObjectExists(":projectComboBox_QComboBox", 1000) proFileName = os.path.basename(projectPath) + ".pro" test.verify(not selectFromCombo(projCombo, proFileName), "Verifying project is selected.") __createProjectHandleLastPage__() -- cgit v1.2.3