forked from qt-creator/qt-creator
QmlDesigner: setType also gets defaults
Change-Id: Ibdef1f5979515e53d225d3966a4b23ce0f4d9a79 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -76,7 +76,7 @@ public:
|
|||||||
|
|
||||||
QList<Property> properties() const;
|
QList<Property> properties() const;
|
||||||
|
|
||||||
void setType(const TypeName &typeName, int majorVersion, int minorVersion);
|
void setType(const TypeName &typeName, int majorVersion = -1, int minorVersion = -1);
|
||||||
void setName(const QString &name);
|
void setName(const QString &name);
|
||||||
void setLibraryEntryIconPath(const QString &libraryEntryIconPath);
|
void setLibraryEntryIconPath(const QString &libraryEntryIconPath);
|
||||||
void addProperty(const Property &p);
|
void addProperty(const Property &p);
|
||||||
|
@@ -160,7 +160,7 @@ MetaInfoReader::ParserSate MetaInfoReader::readTypeElement(const QString &name)
|
|||||||
{
|
{
|
||||||
if (name == ItemLibraryEntryElementName) {
|
if (name == ItemLibraryEntryElementName) {
|
||||||
m_currentEntry = ItemLibraryEntry();
|
m_currentEntry = ItemLibraryEntry();
|
||||||
m_currentEntry.setType(m_currentClassName, -1, -1);
|
m_currentEntry.setType(m_currentClassName);
|
||||||
m_currentEntry.setTypeIcon(QIcon(m_currentIcon));
|
m_currentEntry.setTypeIcon(QIcon(m_currentIcon));
|
||||||
return ParsingItemLibrary;
|
return ParsingItemLibrary;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -384,7 +384,7 @@ void SubComponentManager::registerQmlFile(const QFileInfo &fileInfo, const QStri
|
|||||||
if (addToLibrary) {
|
if (addToLibrary) {
|
||||||
// Add file components to the library
|
// Add file components to the library
|
||||||
ItemLibraryEntry itemLibraryEntry;
|
ItemLibraryEntry itemLibraryEntry;
|
||||||
itemLibraryEntry.setType(componentName.toUtf8(), -1, -1);
|
itemLibraryEntry.setType(componentName.toUtf8());
|
||||||
itemLibraryEntry.setName(baseComponentName);
|
itemLibraryEntry.setName(baseComponentName);
|
||||||
itemLibraryEntry.setCategory(QLatin1String("QML Components"));
|
itemLibraryEntry.setCategory(QLatin1String("QML Components"));
|
||||||
if (!qualifier.isEmpty()) {
|
if (!qualifier.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user