Results 1 to 2 of 2

Thread: OpenGL in QGraphicsItem not getting the correct PaintEngine

  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default OpenGL in QGraphicsItem not getting the correct PaintEngine

    Hi everyone

    I have a QGraphicsView with a QGraphicsScene. I've added a QGLWidget as viewport to the QGraphicsView and implemented ad OpenGL based drawBackground in QGraphicsScene.

    The background add a polygon with a texture on i as background.

    The problem starts when adding items.

    I've derived some classes from QGraphpicsItem and re-implemented the paint function. When I test which paintEngine that is pressent it is NOT a OpenGL or OpenGL2.

    But I can draw the lines (and other stuff) in the item over the scene-background. But the problem is that the texture from the background of the scene is drawn in the items boundRect.

    I don't know if the problem with the wrong paintEngine is related to the drawing problem.
    THe image below shows the problem The bottom-left corner displays a miniversion of the GLGraphicsScene background texture. The other three items are correctly rendered.



    Best regards
    Erik

  2. #2
    Join Date
    Apr 2015
    Posts
    4
    Thanks
    1

    Default Re: OpenGL in QGraphicsItem not getting the correct PaintEngine

    Hi,
    I know this post is very old but I am developing a Qt application and I have exactly the same problem . Did you solve it?
    Thanks.

Similar Threads

  1. Replies: 7
    Last Post: 29th November 2010, 19:20
  2. OpenGL functions in QGraphicsItem::paint
    By Lendrick in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2010, 17:30
  3. QGraphicsItem and OpenGL textures
    By Aldebaran in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2010, 08:37
  4. Replies: 0
    Last Post: 6th December 2009, 00:41
  5. QWidget::paintEngine() should no longer be called
    By Greeny in forum Qt Programming
    Replies: 7
    Last Post: 7th February 2007, 10:12

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.