PDA

View Full Version : QGraphicsView I'm not geting output



jthacker
29th May 2010, 05:59
GraphicTest1::GraphicTest1(QWidget *parent)
: QGraphicsView(parent)
{
QGraphicsScene scene;
scene.addText(QString("HELLO, WORLD!"));
setScene(&scene);
show();
}


i have created the class GraphicTest1 : public QGraphicsView {
...
}
in the constructor i have written above code but i'm not getting output hello world.
but it shows only white blank widget.

help me


note:
Qt 4.6.2
Qt Creator 1.3.1

jthacker
29th May 2010, 06:08
can anybody comment on this ..plz!

tbscope
29th May 2010, 07:57
What happens with your scene when you reach the end of your constructor?

Please think about this yourself first.
If you really don't know I tell you, but since this is basic c/c++ try to understand it yourself first.

jthacker
29th May 2010, 08:19
hey thanks a lot tbscope....! such a stupid i am...:)!
i got the o/p...!

Lykurg
29th May 2010, 09:06
can anybody comment on this ..plz!
You should give us more than 9 minutes to answer...:) Also because we all are not in the same time zone!