Qt-QTreeView水平滚动条从不出现在项目碰到滚动条边缘时

时间:2019-05-21 02:07:28

标签: qt

我有一个在QTreeView中显示的文件层次结构。但是,当我展开所有可扩展项时,它们会碰到滚动条的边缘。只有垂直的一个有效。

enter image description here

这些代码行没有进行任何更改。

connect(view, SIGNAL(expanded(const QModelIndex&)), this, SLOT(makeVisible(const QModelIndex&)));

void Hierarchy::makeVisible(const QModelIndex& index)
{
    view->scrollTo(index, QAbstractItemView::EnsureVisible);
}

0 个答案:

没有答案