summaryrefslogtreecommitdiff
path: root/examples/demos/robotarm/Backend/animatedparam.h
diff options
context:
space:
mode:
authorKimmo Leppälä <kimmo.leppala@qt.io>2023-04-14 22:21:43 +0300
committerKai Köhne <kai.koehne@qt.io>2023-05-09 18:37:33 +0200
commit02efcba73d7f7d1d1eb49a6741558b2b6528838b (patch)
tree6cc527060bb4385220ffced8358c689702a8b16f /examples/demos/robotarm/Backend/animatedparam.h
parent8cf277e3f21d8170964363888ebb6f01c730f013 (diff)
downloadqtdoc-02efcba73d7f7d1d1eb49a6741558b2b6528838b.tar.gz
Move robotarm example from quick3d to qtdoc
Pick-to: 6.5 Change-Id: Iac113bc7ed773f291ef09ebe144e1de1e0e58136 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Diffstat (limited to 'examples/demos/robotarm/Backend/animatedparam.h')
-rw-r--r--examples/demos/robotarm/Backend/animatedparam.h32
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