Commit 6d52e6bc authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: fixes handling of dot properties

parent d445fcab
......@@ -85,6 +85,7 @@ public:
QStringList itemLibraryItems() const;
QList<ItemLibraryInfo> itemLibraryRepresentations(const NodeMetaInfo &nodeMetaInfo) const;
ItemLibraryInfo itemLibraryRepresentation(const QString &name) const;
QString fromQtTypes(const QString &type) const;
public:
static MetaInfo global();
......
......@@ -490,6 +490,14 @@ ItemLibraryInfo MetaInfo::itemLibraryRepresentation(const QString &name) const
return ItemLibraryInfo();
}
QString MetaInfo::fromQtTypes(const QString &type) const
{
if (m_p->m_QtTypesToQmlTypes.contains(type))
return m_p->m_QtTypesToQmlTypes.value(type);
return type;
}
QStringList MetaInfo::itemLibraryItems() const
{
QStringList completeList = m_p->m_nodeMetaInfoHash.keys();
......
......@@ -272,7 +272,8 @@ QHash<QString,PropertyMetaInfo> NodeMetaInfo::dotProperties() const
QString propertyType = property(propertyName).type();
if (propertyType.right(1) == "*")
propertyType = propertyType.left(propertyType.size() - 1).trimmed();
NodeMetaInfo nodeInfo(m_data->metaInfo.nodeMetaInfo(propertyType, majorVersion(), minorVersion()));
NodeMetaInfo nodeInfo(m_data->metaInfo.nodeMetaInfo(m_data->metaInfo.fromQtTypes(propertyType), majorVersion(), minorVersion()));
if (nodeInfo.isValid()) {
QHashIterator<QString,PropertyMetaInfo> iter(nodeInfo.properties());
while (iter.hasNext()) {
......@@ -315,7 +316,7 @@ PropertyMetaInfo NodeMetaInfo::property(const QString &propertyName, bool resolv
QString propertyType = propInfo.type();
if (propertyType.right(1) == "*")
propertyType = propertyType.left(propertyType.size() - 1).trimmed();
nodeInfo = m_data->metaInfo.nodeMetaInfo(propertyType, majorVersion(), minorVersion());
nodeInfo = m_data->metaInfo.nodeMetaInfo(m_data->metaInfo.fromQtTypes(propertyType), majorVersion(), minorVersion());
if (!nodeInfo.isValid()) {
qDebug() << "no type info available for" << propertyType;
break;
......@@ -370,7 +371,7 @@ bool NodeMetaInfo::hasLocalProperty(const QString &propertyName, bool resolveDot
QString propertyType = propInfo.type();
if (propertyType.right(1) == "*")
propertyType = propertyType.left(propertyType.size() - 1).trimmed();
nodeInfo = m_data->metaInfo.nodeMetaInfo(propertyType, majorVersion(), minorVersion());
nodeInfo = m_data->metaInfo.nodeMetaInfo(m_data->metaInfo.fromQtTypes(propertyType), majorVersion(), minorVersion());
if (!nodeInfo.isValid()) {
qDebug() << "no type info available for" << propertyType;
break;
......
Supports Markdown
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