qmljs: correct slot name for properties starting with “_”

Task-number: QTCREATORBUG-12214
Change-Id: Ie8009846ce27d4acbc3e9ad4dd7dda73fde39413
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Fawzi Mohamed
2014-05-13 15:21:25 +02:00
parent 55c19c5042
commit a17c231b07

View File

@@ -197,8 +197,15 @@ CppComponentValue::~CppComponentValue()
static QString generatedSlotName(const QString &base) static QString generatedSlotName(const QString &base)
{ {
QString slotName = QLatin1String("on"); QString slotName = QLatin1String("on");
slotName += base.at(0).toUpper(); int firstChar=0;
slotName += base.midRef(1); while (firstChar < base.size()) {
QChar c = base.at(firstChar);
slotName += c.toUpper();
++firstChar;
if (c != QLatin1Char('_'))
break;
}
slotName += base.midRef(firstChar);
return slotName; return slotName;
} }