QmlJS: Autocomplete dot and colon for properties.

Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-06-07 17:33:44 +02:00
parent d0d61182cb
commit 3b8b6e89cc
6 changed files with 98 additions and 67 deletions

View File

@@ -217,33 +217,16 @@ void dump(const QMetaObject *meta, QXmlStreamWriter *xml)
xml->writeEndElement();
}
void writeScriptElement(QXmlStreamWriter *xml)
void writeEasingCurve(QXmlStreamWriter *xml)
{
xml->writeStartElement("type");
{
QXmlStreamAttributes attributes;
attributes.append(QXmlStreamAttribute("name", "Script"));
attributes.append(QXmlStreamAttribute("name", "QEasingCurve"));
attributes.append(QXmlStreamAttribute("extends", "Qt.Easing"));
xml->writeAttributes(attributes);
}
xml->writeStartElement("property");
{
QXmlStreamAttributes attributes;
attributes.append(QXmlStreamAttribute("name", "script"));
attributes.append(QXmlStreamAttribute("type", "string"));
xml->writeAttributes(attributes);
}
xml->writeEndElement();
xml->writeStartElement("property");
{
QXmlStreamAttributes attributes;
attributes.append(QXmlStreamAttribute("name", "source"));
attributes.append(QXmlStreamAttribute("type", "QUrl"));
xml->writeAttributes(attributes);
}
xml->writeEndElement();
xml->writeEndElement();
}
@@ -268,7 +251,6 @@ int main(int argc, char *argv[])
}
cppToQml.insert("QString", "string");
cppToQml.insert("QEasingCurve", "Qt.Easing");
cppToQml.insert("QDeclarativeEasingValueType::Type", "Type");
QSet<const QMetaObject *> metas;
@@ -340,7 +322,8 @@ int main(int argc, char *argv[])
dump(meta, &xml);
}
writeScriptElement(&xml);
// define QEasingCurve as an extension of Qt.Easing
writeEasingCurve(&xml);
xml.writeEndElement();
xml.writeEndDocument();