src/hbwidgets/itemviews/hbtreemodeliterator_p.cpp
changeset 6 c3690ec91ef8
parent 5 627c4a0fd0e7
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
    95 
    95 
    96 /*!
    96 /*!
    97     \reimp
    97     \reimp
    98     Returnes index of item, which is visible at pos ordinal under parent. 
    98     Returnes index of item, which is visible at pos ordinal under parent. 
    99     Indexes in collapsed parents are not taken into account.
    99     Indexes in collapsed parents are not taken into account.
   100     Very slow - need to interate throught whole model in worst case!
   100     Very slow - need to interate through whole model in worst case!
   101 */
   101 */
   102 QModelIndex HbTreeModelIterator::index(int pos, const QModelIndex &parent) const
   102 QModelIndex HbTreeModelIterator::index(int pos, const QModelIndex &parent) const
   103 {
   103 {
   104     Q_D(const HbTreeModelIterator);
   104     Q_D(const HbTreeModelIterator);
   105     QModelIndex index;
   105     QModelIndex index;
   293                     this, SLOT(rowsRemoved(QModelIndex,int,int)));
   293                     this, SLOT(rowsRemoved(QModelIndex,int,int)));
   294             connect(d->mModel, SIGNAL(columnsInserted(QModelIndex,int,int)),
   294             connect(d->mModel, SIGNAL(columnsInserted(QModelIndex,int,int)),
   295                     this, SLOT(columnsInserted(QModelIndex,int,int)));
   295                     this, SLOT(columnsInserted(QModelIndex,int,int)));
   296             connect(d->mModel, SIGNAL(columnsRemoved(QModelIndex,int,int)),
   296             connect(d->mModel, SIGNAL(columnsRemoved(QModelIndex,int,int)),
   297                     this, SLOT(columnsRemoved(QModelIndex,int,int)));
   297                     this, SLOT(columnsRemoved(QModelIndex,int,int)));
       
   298             connect(d->mModel, SIGNAL(layoutChanged()),
       
   299                     this, SLOT(modelLayoutChanged()));
   298         }
   300         }
   299     } else {
   301     } else {
   300         setRootIndex(rootIndex);
   302         setRootIndex(rootIndex);
   301     }
   303     }
   302 }
   304 }
   391     Q_UNUSED(start);
   393     Q_UNUSED(start);
   392     Q_UNUSED(end);
   394     Q_UNUSED(end);
   393     d->resetCache();
   395     d->resetCache();
   394 }
   396 }
   395 
   397 
       
   398 void HbTreeModelIterator::modelLayoutChanged()
       
   399 {
       
   400     Q_D(HbTreeModelIterator);
       
   401     d->resetCache();
       
   402 }
       
   403 
   396 #include "moc_hbtreemodeliterator_p.cpp"
   404 #include "moc_hbtreemodeliterator_p.cpp"
   397 
   405