增加预览页介绍信息显示

This commit is contained in:
2026-04-08 09:56:25 +08:00
parent f53fee8e5a
commit 028ed1b18d
17 changed files with 1059 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "core/domain/EntityIntro.h"
#include "props/PropertySectionWidget.h"
#include <QPointF>
@@ -8,6 +9,12 @@
class QLabel;
class QLineEdit;
class QDoubleSpinBox;
class QTextEdit;
class QListWidget;
class QPushButton;
class QToolButton;
class QTimer;
class QWidget;
namespace gui {
class Vec2ParamControl;
@@ -22,6 +29,7 @@ struct EntityPropertyUiState {
QPointF pivot;
QPointF centroid;
double userScale = 1.0;
core::EntityIntroContent intro;
};
// 实体相关属性(可嵌入 QStackedWidget 的一页)
@@ -33,20 +41,41 @@ public:
void clearDisconnected();
void applyState(const EntityPropertyUiState& s);
void setEditingEnabled(bool on);
[[nodiscard]] core::EntityIntroContent introSnapshot() const;
void appendIntroImagePath(const QString& relativePath);
signals:
void displayNameCommitted(const QString& text);
void pivotEdited(double x, double y);
void centroidEdited(double x, double y);
void userScaleEdited(double value);
/// 介绍字段变更后防抖触发,由主窗口写入工程
void introContentEdited();
void introAddImageRequested();
private:
void scheduleIntroPersist();
void setIntroSectionExpanded(bool expanded);
QLineEdit* m_name = nullptr;
QLabel* m_depth = nullptr;
QLabel* m_distScale = nullptr;
Vec2ParamControl* m_pivot = nullptr;
Vec2ParamControl* m_centroid = nullptr;
QDoubleSpinBox* m_userScale = nullptr;
QLineEdit* m_introTitle = nullptr;
QTextEdit* m_introBody = nullptr;
QLineEdit* m_introVideo = nullptr;
QListWidget* m_introImages = nullptr;
QPushButton* m_btnIntroAddImage = nullptr;
QPushButton* m_btnIntroRemoveImage = nullptr;
QWidget* m_introHeader = nullptr;
QToolButton* m_introToggle = nullptr;
QWidget* m_introContent = nullptr;
QTimer* m_introSaveTimer = nullptr;
bool m_introBulkUpdate = false;
};
} // namespace gui