Results 1 to 4 of 4

Thread: [solved]QImage Load issue

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default [solved]QImage Load issue

    Hi
    I have a small piece of code to load a list of images

    Qt Code:
    1. void MainWindow::listdisplay()
    2. {
    3. QDir dir("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes");
    4. dir.setFilter(QDir::Files);
    5. QList<QImage> images;
    6. QImage thumb, tmp;
    7. int sizeW = 20;
    8. int sizeH = 20;
    9. QStringList listfiles = dir.entryList(QStringList()<<"*.png",QDir::Files);
    10. for(int i=0;i<=listfiles.count();i++)
    11. {
    12.  
    13. [B] QString filename = listfiles.at(i);
    14. bool x = tmp.load(filename);[/B]
    15. //bool x = tmp.load("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes/Black Hexagon.png");
    16. if(x == true){
    17. thumb = (tmp.scaled( 1240, 1480 ).scaled( sizeW, sizeH, Qt::KeepAspectRatio )); //two passes
    18. modl->setData( modl->index( i, 0 ), thumb, Qt::DecorationRole );}
    19. }
    20. //listwidget->addItems(listfiles);
    21. viw->setModel(modl);
    22. viw->show();
    23.  
    24. }
    To copy to clipboard, switch view to plain text mode 

    Issue is that , I am able to get the filename , but when I use
    QImage::load(filename)
    it returns FALSE value
    Last edited by kamlmish; 21st December 2010 at 10:16.

Similar Threads

  1. [Qt4] How to load Url image into QImage?
    By Gonzalez in forum Qt Programming
    Replies: 6
    Last Post: 13th October 2014, 10:10
  2. Unable to load gif file in QImage.
    By spsingh in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2010, 09:08
  3. [mac] QImage.load fails
    By snoopy67 in forum Qt Programming
    Replies: 4
    Last Post: 7th November 2007, 14:06
  4. Low-level error conditions on QImage.load()
    By bruccutler in forum Newbie
    Replies: 3
    Last Post: 19th January 2007, 21:09

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
  •  
Qt is a trademark of The Qt Company.