Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
70ffe0c2
Commit
70ffe0c2
authored
May 16, 2011
by
Thomas Hartmann
Browse files
QmlDesigner.metaInfo: extending itemlibrary info
I added forceImport.
parent
b9ff6032
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h
View file @
70ffe0c2
...
...
@@ -72,6 +72,7 @@ public:
QIcon
dragIcon
()
const
;
QString
qml
()
const
;
QString
requiredImport
()
const
;
bool
forceImport
()
const
;
ItemLibraryEntry
(
const
ItemLibraryEntry
&
other
);
ItemLibraryEntry
&
operator
=
(
const
ItemLibraryEntry
&
other
);
...
...
@@ -90,6 +91,7 @@ public:
void
setCategory
(
const
QString
&
category
);
void
setQml
(
const
QString
&
qml
);
void
setRequiredImport
(
const
QString
&
requiredImport
);
void
setForceImport
(
bool
b
);
private:
QExplicitlySharedDataPointer
<
Internal
::
ItemLibraryEntryData
>
m_data
;
};
...
...
src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp
View file @
70ffe0c2
...
...
@@ -55,6 +55,7 @@ public:
QList
<
PropertyContainer
>
properties
;
QString
qml
;
QString
requiredImport
;
bool
forceImport
;
};
class
ItemLibraryInfoPrivate
...
...
@@ -138,6 +139,11 @@ QString ItemLibraryEntry::requiredImport() const
return
m_data
->
requiredImport
;
}
bool
ItemLibraryEntry
::
forceImport
()
const
{
return
m_data
->
forceImport
;
}
int
ItemLibraryEntry
::
majorVersion
()
const
{
return
m_data
->
majorVersion
;
...
...
@@ -195,6 +201,11 @@ void ItemLibraryEntry::setRequiredImport(const QString &requiredImport)
m_data
->
requiredImport
=
requiredImport
;
}
void
ItemLibraryEntry
::
setForceImport
(
bool
b
)
{
m_data
->
forceImport
=
b
;
}
void
ItemLibraryEntry
::
addProperty
(
QString
&
name
,
QString
&
type
,
QString
&
value
)
{
Property
property
;
...
...
@@ -213,6 +224,7 @@ QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibrary
stream
<<
itemLibraryEntry
.
category
();
stream
<<
itemLibraryEntry
.
dragIcon
();
stream
<<
itemLibraryEntry
.
requiredImport
();
stream
<<
itemLibraryEntry
.
forceImport
();
stream
<<
itemLibraryEntry
.
m_data
->
properties
;
...
...
@@ -230,6 +242,7 @@ QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry)
stream
>>
itemLibraryEntry
.
m_data
->
category
;
stream
>>
itemLibraryEntry
.
m_data
->
dragIcon
;
stream
>>
itemLibraryEntry
.
m_data
->
requiredImport
;
stream
>>
itemLibraryEntry
.
m_data
->
forceImport
;
stream
>>
itemLibraryEntry
.
m_data
->
properties
;
...
...
src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
View file @
70ffe0c2
...
...
@@ -150,6 +150,16 @@ void MetaInfoParser::handleNodeItemLibraryEntryElement(QXmlStreamReader &reader,
if
(
!
requiredImport
.
isEmpty
())
entry
.
setRequiredImport
(
requiredImport
);
if
(
reader
.
attributes
().
hasAttribute
(
"forceImport"
))
{
QString
forceImport
=
reader
.
attributes
().
value
(
"forceImport"
).
toString
();
if
(
forceImport
==
QLatin1String
(
"true"
)
||
forceImport
==
QLatin1String
(
"True"
))
entry
.
setForceImport
(
true
);
else
entry
.
setForceImport
(
false
);
}
else
{
entry
.
setForceImport
(
false
);
}
while
(
!
reader
.
atEnd
()
&&
!
(
reader
.
isEndElement
()
&&
reader
.
name
()
==
"itemlibraryentry"
))
{
reader
.
readNext
();
handleItemLibraryEntryPropertyElement
(
reader
,
entry
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment