feat/dataset-detail-chart #5
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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("加载中…"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue