[Qt-interest] QCheckBox as editor in QTreeView

Andre Somers andre at familiesomers.nl
Tue Jun 21 13:12:00 CEST 2011


Op Di, 21 juni, 2011 1:04 pm, schreef Daniele Esposti:
> If you use a QCheckBox as an item editor in a QTreeView under Mac OS X
> is not possible to change the check state by mouse left click.
>
> I attached a small Qt Creator project ti reproduce the issue.
>
> If you run the project, double click on an item, tick the check box,
> under Mac OS X it will remove the editor without changing the item's
> value; it works if during edit you use the space bar to tick the check
> box.
>
> No problems at all under Ubuntu 11.04 and Windows 7.
>
I did not look deeply into your code, but perhaps it is easier to use a
proxy model instead?

This proxy converts a boolean data field into a checkbox (among other
things):
http://developer.qt.nokia.com/wiki/QSortFilterProxyModel_subclass_for_readonly_columns_columns_with_checkboxes_and_password_columns

André





More information about the Qt-interest-old mailing list