s an #include #include "MainWindow.h" int main(int argc, char *argv[]) { QApplication::setGraphicsSystem("raster"); QApplication a(argc, argv); QByteArray pathData; QFile file("examplepathdata.txt"); if(file.open(QIODevice::ReadOnly)) { pathData = file.readAll(); file.close(); } QDataStream stream(QByteArray::fromBase64( pathData )); QPainterPath path; stream >> path; QGraphicsPathItem* pathItem = new QGraphicsPathItem(path); pathItem->setFlag(QGraphicsItem::ItemIsMovable); pathItem->setFlag(QGraphicsItem::ItemClipsToShape, false); pathItem->setPen(Qt::NoPen); pathItem->setBrush(Qt::black); QGraphicsScene scene(path.boundingRect().adjusted(-100,-100,100,100)); scene.addItem(pathItem); QGraphicsView view(&scene); view.setRenderHint(QPainter::Antialiasing); view.show(); return a.exec(); }