次のコードを使用すると、私のワークステーション (QtCreator を「手動で」実行) ですべて正常に動作します。しかし、Qt がインストールされていない別の PC では、私のアプリケーションは QGraphicsPixmapItem を表示しません。
image = new QGraphicsPixmapItem(QPixmap(urlFile)); image->setZValue(-5000.0); scene->setSceneRect(QRectF(0, 0, image->pixmap().width() + 200, image->pixmap().height() + 200)); シーン->addItem(画像); 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));
なぜなのかご存知ですか ?