forked from qt-creator/qt-creator
QmlDesigner: Type annotaion reader set defaults
So far the defaults were false but some of the are true. Task-number: QDS-12663 Change-Id: I710913ed371d6e094cf68c154bb9353c21ee0c16 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -180,6 +180,11 @@ TypeAnnotationReader::ParserSate TypeAnnotationReader::readMetaInfoRootElement(c
|
|||||||
if (name == typeElementName) {
|
if (name == typeElementName) {
|
||||||
auto &annotation = m_typeAnnotations.emplace_back(m_sourceId, m_directorySourceId);
|
auto &annotation = m_typeAnnotations.emplace_back(m_sourceId, m_directorySourceId);
|
||||||
annotation.traits.canBeDroppedInFormEditor = FlagIs::True;
|
annotation.traits.canBeDroppedInFormEditor = FlagIs::True;
|
||||||
|
annotation.traits.canBeDroppedInNavigator = FlagIs::True;
|
||||||
|
annotation.traits.isMovable = FlagIs::True;
|
||||||
|
annotation.traits.isResizable = FlagIs::True;
|
||||||
|
annotation.traits.hasFormEditorItem = FlagIs::True;
|
||||||
|
annotation.traits.visibleInLibrary = FlagIs::True;
|
||||||
m_itemLibraryEntries = json::array();
|
m_itemLibraryEntries = json::array();
|
||||||
|
|
||||||
return ParsingType;
|
return ParsingType;
|
||||||
|
@@ -17,7 +17,15 @@ using QmlDesigner::FlagIs;
|
|||||||
class TypeAnnotationReader : public testing::Test
|
class TypeAnnotationReader : public testing::Test
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
TypeAnnotationReader() { traits.canBeDroppedInFormEditor = FlagIs::True; }
|
TypeAnnotationReader()
|
||||||
|
{
|
||||||
|
traits.canBeDroppedInFormEditor = FlagIs::True;
|
||||||
|
traits.canBeDroppedInNavigator = FlagIs::True;
|
||||||
|
traits.isMovable = FlagIs::True;
|
||||||
|
traits.isResizable = FlagIs::True;
|
||||||
|
traits.hasFormEditorItem = FlagIs::True;
|
||||||
|
traits.visibleInLibrary = FlagIs::True;
|
||||||
|
}
|
||||||
static void SetUpTestSuite()
|
static void SetUpTestSuite()
|
||||||
{
|
{
|
||||||
static_database = std::make_unique<Sqlite::Database>(":memory:", Sqlite::JournalMode::Memory);
|
static_database = std::make_unique<Sqlite::Database>(":memory:", Sqlite::JournalMode::Memory);
|
||||||
@@ -170,7 +178,7 @@ TEST_F(TypeAnnotationReader, parse_true_doesLayoutChildren)
|
|||||||
IsEmpty())));
|
IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInFormEditor)
|
TEST_F(TypeAnnotationReader, parse_false_canBeDroppedInFormEditor)
|
||||||
{
|
{
|
||||||
using QmlDesigner::FlagIs;
|
using QmlDesigner::FlagIs;
|
||||||
auto content = QString{R"xy(
|
auto content = QString{R"xy(
|
||||||
@@ -199,7 +207,7 @@ TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInFormEditor)
|
|||||||
IsEmpty())));
|
IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInNavigator)
|
TEST_F(TypeAnnotationReader, parse_false_canBeDroppedInNavigator)
|
||||||
{
|
{
|
||||||
using QmlDesigner::FlagIs;
|
using QmlDesigner::FlagIs;
|
||||||
auto content = QString{R"xy(
|
auto content = QString{R"xy(
|
||||||
@@ -209,11 +217,11 @@ TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInNavigator)
|
|||||||
icon: "images/frame-icon16.png"
|
icon: "images/frame-icon16.png"
|
||||||
|
|
||||||
Hints {
|
Hints {
|
||||||
canBeDroppedInNavigator: true
|
canBeDroppedInNavigator: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})xy"};
|
})xy"};
|
||||||
traits.canBeDroppedInNavigator = FlagIs::True;
|
traits.canBeDroppedInNavigator = FlagIs::False;
|
||||||
|
|
||||||
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
||||||
|
|
||||||
@@ -257,7 +265,7 @@ TEST_F(TypeAnnotationReader, parse_true_canBeDroppedInView3D)
|
|||||||
IsEmpty())));
|
IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TypeAnnotationReader, parse_true_isMovable)
|
TEST_F(TypeAnnotationReader, parse_false_isMovable)
|
||||||
{
|
{
|
||||||
using QmlDesigner::FlagIs;
|
using QmlDesigner::FlagIs;
|
||||||
auto content = QString{R"xy(
|
auto content = QString{R"xy(
|
||||||
@@ -267,11 +275,11 @@ TEST_F(TypeAnnotationReader, parse_true_isMovable)
|
|||||||
icon: "images/frame-icon16.png"
|
icon: "images/frame-icon16.png"
|
||||||
|
|
||||||
Hints {
|
Hints {
|
||||||
isMovable: true
|
isMovable: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})xy"};
|
})xy"};
|
||||||
traits.isMovable = FlagIs::True;
|
traits.isMovable = FlagIs::False;
|
||||||
|
|
||||||
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
||||||
|
|
||||||
@@ -286,7 +294,7 @@ TEST_F(TypeAnnotationReader, parse_true_isMovable)
|
|||||||
IsEmpty())));
|
IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TypeAnnotationReader, parse_true_isResizable)
|
TEST_F(TypeAnnotationReader, parse_false_isResizable)
|
||||||
{
|
{
|
||||||
using QmlDesigner::FlagIs;
|
using QmlDesigner::FlagIs;
|
||||||
auto content = QString{R"xy(
|
auto content = QString{R"xy(
|
||||||
@@ -296,11 +304,11 @@ TEST_F(TypeAnnotationReader, parse_true_isResizable)
|
|||||||
icon: "images/frame-icon16.png"
|
icon: "images/frame-icon16.png"
|
||||||
|
|
||||||
Hints {
|
Hints {
|
||||||
isResizable: true
|
isResizable: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})xy"};
|
})xy"};
|
||||||
traits.isResizable = FlagIs::True;
|
traits.isResizable = FlagIs::False;
|
||||||
|
|
||||||
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
||||||
|
|
||||||
@@ -315,7 +323,7 @@ TEST_F(TypeAnnotationReader, parse_true_isResizable)
|
|||||||
IsEmpty())));
|
IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TypeAnnotationReader, parse_true_hasFormEditorItem)
|
TEST_F(TypeAnnotationReader, parse_false_hasFormEditorItem)
|
||||||
{
|
{
|
||||||
using QmlDesigner::FlagIs;
|
using QmlDesigner::FlagIs;
|
||||||
auto content = QString{R"xy(
|
auto content = QString{R"xy(
|
||||||
@@ -325,11 +333,11 @@ TEST_F(TypeAnnotationReader, parse_true_hasFormEditorItem)
|
|||||||
icon: "images/frame-icon16.png"
|
icon: "images/frame-icon16.png"
|
||||||
|
|
||||||
Hints {
|
Hints {
|
||||||
hasFormEditorItem: true
|
hasFormEditorItem: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})xy"};
|
})xy"};
|
||||||
traits.hasFormEditorItem = FlagIs::True;
|
traits.hasFormEditorItem = FlagIs::False;
|
||||||
|
|
||||||
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
||||||
|
|
||||||
@@ -431,7 +439,7 @@ TEST_F(TypeAnnotationReader, parse_true_visibleInNavigator)
|
|||||||
IsEmpty())));
|
IsEmpty())));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TypeAnnotationReader, parse_true_visibleInLibrary)
|
TEST_F(TypeAnnotationReader, parse_false_visibleInLibrary)
|
||||||
{
|
{
|
||||||
using QmlDesigner::FlagIs;
|
using QmlDesigner::FlagIs;
|
||||||
auto content = QString{R"xy(
|
auto content = QString{R"xy(
|
||||||
@@ -441,11 +449,11 @@ TEST_F(TypeAnnotationReader, parse_true_visibleInLibrary)
|
|||||||
icon: "images/frame-icon16.png"
|
icon: "images/frame-icon16.png"
|
||||||
|
|
||||||
Hints {
|
Hints {
|
||||||
visibleInLibrary: true
|
visibleInLibrary: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})xy"};
|
})xy"};
|
||||||
traits.visibleInLibrary = FlagIs::True;
|
traits.visibleInLibrary = FlagIs::False;
|
||||||
|
|
||||||
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
||||||
|
|
||||||
@@ -470,11 +478,10 @@ TEST_F(TypeAnnotationReader, parse_false)
|
|||||||
icon: "images/frame-icon16.png"
|
icon: "images/frame-icon16.png"
|
||||||
|
|
||||||
Hints {
|
Hints {
|
||||||
isMovable: false
|
isMovable: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})xy"};
|
})xy"};
|
||||||
traits.canBeDroppedInFormEditor = FlagIs::True;
|
|
||||||
|
|
||||||
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
auto annotations = reader.parseTypeAnnotation(content, "/path", sourceId, directorySourceId);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user