diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index c2fc2910f0..f1e0662461 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -501,7 +501,7 @@ inline QBindingStorage *qGetBindingStorage(QObject *o) { return IId; } \ template <> inline IFace *qobject_cast(QObject *object) \ { return reinterpret_cast((object ? object->qt_metacast(IId) : nullptr)); } \ - template <> inline IFace *qobject_cast(const QObject *object) \ + template <> inline const IFace *qobject_cast(const QObject *object) \ { return reinterpret_cast((object ? const_cast(object)->qt_metacast(IId) : nullptr)); } #endif // Q_MOC_RUN