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. ItemSelectionModel from QML
Qt 6.11 is out! See what's new in the release blog

ItemSelectionModel from QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 528 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.
  • B Offline
    B Offline
    Bob64
    wrote on last edited by
    #1

    Hi,

    I am trying to use ItemSelectionModel to manage selections in a ListModel, ListView-based component I am working on.

    I have got basic functionality working with single selection. So if I select with no modifiers, a single item is selected, and if I select with Control modifier, the single selection is added to any existing selection.

    I now want to get range selection working (with Shift modifier).

    I believe I need to call the overload of ItemSelectionModel.select that accepts a QItemSelection. However I do not know how to construct a QItemSelection from QML. I found this documentation that suggests QItemSelection is exposed to QML as a vector of QItemSelectionRange and that the latter is exposed as a 'value type' to QML. But how do I actually construct one??

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bob64
      wrote on last edited by
      #2

      I guess no-one else has tried to use this?

      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