Other variant on svg xml you can create any Form and color image line round rect ecc...
and insert on document and direct insert... at end only save to png or other...
a symple line black 900 x 1 sample
[HTML]
<?xml version="1.0" standalone="no"?>
<svg width="900" height="1" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect
x="0"
y="0"
width="900"
height="1"
style="fill:#000000;fill-opacity:0.87654322" />
</svg>
[/HTML]
/* remember QT += svg on pro file */
static inline QPixmap RenderPixmapFromSvgByte
( QByteArray streams
) /* or contenent from a svg file or a qdom stream dinamic created */ {
QPixmap pix
( svgRenderer.
defaultSize() );
pix.fill(Qt::transparent);
svgRenderer.render(&paint);
return pix;
}
/* and insert image .. */
imgresor
= QUrl(QString(":/png/external-paste-%1").
arg(TimestampsMs
));
////// ImageContainer.insert(imgresor.toString(),derangedata); /* save internal stream data */
resultimage
= QPixmap( your forms
);
document
()->addResource
(QTextDocument::ImageResource,imgresor,resultimage
);
format.setName( imgresor.toString() );
format.setHeight ( scaledsimage.height() );
format.setWidth ( scaledsimage.width() );
format.setToolTip(imgresor.toString());
textCursor().insertImage( format );
/* remember QT += svg on pro file */
static inline QPixmap RenderPixmapFromSvgByte( QByteArray streams ) /* or contenent from a svg file or a qdom stream dinamic created */
{
QSvgRenderer svgRenderer( streams );
QPixmap pix( svgRenderer.defaultSize() );
pix.fill(Qt::transparent);
QPainter paint(&pix);
svgRenderer.render(&paint);
return pix;
}
/* and insert image .. */
imgresor = QUrl(QString(":/png/external-paste-%1").arg(TimestampsMs));
////// ImageContainer.insert(imgresor.toString(),derangedata); /* save internal stream data */
resultimage = QPixmap( your forms );
document()->addResource(QTextDocument::ImageResource,imgresor,resultimage);
QTextImageFormat format;
format.setName( imgresor.toString() );
format.setHeight ( scaledsimage.height() );
format.setWidth ( scaledsimage.width() );
format.setToolTip(imgresor.toString());
textCursor().insertImage( format );
To copy to clipboard, switch view to plain text mode
Bookmarks