Initia QtCore port to python3.

This commit is contained in:
Renato Filho 2011-10-03 18:49:42 -03:00 committed by Hugo Parente Lima
commit 1e29ab6592
52 changed files with 380 additions and 286 deletions

View file

@ -83,7 +83,9 @@ DynamicSlotDataV2::DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* paren
//Can not store calback pointe because this will be destroyed at the end of the scope
//To avoid increment intance reference keep the callback information
m_callback = PyMethod_GET_FUNCTION(callback);
#ifndef IS_PY3K
m_pyClass = PyMethod_GET_CLASS(callback);
#endif
m_pythonSelf = PyMethod_GET_SELF(callback);
//monitor class from method lifetime
@ -121,7 +123,11 @@ PyObject* DynamicSlotDataV2::callback()
//create a callback based on method data
if (m_isMethod)
#ifdef IS_PY3K
callback = PyMethod_New(m_callback, m_pythonSelf);
#else
callback = PyMethod_New(m_callback, m_pythonSelf, m_pyClass);
#endif
else
Py_INCREF(callback);