擅长:python、mysql、java
<p>需要设置文件列表视图的根索引:</p>
<pre><code>def clicked(self, index):
# the signal passes the index of the clicked item
dir_path = self.filemodel.filePath(index)
root_index = self.filemodel.setRootPath(dir_path)
self.file_view.setRootIndex(root_index)
</code></pre>