Vector graphics clipboard format for Qt

后端 未结 2 444
独厮守ぢ
独厮守ぢ 2021-01-18 05:43

I want my Qt application to be able to save simple vector graphics to clipboard in a compatible way. On windows I want to be able to paste the graphics into Microsoft Word o

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-18 06:25

    The QGraphicsView class and its associated helpers can render to a QT metafile format through the QPicture class (for which you could write a translator to EMF), to SVG through the QSVGGenerator class and to postscript/pdf through QPrinter. It can also render to bitmap formats and various other targets.

    AFAIK it doesn't have a generic 'render to EMF' facility - you would have to write to something else like the QT Metafile and convert to EMF. If you only need a subset of the graphics primitives you might only need to support that subset in the translator. Otherwise you could go from SVG, which you can get directly from QT through QSVGGenerator.

提交回复
热议问题