增加预览页介绍信息显示
This commit is contained in:
29
client/core/domain/EntityIntro.h
Normal file
29
client/core/domain/EntityIntro.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
namespace core {
|
||||
|
||||
/// 实体在「预览展示」模式下点击后显示的介绍内容(可持久化到 .hfe)
|
||||
struct EntityIntroContent {
|
||||
QString title;
|
||||
QString bodyText;
|
||||
QVector<QString> imagePathsRelative;
|
||||
/// 预留:相对项目根的视频路径,将来可用 QMediaPlayer 播放
|
||||
QString videoPathRelative;
|
||||
|
||||
void clear() {
|
||||
title.clear();
|
||||
bodyText.clear();
|
||||
imagePathsRelative.clear();
|
||||
videoPathRelative.clear();
|
||||
}
|
||||
|
||||
bool hasDisplayableContent() const {
|
||||
return !title.trimmed().isEmpty() || !bodyText.trimmed().isEmpty() ||
|
||||
!imagePathsRelative.isEmpty() || !videoPathRelative.trimmed().isEmpty();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
Reference in New Issue
Block a user