LimeReport
LimeReport copied to clipboard
Changes to get images painted with ExternalPainter also in bands
This is the changed codeblock to get the externaPainter also called in bands. Roughly tested.
/**
- set the ExternalPainter for all items that support this
- The support is handelt vie the IPainterProxy
- Up to now only the ImageItem supports this
- @remark trial to extend this this mechanism for bands / void ReportEnginePrivate::initReport() { for(int index = 0; index < pageCount(); ++index){ PageDesignIntf page = pageAt(index); if (page != 0){ foreach (BaseDesignIntf* item, page->pageItem()->childBaseItems()) { auto *proxyItem = dynamic_cast<IPainterProxy >(item); if (proxyItem){ proxyItem->setExternalPainter(this); } else if (item->isBand() ) { foreach(BaseDesignIntf childItem, item->childBaseItems()) { auto *proxyItem = dynamic_cast<IPainterProxy *>(childItem); if (proxyItem){ proxyItem->setExternalPainter(this); } } } } } } }
To be honest the external painter was an experimental function and I would not recommend using it :)
If there is a need to use it, it should be tested more carefully.
This is OK. For us it is not high pri in the moment. But the principle possibility is interesting. If the priority changes we come back to this feature. The code looks a bit like tinkering it into the concept. In principle it is an option to extend a code basis with an additional interface. And on the other hand it seems to work. We will test it occationally with other reports.