Results 1 to 2 of 2

Thread: Trouble placing QLabel on top ofQGLWidget

  1. #1
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Trouble placing QLabel on top ofQGLWidget

    Hi, I'm trying to place a QLabel .PNG image on top of a QGLWidget, but its giving a lot of trouble. The QLabel shows up fine, but the QGLWidget disappears. It also runs very slow, then inevitably crashes the program

    Is this the correct method to place a 2D image on top of 3D? If not, how would I go about it? And lastly, please tell me its even possible in Qt!

    Thanks for any help you can give!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Trouble placing QLabel on top ofQGLWidget

    I'd do it using OpenGL. Render a rectangle on the scene using an orthogonal view and bind the image to the rectangle as a texture. Alternatively reimplement the paint event of the widget, call the base class and then open a painter and draw the pixmap directly in the paint event. It'll be slower, but should work fine if your OpenGL implementation supports overlays.

Similar Threads

  1. Trouble placing background images
    By WinchellChung in forum Newbie
    Replies: 2
    Last Post: 5th July 2007, 14:33

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.