feat/dataset-detail-chart #5

Merged
gaozheng merged 74 commits from feat/dataset-detail-chart into main 2026-06-13 17:30:37 +08:00
3 changed files with 6 additions and 2 deletions
Showing only changes of commit 8b3bc50f58 - Show all commits

View File

@ -527,7 +527,10 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re
if (phase == geopro::controller::DatasetDetailController::LoadPhase::Grid) if (phase == geopro::controller::DatasetDetailController::LoadPhase::Grid)
detailPanel->setGridLoading(dsId, true); detailPanel->setGridLoading(dsId, true);
}); });
QObject::connect(&detailCtrl, &geopro::controller::DatasetDetailController::loadFailed, &window, // context 用 detailPanel与 loadStarted 一致detailPanel 析构即自动断连,避免野指针。
// window 比 detailPanel 活得久lambda 捕 &window 取状态栏安全。loadFailed 无 phase
// Chart 失败时 gridOverlay 本已隐藏setGridLoading(false) 幂等无害Grid 失败时正确清遮罩。
QObject::connect(&detailCtrl, &geopro::controller::DatasetDetailController::loadFailed, detailPanel,
[&window, detailPanel](const QString& dsId, const QString& msg) { [&window, detailPanel](const QString& dsId, const QString& msg) {
detailPanel->setGridLoading(dsId, false); detailPanel->setGridLoading(dsId, false);
window.statusBar()->showMessage( window.statusBar()->showMessage(

View File

@ -51,6 +51,7 @@ void DatasetDetailPage::setData(const geopro::controller::DatasetDetailControlle
gridRequested_ = false; // 新数据集 → 网格数据需重新按需加载 gridRequested_ = false; // 新数据集 → 网格数据需重新按需加载
rawView_->setData(d); rawView_->setData(d);
gridView_->setData(d); gridView_->setData(d);
setGridLoading(false); // 重开/换 ds重置遮罩状态避免上次的「加载中」残留
} }
void DatasetDetailPage::setGridData( void DatasetDetailPage::setGridData(

View File

@ -1,12 +1,12 @@
#include "panels/LoadingOverlay.hpp" #include "panels/LoadingOverlay.hpp"
#include <QEvent> #include <QEvent>
#include <QLabel> #include <QLabel>
#include <QResizeEvent>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace geopro::app { namespace geopro::app {
LoadingOverlay::LoadingOverlay(QWidget* parent) : QWidget(parent), label_(new QLabel(this)) { LoadingOverlay::LoadingOverlay(QWidget* parent) : QWidget(parent), label_(new QLabel(this)) {
Q_ASSERT(parent); // 契约:必须有父(遮罩几何跟随父,无父无法工作)
setAttribute(Qt::WA_StyledBackground, true); setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(QStringLiteral("background: rgba(255,255,255,160);")); setStyleSheet(QStringLiteral("background: rgba(255,255,255,160);"));
label_->setText(QStringLiteral("加载中…")); label_->setText(QStringLiteral("加载中…"));