25 lines
1.1 KiB
C++
25 lines
1.1 KiB
C++
#pragma once
|
||
#include <vector>
|
||
|
||
#include "repo/RepoTypes.hpp"
|
||
|
||
class QListWidget;
|
||
|
||
namespace geopro::app {
|
||
|
||
// 数据列表条目角色(与 main.cpp 树一致:Qt::UserRole=dsId、+1=ddType)。
|
||
constexpr int kDsIdRole = 0x0100; // Qt::UserRole
|
||
constexpr int kDsDdTypeRole = 0x0101; // Qt::UserRole + 1
|
||
constexpr int kDsFileUrlRole = 0x0102; // Qt::UserRole + 2(文件下载 url,备用)
|
||
constexpr int kDsLoadMoreRole = 0x0103; // 标记"加载更多"行
|
||
|
||
// 数据页签:每条 = dsName +(类型名);UserRole 存 dsId、+1 存 ddCode。
|
||
void populateDatasetList(QListWidget* list, const std::vector<geopro::data::DsRow>& rows, bool append);
|
||
// 文件页签:每条 = 文件名 +(可读大小);UserRole 存 dsId、+2 存文件 url。空时显示占位。
|
||
void populateFileList(QListWidget* list, const std::vector<geopro::data::DsRow>& rows, bool append);
|
||
|
||
// 给数据/文件列表套用卡片委托(标题+元信息双行、悬停/选中圆角高亮+左强调竖条,规范§6.2)。
|
||
void applyDatasetCardDelegate(QListWidget* list);
|
||
|
||
} // namespace geopro::app
|