Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 UI 中有一个 graphicsView,我使用此代码从资源中设置图像但不起作用:
- 在头文件中:
QGraphicsScene *scene;
- 在 cpp 文件中:
scene = new QGraphicsScene(); scene->addPixmap(QPixmap(":/images/alert.png")); ui->graphicsView->setScene(scene);
代码有什么问题?