Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to get images painted with ExternalPainter also in bands #374

Open
ivti opened this issue Jan 18, 2022 · 2 comments
Open

Changes to get images painted with ExternalPainter also in bands #374

ivti opened this issue Jan 18, 2022 · 2 comments

Comments

@ivti
Copy link

ivti commented Jan 18, 2022

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);
    }
    }
    }
    }
    }
    }
    }
@fralx
Copy link
Owner

fralx commented Jan 19, 2022

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.

@ivti
Copy link
Author

ivti commented Jan 19, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants