PyQT QTreeWidget迭代
我在 QTreeWidget 中有两列,一列代表 url 列表,第二列代表结果。我已加载第一列中的网址列表,现在我想迭代此列表,并在迭代期间更改第二列中的文本。如何实现这一目标?
I have two columns in a QTreeWidget, one column represents a list of urls and the second represents results. I have loaded the list of urls in first column and now I want to iterate this list and during the iteration, change the text in the second column. How to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以调用 QTreeWidget.invisibleRootItem() 来接收根项,并且然后使用 QTreeWidgetItem API迭代项目。
示例:
我假设 self.treeWidget 填充为:
You can call QTreeWidget.invisibleRootItem() to receive the root item, and then use the QTreeWidgetItem API to iterate through the items.
Example:
I am assuming
self.treeWidget
is populated by: