}
+#if 0
/* FIXME (Ugras 17/11/06):
I have implemented a indexDepth function to get the model indices. In my
opinion, somebody should derive a new qvariant class for tocModelItem
return index.parent() == QModelIndex()
? depth : indexDepth(index.parent(), depth);
}
-
+#endif
void TocWidget::on_depthSL_valueChanged(int depth)
{
if (!tocTV->model())
return;
-#if QT_VERSION >= 0x040300
- // this should be faster than our own code below
if (depth == 0)
tocTV->collapseAll();
else
tocTV->expandToDepth(depth - 1);
-#else
- // expanding and then collapsing is probably better,
- // but my qt 4.1.2 doesn't have expandAll()..
- //tocTV->expandAll();
- QModelIndexList indices = tocTV->model()->match(
- tocTV->model()->index(0, 0),
- Qt::DisplayRole, "*", -1,
- Qt::MatchFlags(Qt::MatchWildcard|Qt::MatchRecursive));
-
- int size = indices.size();
- for (int i = 0; i < size; i++) {
- QModelIndex index = indices[i];
- tocTV->setExpanded(index, indexDepth(index) < depth_);
- }
-#endif
}