TaskTree: Adapt docs for the removed List element

Change-Id: I9adab7a12a590fac4ffb797564fe7cb8988c4584
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-12-17 10:38:02 +01:00
parent 7d3f50f784
commit ec22f5e759

View File

@@ -376,6 +376,46 @@ private:
\sa {Tasking::Storage} {Storage}
*/
/*!
\fn GroupItem::GroupItem(const QList<GroupItem> &items)
Constructs a \c GroupItem element with a given list of \a items.
When this \c GroupItem element is parsed by the TaskTree, it is simply replaced with
its \a items.
This constructor is useful when constructing a \l {Tasking::Group} {Group} element with
lists of \c GroupItem elements:
\code
static QList<GroupItems> getItems();
...
const Group root {
parallel,
finishAllAndSuccess,
getItems(), // OK, getItems() list is wrapped into a single GroupItem element
onGroupSetup(...),
onGroupDone(...)
};
\endcode
If you want to create a subtree, use \l {Tasking::Group} {Group} instead.
\note Don't confuse this \c GroupItem with the \l {Tasking::Group} {Group} element, as
\l {Tasking::Group} {Group} keeps its children nested
after being parsed by the task tree, while this \c GroupItem does not.
\sa {Tasking::Group} {Group}
*/
/*!
\fn GroupItem::GroupItem(std::initializer_list<GroupItem> items)
\overload
\sa GroupItem(const QList<Tasking::GroupItem> &items)
*/
/*!
\class Tasking::Group
\inheaderfile solutions/tasking/tasktree.h
@@ -519,69 +559,6 @@ private:
and the returned item finishes with an error.
*/
/*!
\class Tasking::List
\inheaderfile solutions/tasking/tasktree.h
\inmodule TaskingSolution
\brief List is a helper element that wraps a list of GroupItem elements into a single
GroupItem element.
\reentrant
\c List is useful when constructing a \l {Tasking::Group} {Group} element with lists of
GroupItem elements. If you define a helper function that returns a list of GroupItem elements,
it's not easy to place them directly into a group together with other items. Instead, you may
wrap the returned list with the \c List element and place it like a single GroupItem element
inside a \l {Tasking::Group} {Group}:
\code
static QList<GroupItems> getItems();
...
const Group root {
parallel,
finishAllAndSuccess,
// getItems(), // Wrong, compile error, as we can't mix QList<GroupItem> with
// GroupItems within the initializer list of root Group.
List(getItems()), // OK, getItems() list is wrapped into a single GroupItem element
// via the List element.
onGroupSetup(...),
onGroupDone(...)
};
\endcode
\c List may contain nested \c List elements. \c List doesn't do anything on its own.
When parsed by the task tree, the \c List element is simply replaced with its contents.
\note Don't confuse \c List with the \l {Tasking::Group} {Group} element, as
\l {Tasking::Group} {Group} keeps its children nested
after being parsed by the task tree, while \c List does not.
*/
/*!
\fn List::List(const QList<GroupItem> &children)
Constructs a \c List element with a given list of \a children.
When the \c List element is parsed by the task tree, it is simply replaced with its children.
If you want to create a subtree, use \l {Tasking::Group} {Group} instead.
\sa {Tasking::Group} {Group}
*/
/*!
\fn List::List(std::initializer_list<GroupItem> children)
Constructs a \c List element from \c std::initializer_list given by \a children.
When the \c List element is parsed by the task tree, it is simply replaced with its children.
If you want to create a subtree, use \l {Tasking::Group} {Group} instead.
\sa {Tasking::Group} {Group}
*/
/*!
\class Tasking::Sync
\inheaderfile solutions/tasking/tasktree.h