0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 16:39:07 +03:00

Band location has been fixed

# Conflicts:
#	limereport/lrbanddesignintf.h
This commit is contained in:
Arin Alexander
2017-06-29 00:57:41 +03:00
5 changed files with 75 additions and 17 deletions

View File

@@ -172,7 +172,7 @@ void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
if (itemMode() & DesignMode){
painter->save();
QString bandText = objectName();
if (parentBand()) bandText+=QLatin1String(" connected to ")+parentBand()->objectName();
if (parentBand()) bandText+=tr(" connected to ")+parentBand()->objectName();
QFont font("Arial", 7 * Const::fontFACTOR, -1, true);
QFontMetrics fontMetrics(font);
@@ -230,9 +230,15 @@ void BandDesignIntf::setBandIndex(int value)
m_bandIndex=value;
}
void BandDesignIntf::changeBandIndex(int value)
void BandDesignIntf::changeBandIndex(int value, bool firstTime)
{
int indexOffset = value - m_bandIndex;
int indexOffset;
if (firstTime && bandHeader())
value += 1;
indexOffset = value - m_bandIndex;
foreach(BandDesignIntf* band, childBands()){
int newIndex = band->bandIndex()+indexOffset;
band->changeBandIndex(newIndex);
@@ -294,6 +300,16 @@ bool BandDesignIntf::isConnectedToBand(BandDesignIntf::BandsType bandType) const
return false;
}
int BandDesignIntf::maxChildIndex(BandDesignIntf::BandsType bandType) const{
int curIndex = bandIndex();
foreach(BandDesignIntf* childBand, childBands()){
if ( (childBand->bandIndex() > bandIndex()) && (childBand->bandType() < bandType) ){
curIndex = std::max(curIndex,childBand->maxChildIndex());
}
}
return curIndex;
}
int BandDesignIntf::maxChildIndex(QSet<BandDesignIntf::BandsType> ignoredBands) const{
int curIndex = bandIndex();
foreach(BandDesignIntf* childBand, childBands()){