[Qt-interest] Problem with QSvgRenderer

bharath.n.g at nokia.com bharath.n.g at nokia.com
Wed Apr 29 08:25:06 CEST 2009


All,

I am using QSvgRenderer to render a SVG image which has multiple elements and selectively rendering the required elements using a QGraphicsSvgItem.

I am using this piece of code to do that.

--

QApplication app(argc, argv);

QGraphicsScene scene;
QGraphicsView view(&scene);

QSvgRenderer* renderer = new QSvgRenderer(QString("c:\\map.svg"));
QGraphicsSvgItem* world = new QGraphicsSvgItem();
QGraphicsSvgItem* dot = new QGraphicsSvgItem();

world->setSharedRenderer(renderer);
dot->setSharedRenderer(renderer);
world->setElementId("map");
dot->setElementId("dot");

// scene.addItem(world);
scene.addItem(dot);

view.show();

--

The problem I am facing is that when I add the world item to the scene, the dot doesn't get displayed at all and only the dot gets displayed when I don't add it.
What could be wrong here?

Thanks,
-Bharath

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090429/6662340e/attachment.html 


More information about the Qt-interest-old mailing list