Results 1 to 2 of 2

Thread: Cannot capture the QGLwidget with grabWidget or grabWindow (Snap Shot ) .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Cannot capture the QGLwidget with grabWidget or grabWindow (Snap Shot ) .

    Hi ,

    I have MID area which contains QGLWidgets as its subWindows .
    I am able to grab the snap Shot for these QGLwidgets with grabWidget and grabWindow APi's .

    But now i want my QGLWidget to have gradient background so i Used Qpainter in QGLWIdget:aintEvent
    and set QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) as it was throwing some exception during the creation of QPainter .

    Now my QGLWidgets are rendered correctly with the required gradient background but i am not able to grab the snapshot for these QGlwidgets with grabWidget and grawindow APi's ..
    It captures black screen for these QGLwidget areas..

    Is my approach right ..Its likly that QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) is causing the trouble..

    What approach should i go with to grab (Snapshot )for QGlwidgets that are painted to have gradient background .

    Thanks,

    Awaiting for response ...
    Last edited by vaibhavjoshi28; 5th September 2013 at 07:48.

  2. #2
    Join Date
    Jan 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default GrabWindow fails to capture the correct pixmap for Gradient Qglwidget .

    HI ,

    I could partially solve this problem my not using QPainter but by using direct OpenGL calls to render the gradient on QGLwidget .

    With this approach grabWidget works fine and generates the desired output but grabWindow does not work properly? .


    Any thought on this ?

Similar Threads

  1. get a ptr of raw data from screen shot
    By saman_artorious in forum Qt Programming
    Replies: 1
    Last Post: 11th August 2013, 13:55
  2. Replies: 3
    Last Post: 5th July 2009, 17:22
  3. QPixmap::grabWindow() problem
    By mtroscheck in forum Qt Programming
    Replies: 1
    Last Post: 7th February 2009, 00:15
  4. Replies: 1
    Last Post: 21st August 2008, 07:44
  5. QTimer single shot and too busy app.
    By Pier in forum Qt Programming
    Replies: 3
    Last Post: 20th March 2007, 14: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
  •  
Qt is a trademark of The Qt Company.