forked from qt-creator/qt-creator
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:
@@ -197,8 +197,15 @@ CppComponentValue::~CppComponentValue()
|
||||
static QString generatedSlotName(const QString &base)
|
||||
{
|
||||
QString slotName = QLatin1String("on");
|
||||
slotName += base.at(0).toUpper();
|
||||
slotName += base.midRef(1);
|
||||
int firstChar=0;
|
||||
while (firstChar < base.size()) {
|
||||
QChar c = base.at(firstChar);
|
||||
slotName += c.toUpper();
|
||||
++firstChar;
|
||||
if (c != QLatin1Char('_'))
|
||||
break;
|
||||
}
|
||||
slotName += base.midRef(firstChar);
|
||||
return slotName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user