diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 345b40ea21..247addbcc9 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -291,27 +291,10 @@ void TocWidget::setTreeDepth(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 }