feat(app): add --simulate flag for headless demo captures

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Ilya Ashikhmin 2026-07-02 23:38:07 +02:00
parent 4f6fe37b4d
commit 730d0fa7a7
3 changed files with 8 additions and 0 deletions

View File

@ -229,6 +229,11 @@ void MainWindow::loadSample()
m_view->zoomToFit(); m_view->zoomToFit();
} }
void MainWindow::setSimulationRunning(bool running)
{
m_simulateAction->setChecked(running);
}
void MainWindow::runSimulation(bool enabled) void MainWindow::runSimulation(bool enabled)
{ {
if (enabled) { if (enabled) {

View File

@ -22,6 +22,7 @@ public:
NetworkModel* model() const { return m_model; } NetworkModel* model() const { return m_model; }
void loadSample(); void loadSample();
void setSimulationRunning(bool running);
protected: protected:
void closeEvent(QCloseEvent* event) override; void closeEvent(QCloseEvent* event) override;

View File

@ -14,6 +14,8 @@ int main(int argc, char** argv)
const QStringList args = app.arguments(); const QStringList args = app.arguments();
if (args.contains(QStringLiteral("--sample"))) if (args.contains(QStringLiteral("--sample")))
window.loadSample(); window.loadSample();
if (args.contains(QStringLiteral("--simulate")))
window.setSimulationRunning(true);
// Headless smoke check: --screenshot <file.png> renders and exits. // Headless smoke check: --screenshot <file.png> renders and exits.
const int shotIdx = args.indexOf(QStringLiteral("--screenshot")); const int shotIdx = args.indexOf(QStringLiteral("--screenshot"));