PyObject *%out = Shiboken::Buffer::newObject(%in, size); Py_ssize_t bufferLen; char *%out = reinterpret_cast<char*>(Shiboken::Buffer::getPointer(%PYARG_1, &bufferLen)); uint %out = bufferLen; This method must be used with an QPixmap object, not the class: :: # Wrong pixmap = QPixmap.loadFromData(...) # Right pixmap = QPixmap().loadFromData(...) const uchar *%out = reinterpret_cast<const uchar*>(PyBytes_AS_STRING(%PYARG_1)); uint %out = static_cast<uint>(PyBytes_Size(%PYARG_1)); _______ end of matrix block _______ -->