PDA

View Full Version : Use of Computer Graphics in Qt creator



parulkalra
25th November 2013, 05:09
Are we able to include/insert Computer graphics function in qt creator? I mean are we able to include all functions of Computer graphics even those that are not predefined in qt creator? Suppose if i want to insert Square shape in a container frame so what will be code for that?

stampede
25th November 2013, 07:19
You can use OpenGL with Qt widgets. Also, take a look at QPainEvent and QPainter class.

parulkalra
25th November 2013, 10:13
I am new to OpenGL. Can you tell little bit about OpenGL? and Please provide some code to draw square.

stampede
25th November 2013, 10:25
First of all, read a book. If you are new to OpenGL it is impossible to explain it in few forum posts. I recommend OpenGL Programming Guide (the "Red Book"), but you may find many others. Just pick one and read it.
Next:
Nehe Productions: Your First Polygon (http://nehe.gamedev.net/tutorial/your_first_polygon/13002/)
Qt OpenGL Examples (http://qt-project.org/doc/qt-4.8-snapshot/examples-opengl.html)

saman_artorious
25th November 2013, 10:27
I am new to OpenGL. Can you tell little bit about OpenGL? and Please provide some code to draw square.

Follow these tutorials to get a clue in openGL: http://ogldev.atspace.co.uk/
after reviewing the first few lessons, google for coloring and cube examples under QT.

parulkalra
26th November 2013, 04:45
thanku so much...

anda_skoa
26th November 2013, 20:20
If you are looking for something as simple as drawing squares, definitely have a look at QPainter as stampede suggested.

It's not hardware accelerated, but still good enough to draw all widgets and in some quite complex styles.

Cheers,
_