PDA

View Full Version : .SVG pictures not displayed in Windows XP



sedi
22nd July 2012, 17:30
Hi,
my application displays svg scaleable images. It's working wonderfully on my own system, but not on the WinXP machine I have to deploy it to.

I have done the following steps:

added QtSvg4.dll (364kB version) and QtSvgd4.dll (5.465 kB version) to the application directory
added qsvg4.dll (74kB version) and qsvgd4.dll (727 kB version) to subdir \imageformats
added qsvgicon4.dll (96kB version) and qsvgicond4.dll (828 kB version) to subdir \iconengines


-In main.cpp I've added the library paths:

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.addLibraryPath(QDir::currentPath()+"/imageformats/");
app.addLibraryPath(QDir::currentPath()+"/iconengines/");
[--> ...open MainWindow]
}

I set up the picture this way:

bool ButtonItem::setPicture(QString fileName, QString pixPath)
{

if (fileName.isEmpty()){
this->fotoPixmapItem->setVisible(false);
return true;
}
this->fotoPixmapItem->setVisible(true);
QPixmap *pix;
pix = new QPixmap;
pix->load(pixPath + fileName);
bool erfolg = !pix->isNull();
if (erfolg){
delete this->fotoPixmap;
this->fotoPixmap=new QPixmap(*pix);
this->fotoPixmapItem->setPixmap(pix->scaledToHeight(this->bSize-(this->bSize/15),Qt::FastTransformation));
this->updateButton();
}
delete pix;
return erfolg;
}

Update:
QImageReader::supportedImageFormats();
shows svg as well as svgz - even on the target system!

Any ideas what I do wrong or miss?

sedi
22nd July 2012, 22:27
Hm. I have no idea whatsoever why it suddenly started to work like a charm - weird. But anyway - it works and suddenly does so on all systems I test it on.
I let the question remain here because I've not yet seen a full list of all the files / subdirs needed to have svg support - especially regarding the file sizes - many people struggle because of having copied the wrong dlls with identical file names from within the qtdir tree.