C++ QGraphicsView不显示图像
我在UI中有一个graphicsView,我使用此代码从参考资料中设置了一个图像,但不起作用: -在头文件中:C++ QGraphicsView不显示图像,c++,qt,C++,Qt,我在UI中有一个graphicsView,我使用此代码从参考资料中设置了一个图像,但不起作用: -在头文件中: QGraphicsScene *scene; -在cpp文件中: scene = new QGraphicsScene(); scene->addPixmap(QPixmap(":/images/alert.png")); ui->graphicsView->setScene(scene); 代码中有什么错误?您确定地址吗?没有别的问题,我只是发现了错误。如果有人
QGraphicsScene *scene;
-在cpp文件中:
scene = new QGraphicsScene();
scene->addPixmap(QPixmap(":/images/alert.png"));
ui->graphicsView->setScene(scene);
代码中有什么错误?您确定地址吗?没有别的问题,我只是发现了错误。如果有人遇到同样的问题,实际上是地址问题。应该是:/images/image/alert.png谢谢: