PDA

View Full Version : Displaying a SVG file.



Splatify
28th February 2011, 18:47
Hi all, I have a svg file and was wondering how to output it to my form. Can i use the graphicsview widget and then use:


ui->graphicsview-> // something here to display it to the screen.

Thanks for your time and trouble

helloworld
28th February 2011, 21:43
I guess it would look something like:



ui->setupUi(this);
QGraphicsScene *scene = new QGraphicsScene(this);
ui->graphicsView->setScene(scene);
QGraphicsSvgItem *item = new QGraphicsSvgItem("<path to svg file>");
scene->addItem(item);