Commit ad80aa20 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.itemLibraryInfo: add qml property for library

Change-Id: I986cef3a15d6332f1dcf7c0ca4cd035cc0751e76
Reviewed-on: http://codereview.qt.nokia.com/719

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 8102f3f6
......@@ -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;
}
......
......@@ -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())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment