0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-20 06:30:03 +03:00

Layout has been fixed

This commit is contained in:
Arin Alexander
2019-01-21 14:17:34 +03:00
parent 651367e6a3
commit 76ae6dfb24
5 changed files with 12 additions and 11 deletions

View File

@@ -303,7 +303,7 @@ void PageItemDesignIntf::registerBand(BandDesignIntf *band)
band->setParentItem(this);
band->setWidth(pageRect().width()/band->columnsCount());
connect(band, SIGNAL(destroyed(QObject*)),this,SLOT(bandDeleted(QObject*)));
connect(band, SIGNAL(geometryChanged(QObject*,QRectF,QRectF)),this,SLOT(bandGeometryChanged(QObject*,QRectF,QRectF)));
connect(band, SIGNAL(posChanged(QObject*,QPointF,QPointF)),this,SLOT(bandPositionChanged(QObject*,QPointF,QPointF)));
}
}
@@ -664,17 +664,17 @@ void PageItemDesignIntf::moveBandFromTo(int from, int to)
}
void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry)
void PageItemDesignIntf::bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos)
{
if (itemMode() == DesignMode){
BandDesignIntf* band = dynamic_cast<BandDesignIntf*>(object);
int curIndex = band->bandIndex();
BandDesignIntf* bandToSwap = 0;
foreach(BandDesignIntf* curBand, bands()){
if (newGeometry.y() > oldGeometry.y()) {
if (newPos.y() > oldPos.y()) {
if (curBand->bandType() == band->bandType()
&& curIndex < curBand->bandIndex()
&& (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y()
&& (curBand->pos().y() + (curBand->height()/2)) < newPos.y()
&& curBand->parentBand() == band->parentBand())
{
curIndex = curBand->bandIndex();
@@ -683,7 +683,7 @@ void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry
} else {
if (curBand->bandType() == band->bandType()
&& curIndex>curBand->bandIndex()
&& (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y()
&& (curBand->pos().y() + (curBand->height()/2)) > newPos.y()
&& curBand->parentBand() == band->parentBand())
{
curIndex = curBand->bandIndex();