Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. To Reduce loading time of Images Large Images
Qt 6.11 is out! See what's new in the release blog

To Reduce loading time of Images Large Images

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 758 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phadnis
    wrote on last edited by
    #1

    Hi,

    1. I am loading large images of size 2MB in a ListView of QML.Still Images glitter.
      If I reduce the size to 40KB then there is no glittering. So how can I remove glittering even if the size is 2MB.

    2. I want to Reduce Loading time, should I use QImageReader along with QQuickImageProvider

    Have gone through Qt Doc...... Performance Considerations And Suggestions and have met them

    below is the code

    void StatisticsImageProvider::run()
    {

    QString separator ="";
    QString textDelimiter = ",";
    CsvFileHandler::GetInstance()->processData(IMAGE_LIST_CSV_FILE,separator, textDelimiter);
    QStringList list=CsvFileHandler::GetInstance()->getListOfImageKeys();
    QString dirpath=QGuiApplication::applicationDirPath() + "/../Resources/image/TotalImages/"; 
    for(int i=0;i<list.length();++i){
       QString path=dirpath+list.at(i)+".png";
       QPixmap map;
       map.load(path);
        map.scaled(253,250);
       map_Pixmap.insert(list.at(i),map);
    }
    

    }

    QPixmap StatisticsImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
    {
        QPixmap map(map_Pixmap.value(id));
        return map;
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      As soon as you use QImage or QPixmap, you'll use QImageReader. QQuickImageProvider allows you to pass whatever image you want to your QtQuick GUI. Whether it's a generated or loaded image doesn't matter.

      If you have a set of large images, you should rather consider creating thumbnails that loads quickly and only load the full resolution images on demand.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved