QXlsx icon indicating copy to clipboard operation
QXlsx copied to clipboard

about the image insert the excel.

Open LiuLikeQian opened this issue 3 years ago • 2 comments

hi. when i insert the img, i can't insert the img by QPoint. because the excel calculates with pound and Qt inserts the img with pixel. then i try to transform the lb to pixel. it looks successful. but when i insert many imgs on vertical. The coordinate error is becoming more and more obvious.

LiuLikeQian avatar Mar 05 '21 04:03 LiuLikeQian

Dear @LiuLikeQian

Thanks for reporting.

Can I see the example code you tested?

Me or others may be able to help you.

j2doll avatar Mar 07 '21 09:03 j2doll

bool Worksheet::insertImageEx(QPoint star, QSize size, const QImage &image) { Q_D(Worksheet);

if (image.isNull())
	return false;

if (!d->drawing)
	d->drawing = QSharedPointer<Drawing>(new Drawing(this, F_NewFromScratch));
DrawingAbsoluteAnchor *anchor = new DrawingAbsoluteAnchor(d->drawing.data(), DrawingAnchor::Picture);
anchor->pos = star * 9525;
anchor->ext = size * 9525;
anchor->setObjectPicture(image);
return true;

}

@j2doll thanks

LiuLikeQian avatar Mar 10 '21 06:03 LiuLikeQian