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. ListView with Checkbox and FolderListModel
Forum Updated to NodeBB v4.3 + New Features

ListView with Checkbox and FolderListModel

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.7k 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.
  • Q Offline
    Q Offline
    QuantumCD
    wrote on 29 May 2013, 02:11 last edited by
    #1

    I've been working on a ListView in QML which is the central part of my application. I'm looking to add a checkbox to the delegates. I got the checkboxes set up with a state and transition, as well as images, and everything is positioned correctly. The part I'm stumped on is adding a variable such as isChecked so that I can pull the value from the model and apply it to the delegate. Also, I'll need to use this value later to remove the files from the ListView and underlying directory based on the boolean.

    I know I could probably do this with a custom C++ type somehow, but I don't know how exactly to go about subclassing FolderListModel specifically. The functionality wouldn't be too complex--just a boolean member with a property or something I would guess. Before I go to the trouble, would there be an easier way? I have a hunch that there is someway to add a value to the model after-the-fact; then I could read it from the same model in the delegate (I believe). However, I wouldn't know exactly how to go about that either, unfortunately. I'm relatively new to QML, so forgive me in advance if there are some very basic things I have yet to figure out/learn while trying out relatively complex features of the language.

    1 Reply Last reply
    0

    1/1

    29 May 2013, 02:11

    • Login

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