0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-01 03:29:49 +03:00

Layouts have been refactored

This commit is contained in:
Arin Alexander
2019-02-02 00:28:30 +03:00
parent d32b42d933
commit 72fb6692c6
6 changed files with 53 additions and 70 deletions

View File

@@ -142,6 +142,11 @@ BaseDesignIntf* VerticalLayout::cloneBottomPart(int height, QObject* owner, QGra
return bottomPart;
}
void VerticalLayout::sortChildren()
{
qSort(layoutsChildren().begin(),layoutsChildren().end(),verticalLessThen);
}
void VerticalLayout::divideSpace()
{
setIsRelocating(true);
@@ -187,34 +192,4 @@ void VerticalLayout::insertItemInLayout(BaseDesignIntf* item)
}
}
BaseDesignIntf*VerticalLayout::findNext(BaseDesignIntf* item)
{
if (layoutsChildren().count() < childItems().size()-1){
layoutsChildren().clear();
foreach (BaseDesignIntf* childItem, childBaseItems()) {
layoutsChildren().append(childItem);
}
}
qSort(layoutsChildren().begin(),layoutsChildren().end(),verticalLessThen);
for (int i=0; i<layoutsChildren().count();++i){
if (layoutsChildren()[i]==item && layoutsChildren().size()>i+1){ return layoutsChildren()[i+1];}
}
return 0;
}
BaseDesignIntf*VerticalLayout::findPrior(BaseDesignIntf* item)
{
if (layoutsChildren().count()<childItems().size()-1){
layoutsChildren().clear();
foreach (BaseDesignIntf* childItem, childBaseItems()) {
layoutsChildren().append(childItem);
}
}
qSort(layoutsChildren().begin(),layoutsChildren().end(),verticalLessThen);
for (int i=0; i<layoutsChildren().count();++i){
if (layoutsChildren()[i]==item && i!=0){ return layoutsChildren()[i-1];}
}
return 0;
}
}
} // namespace LimeReport