PDA

View Full Version : Strange behaviour by item with Qt::ItemIsUserCheckable



pkj
21st September 2011, 20:50
Idea is to provide user checkable items in qtableview. I am subclassing from QAbstractTableModel, providing Qt::ItemIsUserCheckable for the appropriate columns in flags function.
In the data() function , I provide Qt::Checked/Qt::Unchecked in Qt::CheckStateRole.
In the setData() function, for the role Qt::CheckStateRole i set data as per the value given.

The behavior is very erratic. Edittriggers even if set to none, editing is possible on single click for checkboxes. And while checking/unchecking them, they toggle twice!! This behavior happens sometimes but occasionally enough to be noticeable. Is there a known bug in this regard?

pkj
22nd September 2011, 07:25
There was a bug and it was introduced by me. Qt is alright :) . I am laughing at myself now for jumping the gun and pointing to qt for possible bug :)