Results 1 to 4 of 4

Thread: QGLWidget and labels

  1. #1
    Join Date
    Apr 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default QGLWidget and labels

    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.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QGLWidget and labels

    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.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Apr 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGLWidget and labels

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QGLWidget and labels

    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
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Printing a QGLWidget
    By ToddAtWSU in forum Qt Programming
    Replies: 16
    Last Post: 14th November 2006, 21:44
  2. QGLWidget renderText
    By Rayven in forum Qt Programming
    Replies: 2
    Last Post: 14th July 2006, 21:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.