[Qt-interest] Basic QGraphicsview question

Phil phillor at telstra.com
Fri Dec 12 05:56:09 CET 2008


On Friday 12 December 2008 16:01:18 Ankit Agarwal wrote:
> Hello Phil,
> You need to use setScene() function. It isn't addScene(). Sorry for the
> mistake.
>
No need to be sorry Ankit, I probably should be sorry for asking such a basic 
question.

At the risk of being jumped on, the following compiles but doesn't show 
anything in the graphics view box. "graphicsView" is a pointer generated by 
Designer and the graphics view sits on the main window dialog. 

  QGraphicsScene scene;

  scene.addText("Hello, world!");

  graphicsView->setScene(&scene);

  graphicsView->show();

-- 
Regards,
Phil.



More information about the Qt-interest-old mailing list