开发者

QtDesigner & PySide: QTableWidget don't get accessible

开发者 https://www.devze.com 2023-04-01 21:37 出处:网络
I made a form in QtDesigner. This form gets loaded from PySide with help of the function widget = loader.load(file, parent)

I made a form in QtDesigner. This form gets loaded from PySide with help of the function

widget = loader.load(file, parent)

However, the QTableWidget (with objectNname buffer_table) don't get accessible with

widget.buffer_table

If I use a QPushButton instead it works. How can I get this working. I'd like to fill up the table in Python.

This is the ui-file i'd like to use: http://pastebin.com/6PZFrvmr

EDIT: When I create a new table and try to load it, it 开发者_开发技巧seems to work. However, if I put it in a QTabWidget I can't access it.

EDIT2: widget.findChild(QWidget, "buffer_table"): Search & find is the trick!


You could try to see if the table is there with: widget.findChild(QWidget, "buffer_table") (even from the parent, since it is a recursive search).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号