Support for animation (#25)

ref #23, Metatype for QtAwesomeAnimation* Qt4.8.6
This commit is contained in:
sundashe 2017-06-24 23:48:21 +08:00 committed by Rick Blommers
parent 83b369bdb1
commit dfaaa0f60a
2 changed files with 3 additions and 3 deletions

View File

@ -28,8 +28,8 @@ public:
painter->save();
QObject* qanim = qvariant_cast<QObject*>(options.value("anim"));
QtAwesomeAnimation* anim = qobject_cast<QtAwesomeAnimation*>(qanim);
QVariant var =options.value("anim");
QtAwesomeAnimation* anim = var.value<QtAwesomeAnimation*>();
if( anim ) {
anim->setup( *painter, rect );
}

View File

@ -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