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
Tobias Hunger
qt-creator
Commits
1f4e6b79
Commit
1f4e6b79
authored
Dec 09, 2010
by
Thomas Hartmann
Browse files
QmlDesigner.itemLibrary: add requiredImport
parent
3f283dbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h
View file @
1f4e6b79
...
...
@@ -68,6 +68,7 @@ public:
QString
category
()
const
;
QIcon
dragIcon
()
const
;
QString
qml
()
const
;
QString
requiredImport
()
const
;
ItemLibraryEntry
(
const
ItemLibraryEntry
&
other
);
ItemLibraryEntry
&
operator
=
(
const
ItemLibraryEntry
&
other
);
...
...
@@ -85,6 +86,7 @@ public:
void
setIcon
(
const
QIcon
&
icon
);
void
setCategory
(
const
QString
&
category
);
void
setQml
(
const
QString
&
qml
);
void
setRequiredImport
(
const
QString
&
requiredImport
);
private:
QExplicitlySharedDataPointer
<
Internal
::
ItemLibraryEntryData
>
m_data
;
};
...
...
src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp
View file @
1f4e6b79
...
...
@@ -51,6 +51,7 @@ public:
QIcon
dragIcon
;
QList
<
PropertyContainer
>
properties
;
QString
qml
;
QString
requiredImport
;
};
class
ItemLibraryInfoPrivate
...
...
@@ -129,6 +130,11 @@ QString ItemLibraryEntry::qml() const
return
m_data
->
qml
;
}
QString
ItemLibraryEntry
::
requiredImport
()
const
{
return
m_data
->
requiredImport
;
}
int
ItemLibraryEntry
::
majorVersion
()
const
{
return
m_data
->
majorVersion
;
...
...
@@ -181,6 +187,11 @@ void ItemLibraryEntry::setQml(const QString &qml)
m_data
->
qml
=
qml
;
}
void
ItemLibraryEntry
::
setRequiredImport
(
const
QString
&
requiredImport
)
{
m_data
->
requiredImport
=
requiredImport
;
}
void
ItemLibraryEntry
::
addProperty
(
QString
&
name
,
QString
&
type
,
QString
&
value
)
{
Property
property
;
...
...
@@ -198,6 +209,8 @@ QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibrary
stream
<<
itemLibraryEntry
.
iconPath
();
stream
<<
itemLibraryEntry
.
category
();
stream
<<
itemLibraryEntry
.
dragIcon
();
stream
<<
itemLibraryEntry
.
requiredImport
();
stream
<<
itemLibraryEntry
.
m_data
->
properties
;
return
stream
;
...
...
@@ -213,6 +226,8 @@ QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry)
stream
>>
itemLibraryEntry
.
m_data
->
iconPath
;
stream
>>
itemLibraryEntry
.
m_data
->
category
;
stream
>>
itemLibraryEntry
.
m_data
->
dragIcon
;
stream
>>
itemLibraryEntry
.
m_data
->
requiredImport
;
stream
>>
itemLibraryEntry
.
m_data
->
properties
;
return
stream
;
...
...
src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
View file @
1f4e6b79
...
...
@@ -143,6 +143,12 @@ void MetaInfoParser::handleNodeItemLibraryEntryElement(QXmlStreamReader &reader,
if
(
!
category
.
isEmpty
())
entry
.
setCategory
(
category
);
QString
requiredImport
=
reader
.
attributes
().
value
(
"requiredImport"
).
toString
();
if
(
!
requiredImport
.
isEmpty
())
entry
.
setRequiredImport
(
requiredImport
);
qDebug
()
<<
entry
.
requiredImport
();
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