This commit implements much of the base functionality for creating and destroying keyframes in the UI. Not complete yet, but getting there.
34 lines
614 B
C++
34 lines
614 B
C++
#ifndef KEYFRAMEVIEWITEM_H
|
|
#define KEYFRAMEVIEWITEM_H
|
|
|
|
#include <QGraphicsRectItem>
|
|
|
|
#include "node/keyframe.h"
|
|
|
|
class KeyframeViewItem : public QObject, public QGraphicsRectItem
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
KeyframeViewItem(NodeKeyframePtr key, qreal vcenter, QGraphicsItem *parent = nullptr);
|
|
|
|
void SetScale(double scale);
|
|
|
|
protected:
|
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
|
|
|
|
private:
|
|
NodeKeyframePtr key_;
|
|
|
|
double scale_;
|
|
|
|
qreal middle_;
|
|
|
|
int keyframe_size_;
|
|
|
|
private slots:
|
|
void UpdateRect();
|
|
|
|
};
|
|
|
|
#endif // KEYFRAMEVIEWITEM_H
|