QtDesigner y PySide: QTableWidget no se vuelve accesible

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!

preguntado el 30 de agosto de 11 a las 22:08

Could you post your .ui file ? -

@alexisdm: i've edited the post and added the file. -

1 Respuestas

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

Respondido 31 ago 11, 16:08

ok, seems that the problem is deeper. thanks for your engagement. the pyside python code is executed in IDAPython (python module for IDA Pro). but if I try to acces widget.buffer_table this error appears: PySide.QtGui.QWidget has no attribute buffer_table. - AkaBkn

I think the surrounding QTabWidget may be a problem. - AkaBkn

@AkaBkn 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). - alexisdm

Thanks! That did the trick. It works now except that it overwrites the header with (1, 2, 3, 4, 5...). Seems that if I put something in a QTabWidget, QToolBox or QStackedWidget it generates no pointer-attribute in widget. but finding is ok, too. - AkaBkn

Phew, that was my fault. Did a clear() on the table which does delete the headers too. - AkaBkn

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.