12 #include "ItemFreeContainer_p.h"
21 ItemFreeContainer::ItemFreeContainer(
Widget *hostWidget)
26 ItemFreeContainer::~ItemFreeContainer()
30 void 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();
51 void ItemFreeContainer::clear()
53 qDeleteAll(m_children);
57 void 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();
75 void ItemFreeContainer::restore(Item *child)
77 child->setIsVisible(
true);
80 void ItemFreeContainer::onChildMinSizeChanged(Item *)
85 void ItemFreeContainer::onChildVisibleChanged(Item *,
bool)