PDA

View Full Version : Qt Graphics



soumya
19th August 2009, 11:15
Hi all,

I am working on qt form past 6 months but i am new to qt graphics.

I need to draw the circle,line in 2D cartesian coordinate system.

Whether to use Qpainter or Qcanvas or opengl?

which one will be the better to getting started with qt graphics?

Anyone can help me out asap.

Thanks & Regards,
soumya

yogeshgokul
19th August 2009, 11:20
1. The canvas is obsolete.
2. OpenGL is huge thing for such a small graphics operation.
3. The Graphics View Framework is based on the Cartesian coordinate system. So this is best suitable.

aamer4yu
19th August 2009, 11:53
If your work involves only painting,, and not moving objects,,,you can consider using QWidget also. You have QPainter in paintEvent and rest you code :)

soumya
19th August 2009, 12:01
Hi,

Thanks for the reply.

I am using qt3.3 i need to draw the coordinate system on the qframe

whether it can be done using qpainter?

Thanks & regards,
soumya

yogeshgokul
19th August 2009, 12:05
Yes !!
Coz QFrame is derived from QWidget.

soumya
19th August 2009, 12:12
hi,

Can u just send me the link to get started with

the "The Graphics View Framework" for qt3.3

wagmare
19th August 2009, 12:13
u are using qt 3.3
so QGraphicsView is not supported ...

here the link
http://doc.trolltech.com/4.2/graphicsview.html

soumya
19th August 2009, 13:06
I have attached the .png file i need to make a graphics similar to that in qt-3.3.

How this can be implemented.

wagmare
19th August 2009, 13:12
QGraphics wont support in qt 3.3 ...

so u have to use QPainter to design the above
and the dial movement u can refer
http://doc.trolltech.com/4.2/widgets-analogclock.html ..

and scale value check the plotter example in

C++ GUI Programming with Qt 4, Second Edition
by Jasmin Blanchette; Mark Summerfield

chapter 05 ...