Re: Newbie needs advice - QGraphics
{Forked from http://www.qtcentre.org/forum/f-newb...hics-7728.html}
Quote:
Code:
scene->setSceneRect( 0, 0, 1000, 1000 ); //you can adjust this as you need
view->setScene(scene);
setCentralWidget(view);
Looking to your code, I remember the code piece in the Qt reference, which says:
Code:
scene.addText("Hello, world!");
view.show();
and I tryed this code, obtaining a well big exception, after a little modify:
Code:
scene.addText("Hello, world!");
ui.graphicsviewobj->setScene(&scene);
(ui object has been previously allocated)
Instead of starting a new thread, I ask "why this" here, since I think it is fair in-topic... :)
Re: Newbie needs advice - QGraphics
Haven't you forgot to ask the question?
It seems that your problem is that you create the scene on the stack and it goes out of scope.