[Kstars-devel] KStars vs Stellarium - Graphics

James Bowlin bowlin at mindspring.com
Fri Jun 6 20:42:27 CEST 2008


On Fri June 6 2008, Akarsh Simha wrote:
> > They get this effect easily because they are using the OpenGL
> > interface.
>
> Can't we manage it with Qt? Or will the overhead be too much?

I don't know about the technical implementation details.  But to get
an idea of OpenGL vs. non-OpenGL, take a look at the KDE screen savers.
The OpenGL screen savers look very different from the non-OpenGL screen
savers.  If you want the OpenGL "look" then you need to use OpenGL.

Take a look at the link I provided:
http://doc.trolltech.com/4.1/examples.html#opengl-examples
for examples of how to use OpenGL from within QT.

It looks like you need to use the QGLWidget class instead of QWidget.
The 2D Painting example says:

  Since QGLWidget is a subclass of QWidget, it is possible to
  reimplement its paintEvent() and use QPainter to draw on the device,
  just as you would with a QWidget. The only difference is that the
  painting operations will be accelerated in hardware if it is supported
  by your system's OpenGL drivers.


-- 
Peace, James


More information about the Kstars-devel mailing list