February 5, 2011

torsten torsten
Lab Rat
23 posts

no icons when deploy application using SVG files

Page  
1

Hello,

i’m having trouble to deploy an application with svg images. If i use png files there is no problem. i tried nearly everything like adding

  1. Q_INIT_RESOURCE(application);

or using a qt.conf

  1. [Paths]
  2. Plugins = plugins

and copied the plugins/imageformats (also iconengines and sqldrivers) folder.

i’m not sure what i’m do wrong… (i also using sqlite, if i point with Plugins to nowhere its not working, with Plugins=plugins it works again, so it can’t be the wrong path)

18 replies

February 5, 2011

Volker Volker
Robot Herder
5428 posts

Which platform are you on?

February 5, 2011

torsten torsten
Lab Rat
23 posts

I’m on windows… i figured out… it was the qtmxl4.dll. The DependencyWalker didn’t show it, but to show svg files you have to delpoy xml to (ok, svg files are xml files;-) ). But no site and no doc shows this depenency

February 5, 2011

Volker Volker
Robot Herder
5428 posts

AFAIK, the dependency walker does not consider the plugins. But you can load the plugin itself into dependency walker and it shows the needed QtXml then.

The missing cross dependencies is indeed a good point. These should be listed somewhere.

February 5, 2011

Volker Volker
Robot Herder
5428 posts
Volker wrote:
The missing cross dependencies is indeed a good point. These should be listed somewhere.

I’ve just added Qt library cross dependencies [developer.qt.nokia.com] to the wiki.

February 16, 2011

torsten torsten
Lab Rat
23 posts

Damn… again…
The QtXml was only in first place a problem… so it works on my system… but after deploy i have the same problems like before… no sqldriver, no icons…

February 16, 2011

torsten torsten
Lab Rat
23 posts

I compiled a static version of qt from source based on this [developer.qt.nokia.com]

After build a static version of my program i the i have sqlite support, but the icons are still missing (did i forget a parameter?)

February 17, 2011

Volker Volker
Robot Herder
5428 posts

You need

  • QtSvg library
  • plugin iconengines/libqsvgicon.dll
  • plugin imageformats/libqsvg.dll
  • the dependencies: QtCore, QtGui, QtXml library

all in the proper directories.

Also, you might want to add the plugin path manually. Add the following your main function, right before doing any Qt related stuff that needs the plugins (eg. GUI classes):

  1. QStringList libPaths = QCoreApplication::libraryPaths();
  2. libPaths << QCoreApplication::applicationDirPath + "/plugins";
  3. QCoreApplication::setLibraryPaths(libPaths);

I have the above in my code and all plugins are found.

February 17, 2011

torsten torsten
Lab Rat
23 posts

Still nothing (or its to late…)
Maybe i make a mistake, so step for step:

1. clone my rep: git@gitorious.org:fixtestpc/fixtestpc.git
2. open project with qt-creator
3. add your code to main/main.cpp
4. choose project “main” and build it with “release” (takes 3-4 minutes)
5. copy the application to INSTALL
6. copy libgcc_s_dw2-1.dll mingwm10.dll QtCore4.dll QtGui4.dll QtOpenGL4.dll QtSvg4.dll QtXml4.dll from C:\Qt\2010.05\qt\bin to INSTALL
7. copy qsvg4.dll from C:\Qt\2010.05\qt\plugins\imageformats to INSTALL/plugins
8. copy qsvgicon4.dll from C:\Qt\2010.05\qt\plugins\iconengines to INSTALL/plugins
9. copy qsqlite4.dll from C:\Qt\2010.05\qt\plugins\sqldrivers to INSTALL/plugins

deploy the application to another computer … application without svg images and sqlite support…

tomorrow (nope… today) i have diploma defense and this thing will not work .

February 17, 2011

Volker Volker
Robot Herder
5428 posts

You have wrong paths:

  • QSvg4.dll goes into INSTALL
  • the plugins must go into a subdir of plugins with the same name they came from (qsvgicon4.dll goes to INSTALL/plugins/iconengines/; qsqlite4.dll goes to INSTALL/plugins/sqldrivers and so on)

February 17, 2011

torsten torsten
Lab Rat
23 posts

That helped… thx.
But i had another problem… i’ve added your code before create the application… so the path wasn’t set correct.

Thx for help

February 17, 2011

Volker Volker
Robot Herder
5428 posts

You should add the code in the main() function, after the creation of QApplication but before doing the GUI stuff.

February 17, 2011

torsten torsten
Lab Rat
23 posts

yes… i did… but not in the first time ;-)

March 1, 2011

Jorj Jorj
Lab Rat
97 posts

This looks like exactly the problem i am having… it is very irritating that it works fine in debug on dev machines, and only breaks on user machines…

Thanks Volker, i will try it tonight.

March 1, 2011

Volker Volker
Robot Herder
5428 posts

Sorry, that’s not irritating, but just plain normal.

On you dev machines you have everything in place, so the parts needed are found. On the user machines you have to install every single piece yourself, if only one is missing, your applications or parts of it can break.

March 1, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

Volker, it seems a similar problem I had using jpg against png images. But in my case I set properly all the dll and the problem remain unsolved… Is it possible that the same principle can be applied also in my case?

Thks

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

Page  
1

  ‹‹ Phonon and setCurrentSource      Adding a Toolbar to children widget of a QSplitter ››

You must log in to post a reply. Not a member yet? Register here!