[Qt-interest] Selecting multiple files on different locations using QFileDialog
Andre Somers
andre at familiesomers.nl
Fri Dec 31 11:17:14 CET 2010
Op 31-12-2010 10:17, Jeffery MacEachern schreef:
> On Fri, Dec 31, 2010 at 01:07, Onur Tugcu<onur.tugcu at gmail.com> wrote:
>> I've seen a tree view with checkboxes used for such scenarios.
> Ah, good point - that didn't occur to me due to the context in which
> I've seen it. That would also nicely avoid the problem (or annoyance,
> at least) of the user selecting a superset of another selection.
Such a thing can be easily achieved by creating a proxy model that sets
the appropriate flag to make an item checkable and outputs the right
checkstate from data() and sets it from setData(). I have just created
one a week or two ago (sorry, can not share) which was quite simple. I
abused a QItemSelectionModel inside my QSortFilterProxyModel subclass to
keep track of what items were checked, which works well and results in
remarkably little code. I use it on a QFileSystemModel and that works
just fine.
André
More information about the Qt-interest-old
mailing list