mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 21:05:12 +00:00
Leftover.
This commit is contained in:
parent
4a0911f25e
commit
38c836f65d
@ -291,27 +291,10 @@ void TocWidget::setTreeDepth(int depth)
|
|||||||
if (!tocTV->model())
|
if (!tocTV->model())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if QT_VERSION >= 0x040300
|
|
||||||
// this should be faster than our own code below
|
|
||||||
if (depth == 0)
|
if (depth == 0)
|
||||||
tocTV->collapseAll();
|
tocTV->collapseAll();
|
||||||
else
|
else
|
||||||
tocTV->expandToDepth(depth - 1);
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user