Results 1 to 2 of 2

Thread: .SVG pictures not displayed in Windows XP

  1. #1
    Join Date
    Jan 2012
    Location
    Dortmund, Germany
    Posts
    159
    Thanks
    69
    Thanked 10 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default .SVG pictures not displayed in Windows XP

    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:
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4. app.addLibraryPath(QDir::currentPath()+"/imageformats/");
    5. app.addLibraryPath(QDir::currentPath()+"/iconengines/");
    6. [--> ...open MainWindow]
    7. }
    To copy to clipboard, switch view to plain text mode 

    I set up the picture this way:
    Qt Code:
    1. bool ButtonItem::setPicture(QString fileName, QString pixPath)
    2. {
    3.  
    4. if (fileName.isEmpty()){
    5. this->fotoPixmapItem->setVisible(false);
    6. return true;
    7. }
    8. this->fotoPixmapItem->setVisible(true);
    9. QPixmap *pix;
    10. pix = new QPixmap;
    11. pix->load(pixPath + fileName);
    12. bool erfolg = !pix->isNull();
    13. if (erfolg){
    14. delete this->fotoPixmap;
    15. this->fotoPixmap=new QPixmap(*pix);
    16. this->fotoPixmapItem->setPixmap(pix->scaledToHeight(this->bSize-(this->bSize/15),Qt::FastTransformation));
    17. this->updateButton();
    18. }
    19. delete pix;
    20. return erfolg;
    21. }
    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?
    Last edited by sedi; 22nd July 2012 at 21:01. Reason: updated contents

  2. #2
    Join Date
    Jan 2012
    Location
    Dortmund, Germany
    Posts
    159
    Thanks
    69
    Thanked 10 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Talking Re: .SVG pictures not displayed in Windows XP [Solved]

    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.

Similar Threads

  1. Systray icon no displayed under windows seven
    By flamaros in forum Qt Programming
    Replies: 2
    Last Post: 12th February 2011, 15:10
  2. Add pictures to tableview
    By Goof in forum Newbie
    Replies: 3
    Last Post: 12th January 2011, 05:21
  3. Add pictures svg in QIcon
    By giorgik in forum Qt Programming
    Replies: 2
    Last Post: 7th September 2010, 10:00
  4. Help with opening many pictures
    By philipp1 in forum Qt Programming
    Replies: 3
    Last Post: 14th October 2006, 01:13
  5. Replies: 6
    Last Post: 10th April 2006, 11:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.