PDA

View Full Version : Application doesn't display images



satoshi
2nd January 2010, 11:54
Hi there,
When developing my application on Qt Creator and I launch the program from there, all goes fine. Also when executing the .exe locally.

But when i try the program on another computer (Windows XP SP3) which doesn't have Qt installed, images are not displayed. These images are svg and gif. I configured Qt with the option -qt-gif but I think that the problem isn't gif images because also svg images are not displayed.

With the program executable I supply also these files:

libgcc_s_dw2-1.dll
mingwm10.dll
qgif4.dll
qsvg4.dll
QtCore4.dll
QtGui4.dll


Images are embedded in the .exe files through the qrc resource file:

<RCC>
<qresource>
<file>BalloonSat.svg</file>
<file>dash.gif</file>
<file>dashdot.gif</file>
<file>dashdotdot.gif</file>
<file>dot.gif</file>
<file>dots.gif</file>
<file>lines.gif</file>
<file>solid.gif</file>
<file>steps.gif</file>
<file>sticks.gif</file>
</qresource>
</RCC>

Which is located in the /icons directory (in the .pro there is "RESOURCES += icons/BalloonSat.qrc"). Then I load images like here:

fWindow->setWindowIcon(QIcon(":BalloonSat.svg"));

Using Windows XP SP3, Qt 4.5.3 and Qt Creator 1.3.0

Anyone can help me?

Sorry for my english, hope you can understand my problem

Thanks, Dario

numbat
2nd January 2010, 12:01
I think you need to put the image plugins in an imageformats subdirectory. See deploying on Windows (http://doc.trolltech.com/4.6/deployment-windows.html#qt-plugins).

satoshi
2nd January 2010, 12:13
I think you need to put the image plugins in an imageformats subdirectory. See deploying on Windows (http://doc.trolltech.com/4.6/deployment-windows.html#qt-plugins).
Really thanks, that solved the gif problem!

But I still have the svg problem. When setting the icon like specified before, this icon is correctly displayed in QMainWindow and related QDialogs bars. But I want to show the icon also in the about messagebox (QMessageBox::about(...)) like in the "browser" demo of Qt. Actually it is displayed in the about bar but not near the text.

Now the dll's are located like:

libgcc_s_dw2-1.dll
mingwm10.dll
QtCore4.dll
QtGui4.dll
imageformats/qgif4.dll
imageformats/qsvg4.dll
iconengines/qsvgicon4.dll


Thanks, Dario

satoshi
2nd January 2010, 12:33
Solved, svg icon need QtSvg4.dll

Final dll's:

libgcc_s_dw2-1.dll
mingwm10.dll
QtCore4.dll
QtGui4.dll
QtSvg4.dll
imageformats/qgif4.dll
imageformats/qsvg4.dll


Thanks ;)

Dario