[Qt-interest] Adding multiple checkboxes to a QTreeView with QFileSystemModel

Sven Grunewaldt strayer at olle-orks.org
Mon Jul 12 14:57:03 CEST 2010


Hi,

I need multiple (currently 3, maybe more in the future) Checkboxes in
front of the first column in a QTreeView. The view is populated by a
QFileSystemModel.

All the examples I can find are about adding ONE checkbox which can be
achieved by setting the checkable-flag or so. Sadly this doesn't work
for more than one checkbox...

I tried QItemDelegate but I don't understand how I should use a delegate
to add multiple checkboxes in ONE column, I guess this class is not made
for stuff like this.
After that I tried subclassing QFileSystemModel and implementing my own
data() function which calls the parent function when the column is
higher than 0, but this leads to access violations and other funny stuff...

How can I achieve this? I'm at a total loss right now...



More information about the Qt-interest-old mailing list