简体   繁体   English

PyQt:如何在选项卡小部件中获取当前的tablewidget?

[英]PyQt:How do I get the current tablewidget in a tabs widget?

I have a tab widget with tablewidgets in each one, containing cells with links.I know how to get the current text from a tablewidget and open it in a browser,which is what i want to do. 我有一个每个都带有tablewidget的选项卡小部件,其中包含带有链接的单元格。我知道如何从tablewidget获取当前文本并在浏览器中打开它,这就是我想要做的。

selection=str(self.tableWidget_1.currentItem().text()).encode('utf8')
webbrowser.open(selection,new=2)

My problem is that I don't know how to get the current tablewidget instead of predetermined like above.Any ideas?Thanks. 我的问题是我不知道如何获取当前的tablewidget,而不是像上面那样预先确定。有什么想法吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM