From 2c631640121db780582db561bf3e939a201a03ad Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 31 Aug 2020 11:57:00 +0200 Subject: Inline QMetaObject::cast(QObject *), as requested by ### Qt 6 comment Task-number: QTBUG-85700 Change-Id: I29405df37b82d34a92537e39a3863b5f6c998556 Reviewed-by: Lars Knoll --- src/corelib/kernel/qobjectdefs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qobjectdefs.h') diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 6c6e4e5a8e..16478d889f 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2019 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -165,7 +165,8 @@ struct Q_CORE_EXPORT QMetaObject const QMetaObject *superClass() const; bool inherits(const QMetaObject *metaObject) const noexcept; - QObject *cast(QObject *obj) const; + QObject *cast(QObject *obj) const + { return const_cast(cast(const_cast(obj))); } const QObject *cast(const QObject *obj) const; #if !defined(QT_NO_TRANSLATION) || defined(Q_CLANG_QDOC) -- cgit v1.2.3