Yes, since QVBoxLayout::addWidget() is not a slot, PythonQt needs a wrapper for it, which is part of the QtGui wrappers. Without correct initialization of QtAll or QtGui, these wrappers are not available.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings,
This is a follow up on my previous post: Compiling with PythonQt_QtAll::init(); in Visual Studio 2010 (64 bit)
Here is my real problem:
CPP:
QVBoxLayout* vbox = new QVBoxLayout;
mainModule.addObject("vbox", vbox);
PY:
vbox.addWidget(btnPlay)
ERROR:
AttributeError: QVBoxLayout has no attribute named 'addWidget'
Is this error has anything to do with the fact that I do not PythonQt_QtAll::init() or because I'm not using the proper syntax?
Thx
Yes, since QVBoxLayout::addWidget() is not a slot, PythonQt needs a wrapper for it, which is part of the QtGui wrappers. Without correct initialization of QtAll or QtGui, these wrappers are not available.
Oh I see, is there a way to initialize only QtCore and QtGui without initializing everything?
I find very odd that PythonQt_QtAll is not part of the PythonQt library, is there any specific reason for that?