12#include "ItemFreeContainer_p.h"
13#include "LayoutingHost_p.h"
16#include "core/Logging_p.h"
17#include "core/Utils_p.h"
21ItemFreeContainer::ItemFreeContainer(LayoutingHost *hostWidget, ItemContainer *parent)
22 : ItemContainer(hostWidget, parent)
26ItemFreeContainer::ItemFreeContainer(LayoutingHost *hostWidget)
27 : ItemContainer(hostWidget)
31ItemFreeContainer::~ItemFreeContainer()
35void ItemFreeContainer::addDockWidget(Item *item, Point localPt)
39 KDDW_ERROR(
"Item already exists");
42 item->setIsVisible(
true);
44 m_children.append(item);
45 item->setParentContainer(
this);
46 item->setPos(localPt);
50 if (item->isVisible())
51 numVisibleItemsChanged.emit(numVisibleChildren());
53 numItemsChanged.emit();
56void ItemFreeContainer::clear()
58 deleteAll(m_children);
62void ItemFreeContainer::removeItem(Item *item,
bool hardRemove)
64 const bool wasVisible = item->isVisible();
67 m_children.removeOne(item);
70 item->setIsVisible(
false);
71 item->setGuest(
nullptr);
75 numVisibleItemsChanged.emit(numVisibleChildren());
80void ItemFreeContainer::restore(Item *child)
82 child->setIsVisible(
true);
85void ItemFreeContainer::onChildMinSizeChanged(Item *)
90void ItemFreeContainer::onChildVisibleChanged(Item *,
bool)