tags:

views:

88

answers:

1

I'd like to exchange a widget inside a QHBoxLayout. This code seems to work, but as soon as I do the actual app._exec(), the code crashes with terminate called after throwing an instance of 'boost::python::error_already_set'. Is there any way to get the actual error message? (or to resolve this problem)

gaParent = gameArea.parent().layout()
gaParent.removeWidget(gameArea)
gameArea = DrawingScreen()
gameArea.setObjectName("gameArea")
gaParent.insertWidget(0, gameArea)
A: 

I'm a C++ guy and not so much of a Pythonist, so excuse me if this makes no sense. However, from my perspective, it looks as if gameArea.parent().layout() returns a QLayout. That object does not have the insertWidget method.

Apart from that, I'm not sure where the boost::python::error_alread_set comes from. Can you do some intelligent printf-ing to try to determine when that boost error enters the picture?

e8johan
Yes - it's a QLayout, but a QHBoxLayout exactly (no casting needed here). Unfortunately I don't think I have access to anything else - there's no error before `app._exec()` and then something fails internally, so I can't catch it in any way - the whole app just exits.
viraptor
what to do you use more than Qt? To my knowledge, Qt is not based on boost... (asks the non-pythonist)
e8johan
e8johan: pyside interface to qt4 is generated using boost
viraptor