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. QListWidget with dynamic icons
Forum Updated to NodeBB v4.3 + New Features

QListWidget with dynamic icons

Scheduled Pinned Locked Moved Solved General and Desktop
qlistwidgetqlistwidgetitemicon
12 Posts 2 Posters 6.1k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    What about delegating the icon load to anther thread and then signal a data change when they are ready ?

    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
    • H Offline
      H Offline
      Harry123
      wrote on last edited by Harry123
      #3

      I would really prefer to avoid creating icons that will never be looked at, if possible.
      I might find myself creating 1000 icons, while the user will never look at more than the first few screens.

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

        Sorry, I just saw that my suggestion is incomplete. Your model should be queried when needed for the icons so what I was suggesting is that when one is queried, you start loading it and then trigger the dataChanged signal.

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

        H 1 Reply Last reply
        0
        • SGaistS SGaist

          Sorry, I just saw that my suggestion is incomplete. Your model should be queried when needed for the icons so what I was suggesting is that when one is queried, you start loading it and then trigger the dataChanged signal.

          H Offline
          H Offline
          Harry123
          wrote on last edited by
          #5

          @SGaist

          Could you please add more details about this procedure.
          I never used model/view.

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

            Which part would like to have more detail on ?

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

            H 1 Reply Last reply
            0
            • SGaistS SGaist

              Which part would like to have more detail on ?

              H Offline
              H Offline
              Harry123
              wrote on last edited by Harry123
              #7

              @SGaist

              I would prefer to use QListWidget, because it is much simpler than using model/view with which I have no experience.
              I need some pointers as to what should be done - classes and functions to call.

              I myself was thinking more in the direction of connecting to the vertical scrollbar of QListWidget and anticipating scrolls, but I'm not sure I would guess correctly from the scroll events exactly which items will be displayed.

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

                If you use QListWidget then you don't have any control over the model so you won't be able to move the image loading part outside of it.

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

                H 1 Reply Last reply
                0
                • SGaistS SGaist

                  If you use QListWidget then you don't have any control over the model so you won't be able to move the image loading part outside of it.

                  H Offline
                  H Offline
                  Harry123
                  wrote on last edited by
                  #9

                  @SGaist

                  I have basically given up on using QListWidget that efficiently.

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

                    What option did you choose ?

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

                    H 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      What option did you choose ?

                      H Offline
                      H Offline
                      Harry123
                      wrote on last edited by
                      #11

                      @SGaist

                      I have divided the list into sections, and modified the UI to show only one section at a time.
                      This solved the performance problem (and maybe even made the UI more user-friendly).

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

                        It's good when it's more friendly :)

                        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