Hi everyone. We've some QObject class which is actually an animator class(responsible for animating associated target widget):
class Animator : public QVariantAnimation { Q_OBJECT Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject) public: explicit Animator(QObject* target, QObject* parent = nullptr) { setTargetObject(target); } ~Animator() { stop(); } QObject* targetObject() const { return d_func()->target; } void setTargetObject(QObject* target) { Q_D(Animator); if (d->target == target) return; if (d->state == QVariantAnimation::Running) { qWarning("Animation::setTargetObject: you can't change the target of a running animation"); return; } d->target = target; } protected: void updateCurrentValue(const QVariant& value) override { Q_UNUSED(value); Q_D(Animator); if (!d->target.isNull()) { QEvent update(QEvent::StyleAnimationUpdate); update.setAccepted(false); QCoreApplication::sendEvent(d->target, &update); if (!update.isAccepted()) stop(); } } private: Q_DECLARE_PRIVATE(Animator) Q_DISABLE_COPY(Animator) }; Now, the problem is how we can prevent this update mechanism if there're multiple Animators trying to send update to target? How we can prevent some of the unnecessary updates ? Regards. Iman.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest