mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-01 19:51:30 +03:00
Layout undo has been fixed
This commit is contained in:
@@ -48,7 +48,7 @@ void AbstractLayout::setLayoutType(const LayoutType& layoutType)
|
||||
|
||||
void AbstractLayout::addChild(BaseDesignIntf* item, bool updateSize)
|
||||
{
|
||||
placeItemInLayout(item);
|
||||
if (updateSize) placeItemInLayout(item);
|
||||
|
||||
m_children.append(item);
|
||||
item->setParentItem(this);
|
||||
@@ -321,6 +321,19 @@ BaseDesignIntf *AbstractLayout::findPrior(BaseDesignIntf *item)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AbstractLayout::insertItemInLayout(BaseDesignIntf *item){
|
||||
bool inserted = false;
|
||||
for (int i=0; i<layoutsChildren().length(); ++i){
|
||||
BaseDesignIntf* child = layoutsChildren()[i];
|
||||
if (child->pos() == item->pos()){
|
||||
layoutsChildren().insert(i, item);
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inserted) layoutsChildren().append(item);
|
||||
}
|
||||
|
||||
void AbstractLayout::slotOnChildDestroy(QObject* child)
|
||||
{
|
||||
m_children.removeAll(static_cast<BaseDesignIntf*>(child));
|
||||
|
Reference in New Issue
Block a user