错误处理

This commit is contained in:
2026-08-16 17:53:46 +08:00
parent 00a3c54820
commit 8612b5ff86
47 changed files with 744 additions and 544 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ Explicit_Plot::Explicit_Plot()
: Abs_Plot(new Abs_Plot_Private(false)) {}
Render_Ticket Explicit_Plot::replot() {
return {d->scene->render_frame(true)};
return {d->scene->render_frame(true) == Plot_Render_Error::none};
}
} // namespace renderive
+6 -2
View File
@@ -43,8 +43,12 @@ void Abs_Plot_Private::attach_widget(Abs_Plot* plot) {
timer = new QTimer(plot);
timer->setTimerType(Qt::PreciseTimer);
QObject::connect(timer, &QTimer::timeout, plot, [this] {
if (scene->view_active())
(void)scene->render_frame();
if (!scene->view_active())
return;
const auto error = scene->render_frame();
if (error == Plot_Render_Error::external_failure ||
error == Plot_Render_Error::scene_shutting_down)
timer->stop();
});
}