PDA

View Full Version : QGLWidget and labels



jsmith
5th November 2009, 06:24
hi,
I have developed one application in which on top of pixmap i am able to drag and drop labels.

Now i am porting that application from QWidget to QGLwidget to display map using textures to increase the smoothness. There is no problem with map. But when i drag and drop labels with out specifying stylesheet for background color it is get corrupted as shown in below screenshot. But when i specify background color for label it is working fine. But i don't want that color.

This application is working fine in QWidget eventhough without specifying color.below is screenshot(correct.png)

Please help me why this happening.


Thanks in advance.

axeljaeger
5th November 2009, 06:53
Are you realy placing QLabels on top of the OpenGL-Widgets? Better draw the text yourself using QPainter. Placing top-level-widgets on top of gl-widgets very likely cause drawing artifacts.

jsmith
5th November 2009, 07:36
i can draw text using painter
But how can i drag and drop that text na. I think it is not possible to drag and drop the text which is drawn by painter

axeljaeger
5th November 2009, 07:50
Impossible is nothing. You have to implement the logic yourself.

Another option would be to use a QGraphicsScene and draw the background using OpenGL. See http://qt.nokia.com/doc/qq/qq26-openglcanvas.html