[Qt-interest] FW: QAbstractItemModel: Hiding rows

Brad Howes howes at ll.mit.edu
Fri Jul 10 17:49:35 CEST 2009


On Jul 9, 2009, at 4:46 PM, Eric Clark wrote:

> Sorry for responding directly to you Brad, it was an accident when  
> replying. J

No problem.

> Thank you. I think you are suggesting that I just add a new role to  
> the data role? Is that correct? And then have my View use that role  
> to determine if the row should be hidden or not? I like this idea,  
> but could I just add a new flag to the flags function as well?


You could override QAbstractItemModel::flags() since it is virtual.  
However, note that you run the risk of using a bit that might be used  
in future versions of Qt. For QAbstractItemModel::data(), there is a  
QT::UserRole role defined as the first role that can be used by you,  
the developer; there is no equivalent in Qt::ItemFlags.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090710/3671b4a3/attachment-0001.html 


More information about the Qt-interest-old mailing list