[Qt-interest] Model Index Iteration
Scott Aron Bloom
Scott.Bloom at onshorecs.com
Fri Nov 26 03:28:16 CET 2010
If you have the model...
Just do something like
For( int row = 0; row < model->rowCount( parentIdx ); ++row )
{
For( int col = 0; col < model->columnCount( parentIdx ); ++col )
{
QModelIndx idx = model->index( row, column, parentIdx );
.....
}
}
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Jake Colman
Sent: Thursday, November 25, 2010 6:13 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Model Index Iteration
I have a QComboBox with a derived QStandardItemModel. I need to iterate
over the entire model in order to reset a property on each item. I've
gone through the docs but cannot figure it out. Given that I have a
QAbstractItemModel* (actually a pointer to my derived type, of course)
how do I iterate the entire model and gain access to each item? A code
snipper would be really helpful!
Thanks.
...Jake
--
Jake Colman | Director, Software Development
Principia Partners LLC
101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
e: colman at ppllc.com | w: www.principiapartners.com
Credit technology innovation awards winner 2008, 2009 & 2010
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list