Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cache problem when preview picture use QAbstractItemDelegate in QListWidget.
QtWS25 Last Chance

Cache problem when preview picture use QAbstractItemDelegate in QListWidget.

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 1.6k Views
  • 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    i write a delegate to preview the picture in the QListWidget, but there are lots of pictures, and there should be a cache method to Only load and show the Items in the current viewRect.
    how can i get the items in the current viewport?
    and now i use QPixmap, is there any way to cache it? i know when construct it use: QPixmap ppp(strFilePath), it will be loaded and the file is read...so is there any way to use it in order to work with the Cache mechanism?

    thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QPixmapCache and visualItemRect comes to mind for that

      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
      0
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        thank you, is it right to use QPixmap to open the image file in order to preview the images?
        i found when there are lots of image files, it's very slow to load.
        is there any good way to accelerate this?
        or may i load there QListWidgetItems one by one, which will make the user feel a little better...

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You can create downscaled thumbnails of the images and load them rather than the original

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

          O 1 Reply Last reply
          0
          • O Offline
            O Offline
            opengpu2
            wrote on last edited by
            #5

            u mean i manually downscale the original image to another image file whose resolution is smaller.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Yes, that's it

              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
              0
              • SGaistS SGaist

                You can create downscaled thumbnails of the images and load them rather than the original

                O Offline
                O Offline
                opengpu2
                wrote on last edited by
                #7

                @SGaist You can create downscaled thumbnails of the images and load them rather than the original

                is there any way to use Qt to downscale various kind formats of pictures?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @opengpu2 See @Chris-Kawa answer to your other thread

                  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
                  0

                  • Login

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