PDA

View Full Version : qt5.10 windowsXp strange conflict in displaying rendered Qpixmap in a graphicsView



artome
16th July 2013, 20:17
Hi I'm porting an application from Qt4.8 to 5.10. The application worked well in linux, mac and windows using 4.8.
When I ported it to 5.10 it worked well in linux but in windows only works in some computers (still didn't tried Mac).
The application runs, no error is reported but I cannot see the pixmap image in a graphicsview window.
there a piece of code:


scene.clear();

QPixmap *renderer = new QPixmap(tempfile.fileName().toLatin1().constData() );

scene.clear();
scene.addPixmap(*renderer);
this->ui->graphicsView->setScene(&scene);


I attach two screenshots of exactly the same application in two different windows computers (same binary and same dll's)
93009301

I imagine that there should be any kind of conflict with the windows libraries but have no clue of what it may be and how to get around it.
any hints will be much appreciated.

ChrisW67
16th July 2013, 21:28
Are you using the ANGLE or OpenGL-based Qt build on XP? ANGLE is known to have issues on XP.
http://qt-project.org/wiki/Qt-5-on-Windows-ANGLE-and-OpenGL

artome
16th July 2013, 21:38
I'm using openGl

artome
17th July 2013, 10:02
I still haven't a clue what is going on but I can confirm that the problem is in fact with the rendering of the pixmap on the scene as the program works when i comment the addPixmap and add a simple test instead


//scene.addPixmap(*renderer);
scene.addText("Hello, world!");

artome
17th July 2013, 17:47
It seems that the problem is not in rendering a pixmap but with the QTemporaryFile Class that I use to build my png file. Most likely this class has problems with the mingw+qt5.1+some windows. I'll try to research further.


*************************************

I've found the problem. It is not qt fault, neither mingw or windows it is really my fault. For reasons I do not already remember I was using
tempfile.fileName().toLatin1().constData() instead of just tempfile.fileName() and when the windows user have characters with accents the path of the temporary file became somehow inaccessible. In 4.8 I had the .toAscii() instead of toLatin1() and everything worked fine.