Results 1 to 10 of 10

Thread: Qt-Painting and OpenGL - is that a problem?

  1. #1
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Qt-Painting and OpenGL - is that a problem?

    Hallo u all,
    I try to bring OpenGL into a given application. The system uses QWidgets as Components. Overlapping or moving a Widget with transparent areas over a QGLWidget works not as expected. The Background is not shining through like on a normal Widget. Is this a default behaviour because of better performance or a matter of principle?
    Are there solutions?

    greetz

    Mike
    Last edited by unusual; 8th July 2010 at 17:30.

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

    Default Re: Qt-Painting and OpenGL - is that a problem?

    Is the moving widget a child of the gl widget or are they both independent windows?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt-Painting and OpenGL - is that a problem?

    The GLWidget and the moving Widget are independent. They are brothers for example. My system is highly configurable so the GLWidget is maybe the child of a child of achild of the form and the moving widget just a child of the form. The do not know anything about each other. - hope that helps to understand the problem...

    lg

    Mike

    that was posible a litte cofusing - again: the QWidget is above the QGLWidget - overlapping - half in Qt-World half in GL-World...
    Last edited by unusual; 8th July 2010 at 20:10.

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

    Default Re: Qt-Painting and OpenGL - is that a problem?

    Background of the GL widget is usually cleared to black or some other colour by the GL engine itself. You can try setting the clear colour of the GL context to transparent but I don't know whether it has a chance of working.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt-Painting and OpenGL - is that a problem?

    clearing GL with transparent color would make the GL-Background transparent - I want it the other way - the "normal" widget above the GL-Widget should be transparent - may I can send a screenshot tomorrow...

  6. #6
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt-Painting and OpenGL - is that a problem?



    The problem looks like this

    (inside the box frame should only a be seen an ellipse on a transparent area)

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

    Default Re: Qt-Painting and OpenGL - is that a problem?

    Widgets are usually not used like that. Maybe you should implement your application with graphics view?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt-Painting and OpenGL - is that a problem?

    Well my nickis "unusual" - the screenshot is a small test application just for keeping the problem simple - in my real application it is necessary to overlap widgets with a GL area. Just think about a touch keyboard (half transparent) on top of a OpenGl View...

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

    Default Re: Qt-Painting and OpenGL - is that a problem?

    Quote Originally Posted by unusual View Post
    Well my nickis "unusual"
    "abusive" sounds more to the point here Sibling widgets should not be overlapping.

    in my real application it is necessary to overlap widgets with a GL area. Just think about a touch keyboard (half transparent) on top of a OpenGl View...
    Graphics view would handle all that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. The following user says thank you to wysota for this useful post:

    unusual (9th July 2010)

  11. #10
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt-Painting and OpenGL - is that a problem?

    So I have to do some test implementation with graphics view - thanks so far!

    lg

    Mike

Similar Threads

  1. problem painting
    By eric_vi in forum Qt Programming
    Replies: 5
    Last Post: 13th August 2009, 23:07
  2. Painting problem
    By Mel in forum Qt Programming
    Replies: 10
    Last Post: 8th May 2007, 21:38
  3. Painting problem
    By ScoOteR in forum Qt Programming
    Replies: 5
    Last Post: 11th March 2007, 11:03
  4. Painting Problem
    By shyam prasad in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2007, 14:07
  5. Painting Problem on Mac
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2007, 08:58

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
  •  
Qt is a trademark of The Qt Company.