[Qt-interest] QCheckBox as editor in QTreeView
Daniele Esposti
expo at expobrain.net
Tue Jun 21 14:05:50 CEST 2011
Hi Andre,
yes, of course, I can also use the CheckStateRole to do that in a more
simple and fancy way. The point is I'm using a delegate to create
different editors (from base text, checkbox, etc. to more costumised
ones) and I found that problem with the QCheckBox widget.
On 21 June 2011 12:12, Andre Somers <andre at familiesomers.nl> wrote:
> 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é
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
--
Daniele Esposti
My Blog http://www.expobrain.net
LinkedIn http://www.linkedin.com/in/danieleesposti
Twitter http://www.twitter.com/#!/expobrain
More information about the Qt-interest-old
mailing list