updated NodeKeyframe class to QObject for easier signal/slot handling

While the keyframes themselves are relatively simple, their usage is quite
complex and using QObjects as their base will help a ton of UI and backend
functionality.
This commit is contained in:
itsmattkc
2019-12-26 16:30:25 +11:00
parent c62b59965e
commit a514265fc9
2 changed files with 25 additions and 2 deletions
+22 -1
View File
@@ -21,15 +21,20 @@
#ifndef NODEKEYFRAME_H
#define NODEKEYFRAME_H
#include <memory>
#include <QVariant>
#include "common/rational.h"
class NodeKeyframe;
using NodeKeyframePtr = std::shared_ptr<NodeKeyframe>;
/**
* @brief A point of data to be used at a certain time and interpolated with other data
*/
class NodeKeyframe
class NodeKeyframe : public QObject
{
Q_OBJECT
public:
/**
@@ -71,6 +76,22 @@ public:
const Type& type() const;
void set_type(const Type& type);
signals:
/**
* @brief Signal emitted when this keyframe's time is changed
*/
void TimeChanged(const rational& time);
/**
* @brief Signal emitted when this keyframe's value is changed
*/
void ValueChanged(const QVariant& value);
/**
* @brief Signal emitted when this keyframe's value is changed
*/
void TypeChanged(const Type& type);
private:
rational time_;