12#include "ItemFreeContainer_p.h"
16ItemFreeContainer::ItemFreeContainer(
Widget *hostWidget, ItemContainer *parent)
17 : ItemContainer(hostWidget, parent)
21ItemFreeContainer::ItemFreeContainer(
Widget *hostWidget)
22 : ItemContainer(hostWidget)
26ItemFreeContainer::~ItemFreeContainer()
30void ItemFreeContainer::addDockWidget(Item *item,
QPoint localPt)
32 Q_ASSERT(item !=
this);
34 qWarning() << Q_FUNC_INFO <<
"Item already exists";
37 item->setIsVisible(
true);
39 m_children.append(item);
40 item->setParentContainer(
this);
41 item->setPos(localPt);
43 Q_EMIT itemsChanged();
45 if (item->isVisible())
46 Q_EMIT numVisibleItemsChanged(numVisibleChildren());
48 Q_EMIT numItemsChanged();
51void ItemFreeContainer::clear()
53 qDeleteAll(m_children);
57void ItemFreeContainer::removeItem(Item *item,
bool hardRemove)
59 const bool wasVisible = item->isVisible();
62 m_children.removeOne(item);
65 item->setIsVisible(
false);
66 item->setGuestWidget(
nullptr);
70 Q_EMIT numVisibleItemsChanged(numVisibleChildren());
72 Q_EMIT itemsChanged();
75void ItemFreeContainer::restore(Item *child)
77 child->setIsVisible(
true);
80void ItemFreeContainer::onChildMinSizeChanged(Item *)
85void ItemFreeContainer::onChildVisibleChanged(Item *,
bool)