Results 1 to 4 of 4

Thread: [solved]QImage Load issue

Hybrid 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 Re: QImage Load issue

    Even after appending the full path, QImage::Load doesnt work

    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. QString filename = listfiles.at(i);
    13. QString filepath = dir.absoluteFilePath(filename);
    14. bool x = tmp.load(filepath);
    15. //bool x = tmp.load("/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes/Black Hexagon.png");
    16. if(x == true)
    17. {
    18. thumb = (tmp.scaled( 1240, 1480 ).scaled( sizeW, sizeH, Qt::KeepAspectRatio )); //two passes
    19. modl->setData( modl->index( i, 0 ), thumb, Qt::DecorationRole );
    20. }
    21.  
    22. }
    To copy to clipboard, switch view to plain text mode 

    The images have been taken from MACOS, and the work environment is linux,qt
    Is that the issue ?

  2. #2
    Join Date
    Jun 2010
    Location
    Hangzhou, China
    Posts
    10
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QImage Load issue

    try use an easy directory instead of "/home/kamlesh/Gall/GALL/images/eBeam Gallery/Art & Design/2D Shapes/", such as "/tmp/1.png"
    hope to help you.

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.