Hardware Accerlation problem - Viewport(new GLWidget())
-
Hi,
somehow the Hardware Accerlation with GLWidget doesn't work.
I think I am missing something trivial.thats how my code looks like:
@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setGraphicsSystem("native");QGraphicsScene scene; scene.setSceneRect(0.0, 0.0, 500.0, 500.0); QGraphicsView view(&scene); view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); QGLFormat fmt = QGLFormat::defaultFormat(); fmt.setDoubleBuffer(true); fmt.setSwapInterval(1); QGLWidget* glWidget = new QGLWidget(fmt); view.setGeometry(0, 0, 500, 500); view.setViewport(glWidget); view.setViewportUpdateMode( QGraphicsView::FullViewportUpdate); view.viewport()->setAttribute(Qt::WA_OpaquePaintEvent); view.viewport()->setAttribute(Qt::WA_NoSystemBackground); MainWindow w(&scene); view.show(); return a.exec();
}@
The cpu load is still quite heavy (~90 %)
Does anyone has an idea why it's not working?
I am using the same settings with a QML/C++ application and it works fine .. with hardware accerlation. -
I have the same problem.
I've been testig "this example":http://doc.qt.nokia.com/qq/qq26-openglcanvas.html, but don't work on my archlinux. The line of code:@view.setViewport(glWidget);@
don't work poperly.
BR,
-
[quote author="qtd1d1" date="1327678090"]What kind of hardware ...[/quote]
I'm using a simple Intel chipset with vesa driver, but there is no problem. I have too a Xp 64 and have the same problem.
When I try to set OpenGL render engine to the QGraphicsView via
@QGraphicsView::setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers));@[quote author="Andre" date="1327699046"]Do your openGL samples like Gears work properly and hardware accelerated?[/quote]
I'm tested the drivers and OpenGl configuration, the QtOpenGl examples work well. -
Ok, I'll check that..
Thank you.
BR,