TaskTreeRunner: Introduce aboutToStart(TaskTree *) signal

It enables the access to the internal TaskTree.
Emitted by TaskTreeRunner::start(), after the task tree
is instantiated and before it is started.

The lifetime of the passed task tree is controlled by the
TaskTreeRunner and is limited to the one particular execution.
Don't store pointer to the passed task tree.
If unvoidable, store the QPointer instead.

It may be used e.g. for connecting to the TaskProgress.

Change-Id: If0af11eb136c9cbff2e4c6e91f8b18a114880f74
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-01-13 13:56:44 +01:00
parent 781ca08207
commit d8663701ab
2 changed files with 2 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ void TaskTreeRunner::start(const Group &recipe)
m_taskTree.release()->deleteLater();
emit done(result);
});
emit aboutToStart(m_taskTree.get());
m_taskTree->start();
}

View File

@@ -33,6 +33,7 @@ public:
void reset();
signals:
void aboutToStart(TaskTree *taskTree);
void done(DoneWith result);
private: