From 434d677b3e3778d89161bf8f8c12e69e749796ae Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 21 Jun 2023 19:09:02 +0200 Subject: [PATCH] TaskTree: Hide some parts of the API in protected/private sections They are meant to be used from subclasses only. For the private virtual TaskInterface::start() - it's meant to be implemented from subclasses only, but not to be called from them. Change-Id: I526c40766c204c868b4b3c857a382b2b61bbadd0 Reviewed-by: Qt CI Bot Reviewed-by: hjk --- src/libs/solutions/tasking/tasktree.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 82fafd77bb6..47ad221728a 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -26,12 +26,14 @@ class TASKING_EXPORT TaskInterface : public QObject { Q_OBJECT -public: - TaskInterface() = default; - virtual void start() = 0; - signals: void done(bool success); + +private: + template friend class TaskAdapter; + friend class TaskNode; + TaskInterface() = default; + virtual void start() = 0; }; class TASKING_EXPORT TreeStorageBase @@ -300,12 +302,14 @@ private: template class TaskAdapter : public TaskInterface { -public: +protected: using Type = Task; TaskAdapter() = default; Task *task() { return &m_task; } const Task *task() const { return &m_task; } + private: + template friend class CustomTask; Task m_task; };