static PyObject* wrapper_get(pyWrapperObject* self, char* name) {
PyObject* wrapper_get(pyWrapperObject* self, char* name) {
static PyObject* wrapper_get(pyWrapperObject* self, char* name) {	QObject *wrapped = self->wrapped;	// Error checking for deleted objects	if (!wrapped) {		PyErr_Format(PyExc_AttributeError, "Unable to retrieve attribute %s since the wrapped object has already been deleted.", name);		return 0;	}	// Check if the wrapped object has a property with the given name and return it	const QMetaObject *meta = wrapped->metaObject();	int propertyIndex = meta->indexOfProperty(name);		// Found a property, now return it	if (propertyIndex != -1) {		// Get the property information		QMetaProperty property = meta->property(propertyIndex);		// Check if the property is readable		if (property.isReadable()) {			// Don't use QVariant here. The way it handles custom pointers			// sucks.			QString returnType = property.typeName();			if (returnType.startsWith("const ")) {				returnType = returnType.mid(6);			}			void *returnValue;			QMetaType::Type returnValueType = QMetaType::Void;			allocPythonToQt(&returnValue, 0, returnType, 0, &returnValueType); // Create return value				wrapped->qt_metacall(QMetaObject::ReadProperty, propertyIndex, &returnValue);			if (returnType == "PyObject*") {				return (PyObject*)returnValue;			} else {				return toPython(returnValue, returnValueType);			}		}		PyErr_SetString(PyExc_AttributeError, name);		return 0;	}	QVector<uint> methods; // Offsets for suitable methods	// To speed up the search in the method wrapper we collect a list of suitable indices here	for (int i = 0; i < meta->methodOffset() + meta->methodCount(); ++i) {		QMetaMethod method = meta->method(i);		if (method.access() == QMetaMethod::Public && method.methodType() == QMetaMethod::Slot) {			// Check for name( in the signature			if (QString(method.signature()).startsWith(name, Qt::CaseSensitive)) {				// Check if there is a ( at the end of the name				if (method.signature()[strlen(name)] == '(') {					methods.append(i);				}			}		}	}	// If we found suitable method ids, return a wrapper for them	if (!methods.isEmpty()) {		return generateMethodWrapper(wrapped, methods);	}	// Look for Enumerators on the class	for (int i = 0; i < meta->enumeratorOffset() + meta->enumeratorCount(); ++i) {		QMetaEnum enumerator = meta->enumerator(i);		int result = enumerator.keyToValue(name);		if (result != -1) {			return PyInt_FromLong(result);		}	}	PyErr_SetString(PyExc_AttributeError, name);	return 0;}