This commit is contained in:
2026-05-14 13:30:06 +08:00
parent 974946cee4
commit e43171521d
91 changed files with 10485 additions and 3254 deletions
+9 -4
View File
@@ -3,13 +3,13 @@
#include <QWidget>
class QResizeEvent;
class TimelineEditorModel;
class TimelineWidget final : public QWidget {
Q_OBJECT
public:
explicit TimelineWidget(QWidget* parent = nullptr);
// 兼容旧接口:NLA/片段系统下时间轴始终固定为 0..600local frame)。
void setFrameRange(int start, int end);
void setCurrentFrame(int frame);
/// 由主窗口同步工程帧时调用:不发射 frameScrubbed,避免与拖动/刷新打架造成数字闪烁
@@ -20,6 +20,9 @@ public:
int selectionStart() const { return m_selStart; }
int selectionEnd() const { return m_selEnd; }
void setModel(TimelineEditorModel* model);
TimelineEditorModel* model() const { return m_model; }
// 轨道数据直接由上层提供(通常来自当前条带引用的 clip)。
void setKeyframeTracks(const QVector<int>& locFrames,
const QVector<int>& scaleFrames,
@@ -63,9 +66,9 @@ private:
void setFrameInternal(int frame, bool commit);
static constexpr int kStart = 0;
static constexpr int kEnd = 600; // exclusive for mapping, inclusive for UI labels
int m_currentFrame = 0; // local frame: 0..599
int m_start = 0;
int m_end = 600; // exclusive for mapping
int m_currentFrame = 0;
int m_selStart = -1;
int m_selEnd = -1;
@@ -83,4 +86,6 @@ private:
KeyKind m_selKeyKind = KeyKind::None;
int m_selKeyFrame = -1;
TimelineEditorModel* m_model = nullptr; // non-owning
};