diff options
Diffstat (limited to 'examples/demos/robotarm/Backend/animatedparam.h')
-rw-r--r-- | examples/demos/robotarm/Backend/animatedparam.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/demos/robotarm/Backend/animatedparam.h b/examples/demos/robotarm/Backend/animatedparam.h new file mode 100644 index 00000000..e88576f7 --- /dev/null +++ b/examples/demos/robotarm/Backend/animatedparam.h @@ -0,0 +1,32 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef ANIMATEDPARAM_H +#define ANIMATEDPARAM_H + +#include <QProperty> +#include <QVariantAnimation> + +//! [class definition] +class AnimatedParam : public QVariantAnimation +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) + //! [class definition] + +public: + AnimatedParam(QObject *parent = nullptr); + + int value() const; + void setValue(int newValue); + + bool isRunning() const; + +signals: + void valueChanged(); + +private: + QProperty<bool> m_isRunning; +}; + +#endif // ANIMATEDPARAM_H |