QtDesigner & PySide: QTableWidget don't get accessible

二次信任 提交于 2019-12-30 10:10:49

问题


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!


回答1:


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).



来源:https://stackoverflow.com/questions/7250727/qtdesigner-pyside-qtablewidget-dont-get-accessible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!