QmlDesigner.itemLibraryInfo: add qml property for library

Change-Id: I986cef3a15d6332f1dcf7c0ca4cd035cc0751e76
Reviewed-on: http://codereview.qt.nokia.com/719
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Thomas Hartmann
2011-06-24 16:09:46 +02:00
parent 8102f3f6d2
commit ad80aa20ae
2 changed files with 15 additions and 0 deletions

View File

@@ -227,6 +227,7 @@ QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibrary
stream << itemLibraryEntry.forceImport();
stream << itemLibraryEntry.m_data->properties;
stream << itemLibraryEntry.m_data->qml;
return stream;
}
@@ -245,6 +246,7 @@ QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry)
stream >> itemLibraryEntry.m_data->forceImport;
stream >> itemLibraryEntry.m_data->properties;
stream >> itemLibraryEntry.m_data->qml;
return stream;
}

View File

@@ -163,6 +163,7 @@ void MetaInfoParser::handleNodeItemLibraryEntryElement(QXmlStreamReader &reader,
while (!reader.atEnd() && !(reader.isEndElement() && reader.name() == "itemlibraryentry")) {
reader.readNext();
handleItemLibraryEntryPropertyElement(reader, entry);
handleItemLibraryEntryQmlElement(reader, entry);
}
m_metaInfo.itemLibraryInfo()->addEntry(entry);
@@ -183,6 +184,18 @@ void MetaInfoParser::handleItemLibraryEntryPropertyElement(QXmlStreamReader &rea
}
}
void MetaInfoParser::handleItemLibraryEntryQmlElement(QXmlStreamReader &reader, ItemLibraryEntry &itemLibraryEntry)
{
if (reader.isStartElement() && reader.name() == "qml")
{
QXmlStreamAttributes attributes(reader.attributes());
QString source = attributes.value("source").toString();
itemLibraryEntry.setQml(source);
reader.readNext();
}
}
void MetaInfoParser::errorHandling(QXmlStreamReader &reader, QFile &file)
{
if (!reader.hasError())