Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Showcase
  4. Decorating your item models with a checkbox
Forum Updated to NodeBB v4.3 + New Features

Decorating your item models with a checkbox

Scheduled Pinned Locked Moved Showcase
2 Posts 1 Posters 4.3k 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.
  • A Offline
    A Offline
    andre
    wrote on last edited by
    #1

    Introducing CheckableProxyModel:

    In response to a "question":http://developer.qt.nokia.com/forums/viewthread/5051/ here on the forum, I started thinking about creating a generalized component to add check boxes to item models. The result is a subclass of QSortFilterProxyModel that decorates its source model with a checkbox in column 0 of each row. The proxy also handles tree-type models.

    !http://dl.dropbox.com/u/16442531/CheckableProxyModelDemo.png(Demo application showing the capabilities of CheckableProxyModel)!

    The class features API to check and uncheck items in from your model, and notifies you using a signal when the list of (un) selected items has changed.

    The source code is available from "Gitorious":https://gitorious.org/checkableproxymodel, and licenced under GPL-3.

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

      I have also added this as a "snippet on the wiki":https://developer.qt.nokia.com/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox.

      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