Files
hfut-bishe/client/gui/dialogs/FrameAnimationDialog.h
T
2026-05-14 13:30:06 +08:00

58 lines
1.4 KiB
C++

#pragma once
#include <QDialog>
#include <QString>
#include <QStringList>
#include <QVector>
namespace core {
class ProjectWorkspace;
}
class QLabel;
class QListWidget;
class QPushButton;
class FrameAnimationDialog final : public QDialog {
Q_OBJECT
public:
FrameAnimationDialog(core::ProjectWorkspace& workspace,
const QString& entityId,
int startFrame,
int endFrame,
QWidget* parent = nullptr);
private slots:
void onSelectFrame();
void onReplaceCurrentFrame();
void onClearCurrentFrame();
void onBatchImportFiles();
void onBatchImportFolder();
void onGenerateAiFrames();
private:
void rebuildFrameList();
void updatePreviewForFrame(int frame);
bool applyImageToFrame(int frame, const QString& absImagePath);
QVector<int> targetFramesForWrite(int requestedCount) const;
QByteArray currentEntityPngBytes(QString* outError) const;
private:
core::ProjectWorkspace& m_workspace;
QString m_entityId;
int m_start = 0;
int m_end = 0;
QLabel* m_title = nullptr;
QListWidget* m_list = nullptr;
QLabel* m_preview = nullptr;
QPushButton* m_btnReplace = nullptr;
QPushButton* m_btnClear = nullptr;
QPushButton* m_btnImportFiles = nullptr;
QPushButton* m_btnImportFolder = nullptr;
QPushButton* m_btnAiGenerate = nullptr;
QString m_defaultImageAbs;
};