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[])
{
app.
addLibraryPath(QDir::currentPath()+"/imageformats/");
app.
addLibraryPath(QDir::currentPath()+"/iconengines/");
[--> ...open MainWindow]
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.addLibraryPath(QDir::currentPath()+"/imageformats/");
app.addLibraryPath(QDir::currentPath()+"/iconengines/");
[--> ...open MainWindow]
}
To copy to clipboard, switch view to plain text mode
I set up the picture this way:
{
if (fileName.isEmpty()){
this->fotoPixmapItem->setVisible(false);
return true;
}
this->fotoPixmapItem->setVisible(true);
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;
}
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;
}
To copy to clipboard, switch view to plain text mode
Update:
QImageReader::supportedImageFormats();
shows svg as well as svgz - even on the target system!
Any ideas what I do wrong or miss?
Bookmarks