[Interest] Creating pdf with QTextDocument with chart
Jason H
jhihn at gmx.com
Mon Oct 26 17:37:05 CET 2015
> >> I don't think 4.8 has the ability to paint images in a document. It
> >> looks like Qt5 would make a lot of this simpler.
> >
> > If you read http://doc.qt.io/qt-4.8/richtext-html-subset.html You'll see it supports the <img> tag.
> >
>
> Yes but img requires a file name. I'd have to create a png or jpg.
> Maybe. I'll look into that.
However you make the chart in Qt (we use Qt Charts - commercial) you can call QWidget::render() to send it to a QImage/QPixmap, save the image. I forget the abilities of 4.8 in having a custom file URL (i.e. chart://my_chart) But you might be able to get it to not have to touch a disk. The FS implementation was being changed towards the end of 4.8, not sure where it ended up.
More information about the Interest
mailing list