[Qt-interest] Bug in OpenGL impl on Mac?

John Clayton john_clayton at me.com
Sun Jan 2 21:05:14 CET 2011


Hi

I need to know if there are known problems on Mac computers with the open gl v2 engine of Qt. 

I've got a simple piece of example code that uses qgraphicsview to draw one texture, and one text item - all using a QGLWidget backed QGraphicsView.   The texture has a yellow rect drawn around it using the QPainter APIs, text is drawn using the QGraphicsTextItem object.

The results of this program vary; depending on the computer I run it on - both computers I've got available are running Mac OS X 10.6.3.

The "old" mac has a Radeon X1900 graphics card, the "new" mac has a GeForce GT 330M graphics card. 

The behaviour on the "old" Mac, using the Qt OpenGLv2 API (default as of 4.6x I believe) is:
	- the texture graphic is drawn (using QGLWidget::drawTexture)
	- no QPainter API calls draw using the current pen; the color black is used instead - always
	- the background is black instead of lightGray
	
The behaviour on the "new" Mac is:
	- it all works fine - everything draws correctly

I tried switching to the OpenGL v1 graphics engine explicitly; by doing this just after QApplication is instantiated
    QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);

when I do this, the behaviour changes to this:

"old" Mac (Radeon X1900 card):
	- the outline of the textured object is drawn, the texture is NOT drawn
	- text is rendered properly

"new" Mac (GeForce GT 330M):
	- exactly the same as the "old" Mac, the texture is not drawn.

Essentially then; the new Qt OpenGL v2 paint engine seems to work well on the "new" Mac, but not at all well on the old one.  

My goal is to use the v2 opengl engine using Qt to build my software, but if the Qt engine can't support all the intel mac graphics cards - then its not going to be an option (just to give an idea of why I'm asking).  

Does anyone have suggestions as to how I could find out what the problem is?  

The code is here - called GraphicsViewFlickerSpike.zip - inappropriate name I know.
	https://files.me.com/john_clayton/r0p4cx

To toggle between the two working / not working states, just change the preferred paint engine in main, code looks like this - comment/uncomment it:
QApplication app(argc, argv);
    QGL::setPreferredPaintEngine(QPaintEngine::OpenGL2);

Any tips or help is very very much appreciated - I'm gradually coming to the conclusion that Qt isn't consistent across its promised set of platforms to use it - but if I can find a solution I'll be willing to give it another shot. 

Thanks
--
John Clayton
Skype: johncclayton




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110102/39636462/attachment.html 


More information about the Qt-interest-old mailing list