diff --git a/QtAwesome/QtAwesome.cpp b/QtAwesome/QtAwesome.cpp index 79811cc..49fa6bb 100644 --- a/QtAwesome/QtAwesome.cpp +++ b/QtAwesome/QtAwesome.cpp @@ -28,8 +28,8 @@ public: painter->save(); - QObject* qanim = qvariant_cast(options.value("anim")); - QtAwesomeAnimation* anim = qobject_cast(qanim); + QVariant var =options.value("anim"); + QtAwesomeAnimation* anim = var.value(); if( anim ) { anim->setup( *painter, rect ); } diff --git a/QtAwesome/QtAwesome.h b/QtAwesome/QtAwesome.h index 3bcb0de..a56caeb 100644 --- a/QtAwesome/QtAwesome.h +++ b/QtAwesome/QtAwesome.h @@ -871,6 +871,6 @@ public: virtual void paint( QtAwesome* awesome, QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state, const QVariantMap& options ) = 0; }; - +Q_DECLARE_METATYPE(QtAwesomeAnimation*) #endif // QTAWESOME_H