Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用自动更新更改 QTreeView,并且我可以使用此代码设置路径
tree->setCurrentIndex(fsModel->index(QDir::currentPath())); // or any path##标题##从这个链接得到
tree->setCurrentIndex(fsModel->index(QDir::currentPath())); // or any path
但我的问题是,一旦 CurrentIndex 更改为文件夹,我该如何扩展?
请再次忽略它 tree->setExpanded(fsModel->index(QDir::currentPath())); 会这样做。