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. [Solved] Mulitple selection in ListView

[Solved] Mulitple selection in ListView

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 3.6k 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.
  • R Offline
    R Offline
    riaank
    wrote on last edited by
    #1

    As far as I understand it multiple selection in a listview is not possible.
    Will it ever be possible or is the design of the QML listview such that it would never be?
    Is there any workaround strategy to have some sort of multiple selection?
    What would be the issues around such a strategy?

    Riaan

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      The design strategy around it is quite simple: add a selection state to your model.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        riaank
        wrote on last edited by
        #3

        Thanx for the answer

        I thought it would be something like that. It sort of blurs the lines a bit about the " ... UI in QML and business logic in C++ .. " If you use C++ based models. But that does not really bother me and .... I might even be wrong :).
        Some other issues are (on the desktop) is the "shift-click to select an range" action. Is it possible to filter out just the shift click in a mousearea of the delegate and letting the parent of the delegate catch the rest and handle it as usual?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          I think the selection state is business logic, but the lines are of course blurry. It is just up to the GUI to on the one hand render, and on the other end manipulate that state.

          As to your second question: that's where things really become blurry :-) I don't have a ready-made answer to this one.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            riaank
            wrote on last edited by
            #5

            Thanx for the answers

            I am marking the thread solved but I still not sure how I would do mouse event handling on QML side without handling all of the mouse events that the list would have handled for me.

            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