1
votes

With the following code, on my workstation (QtCreator an "manually" running) all works fine. But on an other pc with no Qt installation my application don't show the QGraphicsPixmapItem.

image = new QGraphicsPixmapItem(QPixmap(urlFile));
image->setZValue(-5000.0);
scene->setSceneRect(QRectF(0, 0, image->pixmap().width() + 200, image->pixmap().height() + 200));
scene->addItem(image);
view->setMaximumWidth(image->pixmap().width() + 200);
view->setMaximumHeight(image->pixmap().height() + 200);

qreal centerX = (scene->width() / 2.0) - (image->pixmap().width() /2.0);
qreal centerY = (scene->height() / 2.0) - (image->pixmap().height() /2.0);;
image->setOffset(QPointF(centerX, centerY));

Do you know why ?

1

1 Answers

3
votes

I Know why :)

The folowing dll are needed to use jpg and gif : qgif4.dll, qjpeg4.dll.
In fact, a deployed application support by default, only the following formats : bmp, pbm, png, ppm, xbm, xpm.

The previously dll could be find in QTDIR/qt/plugins/imageformats/

To add the support of other image formats to your deployed application, create a imageformats/ directory on the same level of your executable and put your wanted dll in.