mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 16:39:07 +03:00
Band location has been fixed
This commit is contained in:
@@ -171,7 +171,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);
|
||||
|
||||
@@ -229,9 +229,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);
|
||||
@@ -293,6 +299,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()){
|
||||
|
Reference in New Issue
Block a user