Show the auto-created slots in the completion box (e.g. MouseRegion's onClicked).

This commit is contained in:
Roberto Raggi
2010-01-25 14:48:44 +01:00
parent c9efafcb98
commit a8f0971a0b

View File

@@ -74,6 +74,23 @@ public:
processor->process(prop.name(), propertyValue(prop)); processor->process(prop.name(), propertyValue(prop));
} }
for (int index = 0; index < _metaObject->methodCount(); ++index) {
QMetaMethod meth = _metaObject->method(index);
const QString signature = QString::fromUtf8(meth.signature());
int indexOfParen = signature.indexOf(QLatin1Char('('));
if (indexOfParen == -1)
continue; // skip it, invalid signature.
const QString signalName = signature.left(indexOfParen);
QString slotName;
slotName += QLatin1String("on");
slotName += signalName.at(0).toUpper();
slotName += signalName.midRef(1);
processor->process(slotName, engine()->undefinedValue()); // ### FIXME: assign a decent type to the property
}
} }
const Value *propertyValue(const QMetaProperty &prop) const { const Value *propertyValue(const QMetaProperty &prop) const {