aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/ftw
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-05-14 10:36:48 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-02 21:04:35 +0200
commitba2928c787cf0988a7f6a7d424faea96ff707846 (patch)
tree01788110ab68d2b9a1e8fa504bca2ee519fb5c24 /src/qml/qml/ftw
parent278e8df17b073f96d8ff89d7a470fe63802ed15e (diff)
Reject overrides of final properties (and potentially methods)
If you specify FINAL in Q_PROPERTY you explicitly don't want it to be overridden. Before, we would still accept overrides of such properties. Issue a warning and decline overriding them. For consistency, treat methods the same, even though we cannot declare them final yet. [ChangeLog][QtQml][Important Behavior Changes] C++ properties declared FINAL now refuse to be overridden by other C++ properties. This mirrors the treatment of QML properties trying to override FINAL properties. As we cannot reject the C++ types the way we can reject QML types, the overrides are ignored and a warning is issued. It is also impossible to override final properties with functions now. This used to be possible in the past. Task-number: QTBUG-93662 Change-Id: I244c3e83a33875472bc5bf6786a1e949fe981995 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/qml/ftw')
-rw-r--r--src/qml/qml/ftw/qhashedstring_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h
index 8f0bd74c53..03955e0563 100644
--- a/src/qml/qml/ftw/qhashedstring_p.h
+++ b/src/qml/qml/ftw/qhashedstring_p.h
@@ -465,6 +465,11 @@ void QHashedString::computeHash() const
m_hash = stringHash(constData(), length());
}
+namespace QtPrivate {
+inline QString asString(const QHashedCStringRef &ref) { return ref.toUtf16(); }
+inline QString asString(const QHashedStringRef &ref) { return ref.toString(); }
+}
+
QT_END_NAMESPACE
#endif // QHASHEDSTRING_P_H