#include <qtgui>
#include <qtopengl>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// A game need colors ...
QColor palette;
// Setting the Scene
QGraphicsScene scene;
scene.setSceneRect(0,0,800,600);
// Adding a Rectangle
scene.addRect(0,0,600,600, QPen(palette.black()), QBrush(palette.black()));
scene.addRect(10,10,100,100);
// Adding an Image
QPixmap tile("white.png");
QGraphicsPixmapItem * pTile = scene.addPixmap(tile);
pTile->moveBy(500,500);
// Adding UI
QGraphicsProxyWidget proxy;
proxy.setWidget(new QPushButton());
proxy.moveBy(250,250);
scene.addItem(&proxy);
// Creating the Window
QGraphicsView view(&scene);
view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
view.setSceneRect(0,0,600,600);
view.show();
return a.exec();
}