main.cpp
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsPixmapItem>
int main(int argc, char *argv[])
{
scene.addItem(&item);
view.show();
return a.exec();
}
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsPixmapItem>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsScene scene;
QGraphicsView view(&scene);
QGraphicsPixmapItem item(QPixmap(":/images/wearepros.png")); //doesn't load during debug build
scene.addItem(&item);
view.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
res.qrc
<RCC>
<qresource prefix="/images">
<file>sample.jpg</file>
<file>wearepros.png</file>
<file>sample.bmp</file>
</qresource>
</RCC>
<RCC>
<qresource prefix="/images">
<file>sample.jpg</file>
<file>wearepros.png</file>
<file>sample.bmp</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
Bookmarks