[TD]allow view creation in main thread if gui no available

This commit is contained in:
wandererfan
2025-03-07 13:19:36 -05:00
parent f9b6e2c33b
commit 0884babb4d
4 changed files with 57 additions and 52 deletions

View File

@@ -189,6 +189,12 @@ void DrawViewDetail::detailExec(TopoDS_Shape& shape, DrawViewPart* dvp, DrawView
return;
}
if (!DU::isGuiUp()) {
makeDetailShape(shape, dvp, dvs);
onMakeDetailFinished();
waitingForDetail(false);
}
//note that &m_detailWatcher in the third parameter is not strictly required, but using the
//4 parameter signature instead of the 3 parameter signature prevents clazy warning:
//https://github.com/KDE/clazy/blob/1.11/docs/checks/README-connect-3arg-lambda.md
@@ -404,8 +410,10 @@ void DrawViewDetail::onMakeDetailFinished(void)
waitingForDetail(false);
QObject::disconnect(connectDetailWatcher);
//ancestor's buildGeometryObject will run HLR and face finding in a separate thread
m_tempGeometryObject = buildGeometryObject(m_scaledShape, m_viewAxis);
if (!DU::isGuiUp()) {
onHlrFinished();
}
}
bool DrawViewDetail::waitingForResult() const