Results 1 to 1 of 1

Thread: Opengl problem with graphicsview

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Opengl problem with graphicsview

    Hi everybody...
    I've problem using QGLWidget as viewport of QGraphicsView.
    I've used two lines of below code:

    view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
    view->setViewportUpdateMode(QGraphicsView::FullViewport Update);

    But when i used below code in the scene:

    void scene::drawBackground(QPainter *painter,
    const QRectF &)
    {
    if (painter->paintEngine()->type()
    != QPaintEngine::OpenGL) {
    qWarning("OpenGLScene: drawBackground needs a "
    "QGLWidget to be set as viewport on the "
    "graphics view");
    return;
    }

    the warning will show, that means the paintEngine is not rendered by OpenGL. My OS is ubuntu and my graphics card is ATI 4350. What's the problem. Could it be hardware problem????

    For more info: I'll get following warnnig frequently:
    QGLContext::makeCurrent(): Cannot make invalid context current.

    Thanks All friends
    Last edited by alizadeh91; 28th April 2012 at 09:56.

Similar Threads

  1. Problem using GraphicsView
    By rav in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2011, 14:08
  2. graphicsview & opengl version 1.4 problem
    By dkoryagin in forum Qt Programming
    Replies: 3
    Last Post: 15th September 2010, 07:20
  3. draw transparent buttons on top of an opengl graphicsview
    By billconan in forum Qt Programming
    Replies: 0
    Last Post: 7th November 2009, 20:38
  4. No text antialiasing with OpenGL graphicsview
    By pherthyl in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2009, 22:47
  5. graphicsview Problem
    By tampstaffs in forum Qt Programming
    Replies: 6
    Last Post: 8th February 2009, 19:59

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.