diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-26 14:30:20 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-09-01 11:31:19 +0000 |
commit | 47ff10532ebd6c7b0cb62c46b0be3b3d7f6214b8 (patch) | |
tree | ece6677fbc033866981041f8fdcb487aacc4272a /src/qml | |
parent | d40791d6add8937275ecce2d26870c1ef6b6e698 (diff) |
QQuickImageProvider: Remove reliance on RTTI
Using staticCast is unsafe, because in theory you can derive from
QQmlImageProviderBase instead of QQuickImageProvider. But using
dynamicCast runs into issues, because while Qt needs to be compiled with
RTTI, user code does not.
We thus turn the baseclass into a QObject so that qobject_cast does work.
Fixes: QTBUG-84127
Change-Id: Id40d8a13eaa0101d80bd5742a23996354d70c72a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlengine.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h index ec597bc521..0f9e6da63f 100644 --- a/src/qml/qml/qqmlengine.h +++ b/src/qml/qml/qqmlengine.h @@ -50,8 +50,9 @@ QT_BEGIN_NAMESPACE -class Q_QML_EXPORT QQmlImageProviderBase +class Q_QML_EXPORT QQmlImageProviderBase : public QObject { + Q_OBJECT public: enum ImageType : int { Invalid = 0, |