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 ?