mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Group bands rendering has been fixed
This commit is contained in:
parent
3569b63e24
commit
9b46cbce78
@ -141,7 +141,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
||||
|
||||
LIMEREPORT_VERSION_MAJOR = 1
|
||||
LIMEREPORT_VERSION_MINOR = 5
|
||||
LIMEREPORT_VERSION_RELEASE = 88
|
||||
LIMEREPORT_VERSION_RELEASE = 90
|
||||
|
||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||
|
@ -643,18 +643,18 @@ void BandDesignIntf::processPopUpAction(QAction *action)
|
||||
ItemsContainerDesignInft::processPopUpAction(action);
|
||||
}
|
||||
|
||||
void BandDesignIntf::recalcItems(DataSourceManager* dataManager)
|
||||
{
|
||||
foreach(BaseDesignIntf* bi, childBaseItems()){
|
||||
ContentItemDesignIntf* ci = dynamic_cast<ContentItemDesignIntf*>(bi);
|
||||
if (bi){
|
||||
ContentItemDesignIntf* pci = dynamic_cast<ContentItemDesignIntf*>(bi->patternItem());
|
||||
ci->setContent(pci->content());
|
||||
}
|
||||
}
|
||||
//void BandDesignIntf::recalcItems(DataSourceManager* dataManager)
|
||||
//{
|
||||
// foreach(BaseDesignIntf* bi, childBaseItems()){
|
||||
// ContentItemDesignIntf* ci = dynamic_cast<ContentItemDesignIntf*>(bi);
|
||||
// if (bi){
|
||||
// ContentItemDesignIntf* pci = dynamic_cast<ContentItemDesignIntf*>(bi->patternItem());
|
||||
// ci->setContent(pci->content());
|
||||
// }
|
||||
// }
|
||||
|
||||
updateItemSize(dataManager,FirstPass,height());
|
||||
}
|
||||
// updateItemSize(dataManager,FirstPass,height());
|
||||
//}
|
||||
|
||||
BaseDesignIntf* BandDesignIntf::cloneUpperPart(int height, QObject *owner, QGraphicsItem *parent)
|
||||
{
|
||||
@ -1159,17 +1159,6 @@ void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass p
|
||||
BaseDesignIntf::updateItemSize(dataManager, pass, maxHeight);
|
||||
}
|
||||
|
||||
void BandDesignIntf::restoreItems()
|
||||
{
|
||||
foreach(BaseDesignIntf* bi, childBaseItems()){
|
||||
ContentItemDesignIntf* ci = dynamic_cast<ContentItemDesignIntf*>(bi);
|
||||
if (ci){
|
||||
ContentItemDesignIntf* pci = dynamic_cast<ContentItemDesignIntf*>(bi->patternItem());
|
||||
ci->setContent(pci->content());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BandDesignIntf::updateBandNameLabel()
|
||||
{
|
||||
if (m_bandNameLabel) m_bandNameLabel->updateLabel(bandTitle());
|
||||
|
@ -156,8 +156,7 @@ public:
|
||||
virtual bool isUnique() const;
|
||||
void setItemMode(BaseDesignIntf::ItemMode mode);
|
||||
void updateItemSize(DataSourceManager *dataManager, RenderPass pass=FirstPass, int maxHeight=0);
|
||||
void restoreItems();
|
||||
void recalcItems(DataSourceManager* dataManager);
|
||||
// void recalcItems(DataSourceManager* dataManager);
|
||||
void updateBandNameLabel();
|
||||
|
||||
virtual QColor selectionColor() const;
|
||||
|
@ -359,12 +359,10 @@ void ReportRender::clearPageMap()
|
||||
m_renderedPages.clear();
|
||||
}
|
||||
|
||||
bool ReportRender::containsGroupFunctions(BandDesignIntf *band){
|
||||
foreach(BaseDesignIntf* item,band->childBaseItems()){
|
||||
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(item);
|
||||
if (contentItem){
|
||||
QString content = contentItem->content();
|
||||
foreach(QString functionName, m_datasources->groupFunctionNames()){
|
||||
|
||||
bool checkContentItem(ContentItemDesignIntf* item, DataSourceManager* datasources){
|
||||
QString content = item->content();
|
||||
foreach(QString functionName, datasources->groupFunctionNames()){
|
||||
#if QT_VERSION < 0x060000
|
||||
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
||||
if (rx.indexIn(content)>=0){
|
||||
@ -374,6 +372,18 @@ bool ReportRender::containsGroupFunctions(BandDesignIntf *band){
|
||||
// TODO: Qt6 port
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ReportRender::containsGroupFunctions(BaseDesignIntf *container){
|
||||
if (container){
|
||||
foreach (BaseDesignIntf* item, container->childBaseItems()) {
|
||||
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(item);
|
||||
if (contentItem){
|
||||
if (checkContentItem(contentItem, m_datasources)) return true;
|
||||
} else {
|
||||
if (containsGroupFunctions(item)) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -846,11 +856,21 @@ BandDesignIntf* ReportRender::findRecalcableBand(BandDesignIntf* patternBand){
|
||||
return 0;
|
||||
}
|
||||
|
||||
void restoreItemsWithGroupFunctions(BaseDesignIntf* container, DataSourceManager* datasources){
|
||||
foreach(BaseDesignIntf* bi, container->childBaseItems()){
|
||||
ContentItemDesignIntf* pci = dynamic_cast<ContentItemDesignIntf*>(bi->patternItem());
|
||||
if (pci && checkContentItem(pci, datasources)){
|
||||
ContentItemDesignIntf* ci = dynamic_cast<ContentItemDesignIntf*>(bi);
|
||||
ci->setContent(pci->content());
|
||||
} else restoreItemsWithGroupFunctions(bi, datasources);
|
||||
}
|
||||
}
|
||||
|
||||
void ReportRender::recalcIfNeeded(BandDesignIntf* band){
|
||||
BandDesignIntf* recalcBand = findRecalcableBand(band);
|
||||
if (recalcBand){
|
||||
QString bandName = recalcBand->objectName();
|
||||
recalcBand->restoreItems();
|
||||
restoreItemsWithGroupFunctions(recalcBand, m_datasources);
|
||||
recalcBand->setObjectName(recalcBand->patternItem()->objectName());
|
||||
replaceGroupsFunction(recalcBand);
|
||||
recalcBand->updateItemSize(datasources());
|
||||
|
@ -139,7 +139,7 @@ private:
|
||||
qreal calcPageFooterHeight(PageItemDesignIntf* patternPage);
|
||||
qreal calcSlicePercent(qreal height);
|
||||
|
||||
bool containsGroupFunctions(BandDesignIntf* band);
|
||||
bool containsGroupFunctions(BaseDesignIntf *container);
|
||||
void extractGroupFuntionsFromItem(ContentItemDesignIntf* contentItem, BandDesignIntf* band);
|
||||
void extractGroupFunctionsFromContainer(BaseDesignIntf* baseItem, BandDesignIntf* band);
|
||||
void extractGroupFunctions(BandDesignIntf* band);
|
||||
|
Loading…
Reference in New Issue
Block a user