Utils: Add AspectList::createAndAddItem

Adds a function to add a "default" constructed new item to the list.

Change-Id: I3d826b6f3e3705ae431efa5d778219f431509ea8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-10-09 15:14:59 +02:00
parent d021f9158b
commit 4aef48de5e
6 changed files with 14 additions and 20 deletions

View File

@@ -3127,6 +3127,11 @@ QList<std::shared_ptr<BaseAspect>> AspectList::volatileItems() const
return d->volatileItems;
}
std::shared_ptr<BaseAspect> AspectList::createAndAddItem()
{
return addItem(d->createItem());
}
std::shared_ptr<BaseAspect> AspectList::addItem(const std::shared_ptr<BaseAspect> &item)
{
if (undoStack())