diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-02-11 11:21:03 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-02-11 15:45:45 +0100 |
commit | 2f4c131805f4009f42abe991e0f92f096bbc55fd (patch) | |
tree | 36068f58c7e3bea9c7a3a26fac9f649e624cc6d5 /src/qml/qml/qqmlproperty.cpp | |
parent | 2e98ccde7b89bdb45c87c154d27566215533ac76 (diff) |
Fix QQmlProperty and Connections for properties starting with '_'
We do a weird renaming for the change handler of properties starting
with '_', now we do it at least in a consistent way.
Fixes: QTBUG-82017
Change-Id: I1535a5ee462f3a344c972461f1fb954f039aa854
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index d191d07258..86cb606f83 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -353,10 +353,15 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name) if (terminal.count() >= 3 && terminal.at(0) == QLatin1Char('o') && terminal.at(1) == QLatin1Char('n') && - terminal.at(2).isUpper()) { + (terminal.at(2).isUpper() || terminal.at(2) == '_')) { QString signalName = terminal.mid(2).toString(); - signalName[0] = signalName.at(0).toLower(); + int firstNon_; + int length = signalName.length(); + for (firstNon_ = 0; firstNon_ < length; ++firstNon_) + if (signalName.at(firstNon_) != '_') + break; + signalName[firstNon_] = signalName.at(firstNon_).toLower(); // XXX - this code treats methods as signals |