[Interest] Hardware Accerlation problem - Viewport(new GLWidget())

Dietrich.Gossen at continental-corporation.com Dietrich.Gossen at continental-corporation.com
Tue Jan 31 14:02:13 CET 2012


Ok, I solved the problem.
It was actually hardware accerlated but, the problem on the target was the 
caching.
I commented this line in my QGraphicsPixmapItem out:
1.      //setCacheMode(DeviceCoordinateCache);


Dietrich




Von:    Pritam <pritam_ghanghas at infosys.com>
An:     interest at qt-project.org
Datum:  31.01.2012 11:52
Betreff:        Re: [Interest] Hardware Accerlation problem - Viewport(new 
GLWidget())
Gesendet von:   
interest-bounces+dietrich.gossen=continental-corporation.com at qt-project.org



On Monday 30 January 2012 02:15 PM, 
Dietrich.Gossen at continental-corporation.com wrote: 
Hi, 
somehow the Hardware Accerlation with GLWidget doesn’t work.
I think I am missing something trivial. 
thats how my code looks like: 
1.         int main(int argc, char *argv[]) 
2.        { 
3.            QApplication a(argc, argv); 
4.            a.setGraphicsSystem("native"); 
5.          
6.            QGraphicsScene scene; 
7.            scene.setSceneRect(0.0, 0.0, 500.0, 500.0); 
8.          
9.          
10.            QGraphicsView view(&scene); 
11.            view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 
12.            view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 
13.          
14.            QGLFormat fmt = QGLFormat::defaultFormat(); 
15.          
16.            fmt.setDoubleBuffer(true); 
17.            fmt.setSwapInterval(1); 
18.          
19.            QGLWidget* glWidget = new QGLWidget(fmt); 
20.          
21.            view.setGeometry(0, 0, 500, 500); 
22.            view.setViewport(glWidget); 
23.          
24.            view.setViewportUpdateMode( 
25.                        QGraphicsView::FullViewportUpdate); 
26.          
27.            view.viewport()->setAttribute(Qt::WA_OpaquePaintEvent); 
28.            view.viewport()->setAttribute(Qt::WA_NoSystemBackground); 
29.          
30.          
31.            MainWindow w(&scene); 
32.          
33.            view.show(); 
34.            
35.            return a.exec(); 
36.        } 
The cpu load ist steally 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. 

Dietrich 

I dont know why GLWidget is not working for you. I dont see anything wrong 
there. 
But " a.setGraphicsSystem("native"); " is not doing anything.
It should be called before application construction to have any effect .
-- 
Regards,
Pritam
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended 
solely 
for the use of the addressee(s). If you are not the intended recipient, 
please 
notify the sender by e-mail and delete the original message. Further, you 
are not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys 
has taken 
every reasonable precaution to minimize this risk, but is not liable for 
any damage 
you may sustain as a result of any virus in this e-mail. You should carry 
out your 
own virus checks before opening the e-mail or attachment. Infosys reserves 
the 
right to monitor and review the content of all messages sent to or from 
this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 

Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120131/10464b9f/attachment.html>


More information about the Interest mailing list