##// END OF EJS Templates
fixed attr lookup and support for invalid (unregistered) properties...
florianlink -
r27:aac16c8308db
parent child
Show More
@@ -1,549 +1,555
1 1 /*
2 2 *
3 3 * Copyright (C) 2006 MeVis Research GmbH All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Research GmbH, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtInstanceWrapper.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtInstanceWrapper.h"
43 43 #include <QObject>
44 44 #include "PythonQt.h"
45 45 #include "PythonQtSlot.h"
46 46 #include "PythonQtClassInfo.h"
47 47 #include "PythonQtConversion.h"
48 48 #include "PythonQtClassWrapper.h"
49 49
50 50 PythonQtClassInfo* PythonQtInstanceWrapperStruct::classInfo()
51 51 {
52 52 // take the class info from our type object
53 53 return ((PythonQtClassWrapper*)ob_type)->_classInfo;
54 54 }
55 55
56 56 static void PythonQtInstanceWrapper_deleteObject(PythonQtInstanceWrapper* self, bool force = false) {
57 57
58 58 // is this a C++ wrapper?
59 59 if (self->_wrappedPtr) {
60 60 //mlabDebugConst("Python","c++ wrapper removed " << self->_wrappedPtr << " " << self->_obj->className() << " " << self->classInfo()->wrappedClassName().latin1());
61 61
62 62 PythonQt::priv()->removeWrapperPointer(self->_wrappedPtr);
63 63 // we own our qobject, so we delete it now:
64 64 delete self->_obj;
65 65 self->_obj = NULL;
66 66 if (force || self->classInfo()->hasOwnerMethodButNoOwner(self->_wrappedPtr) || self->_ownedByPythonQt) {
67 67 int type = self->classInfo()->metaTypeId();
68 68 if (self->_useQMetaTypeDestroy && type>=0) {
69 69 // use QMetaType to destroy the object
70 70 QMetaType::destroy(type, self->_wrappedPtr);
71 71 } else {
72 72 PythonQtSlotInfo* slot = self->classInfo()->destructor();
73 73 if (slot) {
74 74 void* args[2];
75 75 args[0] = NULL;
76 76 args[1] = &self->_wrappedPtr;
77 77 slot->decorator()->qt_metacall(QMetaObject::InvokeMetaMethod, slot->slotIndex(), args);
78 78 self->_wrappedPtr = NULL;
79 79 } else {
80 80 if (type>=0) {
81 81 // use QMetaType to destroy the object
82 82 QMetaType::destroy(type, self->_wrappedPtr);
83 83 } else {
84 84 // TODO: warn about not being able to destroy the object?
85 85 }
86 86 }
87 87 }
88 88 }
89 89 } else {
90 90 //mlabDebugConst("Python","qobject wrapper removed " << self->_obj->className() << " " << self->classInfo()->wrappedClassName().latin1());
91 91 if (self->_objPointerCopy) {
92 92 PythonQt::priv()->removeWrapperPointer(self->_objPointerCopy);
93 93 }
94 94 if (self->_obj) {
95 95 if (force || self->_ownedByPythonQt) {
96 96 if (force || !self->_obj->parent()) {
97 97 delete self->_obj;
98 98 }
99 99 } else {
100 100 if (self->_obj->parent()==NULL) {
101 101 // tell someone who is interested that the qobject is no longer wrapped, if it has no parent
102 102 PythonQt::qObjectNoLongerWrappedCB(self->_obj);
103 103 }
104 104 }
105 105 }
106 106 }
107 107 self->_obj = NULL;
108 108 }
109 109
110 110 static void PythonQtInstanceWrapper_dealloc(PythonQtInstanceWrapper* self)
111 111 {
112 112 PythonQtInstanceWrapper_deleteObject(self);
113 113 self->_obj.~QPointer<QObject>();
114 114 self->ob_type->tp_free((PyObject*)self);
115 115 }
116 116
117 117 static PyObject* PythonQtInstanceWrapper_new(PyTypeObject *type, PyObject * args, PyObject * /*kwds*/)
118 118 {
119 119 //PythonQtClassWrapper *classType = (PythonQtClassWrapper*)type;
120 120 PythonQtInstanceWrapper *self;
121 121 static PyObject* emptyTuple = NULL;
122 122 if (emptyTuple==NULL) {
123 123 emptyTuple = PyTuple_New(0);
124 124 }
125 125
126 126 self = (PythonQtInstanceWrapper*)PyBaseObject_Type.tp_new(type, emptyTuple, NULL);
127 127
128 128 if (self != NULL) {
129 129 new (&self->_obj) QPointer<QObject>();
130 130 self->_wrappedPtr = NULL;
131 131 self->_ownedByPythonQt = false;
132 132 self->_useQMetaTypeDestroy = false;
133 133 self->_isShellInstance = false;
134 134 }
135 135 return (PyObject *)self;
136 136 }
137 137
138 138 int PythonQtInstanceWrapper_init(PythonQtInstanceWrapper * self, PyObject * args, PyObject * kwds)
139 139 {
140 140 if (args == PythonQtPrivate::dummyTuple()) {
141 141 // we are called from the internal PythonQt API, so our data will be filled later on...
142 142 return 0;
143 143 }
144 144
145 145 // we are called from python, try to construct our object
146 146 if (self->classInfo()->constructors()) {
147 147 void* directCPPPointer = NULL;
148 148 PythonQtSlotFunction_CallImpl(NULL, self->classInfo()->constructors(), args, kwds, NULL, &directCPPPointer);
149 149 if (PyErr_Occurred()) {
150 150 return -1;
151 151 }
152 152 if (directCPPPointer) {
153 153 // change ownershipflag to be owned by PythonQt
154 154 self->_ownedByPythonQt = true;
155 155 self->_useQMetaTypeDestroy = false;
156 156 if (self->classInfo()->isCPPWrapper()) {
157 157 self->_wrappedPtr = directCPPPointer;
158 158 // TODO xxx: if there is a wrapper factory, we might want to generate a wrapper for our class?!
159 159 } else {
160 160 self->setQObject((QObject*)directCPPPointer);
161 161 }
162 162 // register with PythonQt
163 163 PythonQt::priv()->addWrapperPointer(directCPPPointer, self);
164 164
165 165 PythonQtShellSetInstanceWrapperCB* cb = self->classInfo()->shellSetInstanceWrapperCB();
166 166 if (cb) {
167 167 // if we are a derived python class, we set the wrapper
168 168 // to activate the shell class, otherwise we just ignore that it is a shell...
169 169 // we detect it be checking if the type does not have PythonQtInstanceWrapper_Type as direct base class,
170 170 // which is the case for all non-python derived types
171 171 if (((PyObject*)self)->ob_type->tp_base != &PythonQtInstanceWrapper_Type) {
172 172 // set the wrapper and remember that we have a shell instance!
173 173 (*cb)(directCPPPointer, self);
174 174 self->_isShellInstance = true;
175 175 }
176 176 }
177 177 }
178 178 } else {
179 179 QString error = QString("No constructors available for ") + self->classInfo()->className();
180 180 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
181 181 return -1;
182 182 }
183 183 return 0;
184 184 }
185 185
186 186 static PyObject *PythonQtInstanceWrapper_classname(PythonQtInstanceWrapper* type)
187 187 {
188 188 return PyString_FromString(type->classInfo()->className());
189 189 }
190 190
191 191 static PyObject *PythonQtInstanceWrapper_help(PythonQtInstanceWrapper* type)
192 192 {
193 193 return PythonQt::self()->helpCalled(type->classInfo());
194 194 }
195 195
196 196 static PyObject *PythonQtInstanceWrapper_delete(PythonQtInstanceWrapper * self)
197 197 {
198 198 PythonQtInstanceWrapper_deleteObject(self, true);
199 199 Py_INCREF(Py_None);
200 200 return Py_None;
201 201 }
202 202
203 203
204 204 static PyMethodDef PythonQtInstanceWrapper_methods[] = {
205 205 {"className", (PyCFunction)PythonQtInstanceWrapper_classname, METH_NOARGS,
206 206 "Return the classname of the object"
207 207 },
208 208 {"help", (PyCFunction)PythonQtInstanceWrapper_help, METH_NOARGS,
209 209 "Shows the help of available methods for this class"
210 210 },
211 211 {"delete", (PyCFunction)PythonQtInstanceWrapper_delete, METH_NOARGS,
212 212 "Deletes the C++ object (at your own risk, my friend!)"
213 213 },
214 214 {NULL, NULL, 0, NULL} /* Sentinel */
215 215 };
216 216
217 217
218 218 static PyObject *PythonQtInstanceWrapper_getattro(PyObject *obj,PyObject *name)
219 219 {
220 220 const char *attributeName;
221 221 PythonQtInstanceWrapper *wrapper = (PythonQtInstanceWrapper *)obj;
222 222
223 223 if ((attributeName = PyString_AsString(name)) == NULL) {
224 224 return NULL;
225 225 }
226 226
227 227 if (qstrcmp(attributeName, "__dict__")==0) {
228 228 QStringList l = wrapper->classInfo()->memberList(false);
229 229 PyObject* dict = PyDict_New();
230 230 foreach (QString name, l) {
231 231 PyObject* o = PyObject_GetAttrString(obj, name.toLatin1().data());
232 232 PyDict_SetItemString(dict, name.toLatin1().data(), o);
233 233 Py_DECREF(o);
234 234 }
235 235 // Note: we do not put children into the dict, is would look confusing?!
236 236 return dict;
237 237 }
238 238
239 239 // first look in super, to return derived methods from base object first
240 240 PyObject* superAttr = PyBaseObject_Type.tp_getattro(obj, name);
241 241 if (superAttr) {
242 242 return superAttr;
243 243 }
244 PyErr_Clear();
244 245
245 246 if (!wrapper->_obj && !wrapper->_wrappedPtr) {
246 247 QString error = QString("Trying to read attribute '") + attributeName + "' from a destroyed " + wrapper->classInfo()->className() + " object";
247 248 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
248 249 return NULL;
249 250 }
250 251
251 252 // mlabDebugConst("Python","get " << attributeName);
252 253
253 254 // TODO: dynamic properties are missing
254 255
255 256 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
256 257 switch (member._type) {
257 258 case PythonQtMemberInfo::Property:
258 259 if (wrapper->_obj) {
260 if (member._property.userType() != QVariant::Invalid) {
259 261 return PythonQtConv::QVariantToPyObject(member._property.read(wrapper->_obj));
262 } else {
263 Py_INCREF(Py_None);
264 return Py_None;
265 }
260 266 }
261 267 break;
262 268 case PythonQtMemberInfo::Slot:
263 269 return PythonQtSlotFunction_New(member._slot, obj, NULL);
264 270 break;
265 271 case PythonQtMemberInfo::EnumValue:
266 272 return PyInt_FromLong(member._enumValue);
267 273 break;
268 274 default:
269 275 // is an invalid type, go on
270 276 break;
271 277 }
272 278
273 279 // look for the interal methods (className(), help())
274 280 PyObject* internalMethod = Py_FindMethod( PythonQtInstanceWrapper_methods, obj, (char*)attributeName);
275 281 if (internalMethod) {
276 282 return internalMethod;
277 283 }
278 284 PyErr_Clear();
279 285
280 286 if (wrapper->_obj) {
281 287 // look for a child
282 288 QObjectList children = wrapper->_obj->children();
283 289 for (int i = 0; i < children.count(); i++) {
284 290 QObject *child = children.at(i);
285 291 if (child->objectName() == attributeName) {
286 292 return PythonQt::self()->priv()->wrapQObject(child);
287 293 }
288 294 }
289 295 }
290 296
291 297 QString error = QString(wrapper->classInfo()->className()) + " has no attribute named '" + QString(attributeName) + "'";
292 298 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
293 299 return NULL;
294 300 }
295 301
296 302 static int PythonQtInstanceWrapper_setattro(PyObject *obj,PyObject *name,PyObject *value)
297 303 {
298 304 QString error;
299 305 char *attributeName;
300 306 PythonQtInstanceWrapper *wrapper = (PythonQtInstanceWrapper *)obj;
301 307
302 308 if ((attributeName = PyString_AsString(name)) == NULL)
303 309 return -1;
304 310
305 311 if (!wrapper->_obj) {
306 312 error = QString("Trying to set attribute '") + attributeName + "' on a destroyed " + wrapper->classInfo()->className() + " object";
307 313 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
308 314 return -1;
309 315 }
310 316
311 317 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
312 318 if (member._type == PythonQtMemberInfo::Property) {
313 319 QMetaProperty prop = member._property;
314 320 if (prop.isWritable()) {
315 321 QVariant v;
316 322 if (prop.isEnumType()) {
317 323 // this will give us either a string or an int, everything else will probably be an error
318 324 v = PythonQtConv::PyObjToQVariant(value);
319 325 } else {
320 326 int t = prop.userType();
321 327 v = PythonQtConv::PyObjToQVariant(value, t);
322 328 }
323 329 bool success = false;
324 330 if (v.isValid()) {
325 331 success = prop.write(wrapper->_obj, v);
326 332 }
327 333 if (success) {
328 334 return 0;
329 335 } else {
330 336 error = QString("Property '") + attributeName + "' of type '" +
331 337 prop.typeName() + "' does not accept an object of type "
332 338 + QString(value->ob_type->tp_name) + " (" + PythonQtConv::PyObjGetRepresentation(value) + ")";
333 339 }
334 340 } else {
335 341 error = QString("Property '") + attributeName + "' of " + wrapper->classInfo()->className() + " object is not writable";
336 342 }
337 343 } else {
338 344 if (member._type == PythonQtMemberInfo::Slot) {
339 345 error = QString("Slot '") + attributeName + "' can not be overwritten on " + wrapper->classInfo()->className() + " object";
340 346 } else if (member._type == PythonQtMemberInfo::EnumValue) {
341 347 error = QString("EnumValue '") + attributeName + "' can not be overwritten on " + wrapper->classInfo()->className() + " object";
342 348 }
343 349 }
344 350
345 351 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
346 352 return -1;
347 353 }
348 354
349 355 static PyObject * PythonQtInstanceWrapper_str(PyObject * obj)
350 356 {
351 357 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)obj;
352 358 const char* typeName = obj->ob_type->tp_name;
353 359 QObject *qobj = wrapper->_obj;
354 360 if (wrapper->_wrappedPtr) {
355 361 QString str = PythonQtConv::CPPObjectToString(wrapper->classInfo()->metaTypeId(), wrapper->_wrappedPtr);
356 362 if (!str.isEmpty()) {
357 363 return PyString_FromFormat("%s", str.toLatin1().constData());
358 364 } else
359 365 if (wrapper->_obj) {
360 366 return PyString_FromFormat("%s (C++ Object %p wrapped by %s %p))", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
361 367 } else {
362 368 return PyString_FromFormat("%s (C++ Object %p)", typeName, wrapper->_wrappedPtr);
363 369 }
364 370 } else {
365 371 return PyString_FromFormat("%s (QObject %p)", typeName, qobj);
366 372 }
367 373 }
368 374
369 375 static PyObject * PythonQtInstanceWrapper_repr(PyObject * obj)
370 376 {
371 377 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)obj;
372 378 const char* typeName = obj->ob_type->tp_name;
373 379
374 380 QObject *qobj = wrapper->_obj;
375 381 if (wrapper->_wrappedPtr) {
376 382 QString str = PythonQtConv::CPPObjectToString(wrapper->classInfo()->metaTypeId(), wrapper->_wrappedPtr);
377 383 if (!str.isEmpty()) {
378 384 return PyString_FromFormat("%s(%s, %p)", typeName, str.toLatin1().constData(), wrapper->_wrappedPtr);
379 385 } else
380 386 if (wrapper->_obj) {
381 387 return PyString_FromFormat("%s (C++ Object %p wrapped by %s %p))", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
382 388 } else {
383 389 return PyString_FromFormat("%s (C++ Object %p)", typeName, wrapper->_wrappedPtr);
384 390 }
385 391 } else {
386 392 return PyString_FromFormat("%s (QObject %p)", wrapper->classInfo()->className(), qobj);
387 393 }
388 394 }
389 395
390 396 static int PythonQtInstanceWrapper_compare(PyObject * obj1, PyObject * obj2)
391 397 {
392 398 if (PyObject_TypeCheck(obj1, &PythonQtInstanceWrapper_Type) &&
393 399 PyObject_TypeCheck(obj2, &PythonQtInstanceWrapper_Type)) {
394 400
395 401 PythonQtInstanceWrapper* w1 = (PythonQtInstanceWrapper*)obj1;
396 402 PythonQtInstanceWrapper* w2 = (PythonQtInstanceWrapper*)obj2;
397 403 // check pointers directly first:
398 404 if (w1->_wrappedPtr != NULL) {
399 405 if (w1->_wrappedPtr == w2->_wrappedPtr) {
400 406 return 0;
401 407 }
402 408 } else if (w1->_obj == w2->_obj) {
403 409 return 0;
404 410 }
405 411 const char* class1 = w1->classInfo()->className();
406 412 const char* class2 = w2->classInfo()->className();
407 413 if (strcmp(class1, class2) == 0) {
408 414 // same class names, so we can try the operator_equal
409 415 PythonQtMemberInfo info = w1->classInfo()->member("operator_equal");
410 416 if (info._type == PythonQtMemberInfo::Slot) {
411 417 bool result = false;
412 418 void* obj1 = w1->_wrappedPtr;
413 419 if (!obj1) {
414 420 obj1 = w1->_obj;
415 421 }
416 422 if (!obj1) { return -1; }
417 423 void* obj2 = w2->_wrappedPtr;
418 424 if (!obj2) {
419 425 obj2 = w2->_obj;
420 426 }
421 427 if (!obj2) { return -1; }
422 428 if (info._slot->isInstanceDecorator()) {
423 429 // call on decorator QObject
424 430 void* args[3];
425 431 args[0] = &result;
426 432 args[1] = &obj1; // this is a pointer, so it needs a pointer to a pointer
427 433 args[2] = obj2; // this is a reference, so it needs the direct pointer
428 434 info._slot->decorator()->qt_metacall(QMetaObject::InvokeMetaMethod, info._slot->slotIndex(), args);
429 435 return result?0:-1;
430 436 } else {
431 437 // call directly on QObject
432 438 if (w1->_obj && w2->_obj) {
433 439 void* args[2];
434 440 args[0] = &result;
435 441 args[2] = obj2; // this is a reference, so it needs the direct pointer
436 442 w1->_obj->qt_metacall(QMetaObject::InvokeMetaMethod, info._slot->slotIndex(), args);
437 443 }
438 444 }
439 445 }
440 446 }
441 447 }
442 448 return -1;
443 449 }
444 450
445 451 static int PythonQtInstanceWrapper_nonzero(PyObject *obj)
446 452 {
447 453 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)obj;
448 454 return (wrapper->_wrappedPtr == NULL && wrapper->_obj == NULL)?0:1;
449 455 }
450 456
451 457
452 458 static long PythonQtInstanceWrapper_hash(PythonQtInstanceWrapper *obj)
453 459 {
454 460 if (obj->_wrappedPtr != NULL) {
455 461 return reinterpret_cast<long>(obj->_wrappedPtr);
456 462 } else {
457 463 QObject* qobj = obj->_obj; // get pointer from QPointer wrapper
458 464 return reinterpret_cast<long>(qobj);
459 465 }
460 466 }
461 467
462 468
463 469
464 470 // we override nb_nonzero, so that one can do 'if' expressions to test for a NULL ptr
465 471 static PyNumberMethods PythonQtInstanceWrapper_as_number = {
466 472 0, /* nb_add */
467 473 0, /* nb_subtract */
468 474 0, /* nb_multiply */
469 475 0, /* nb_divide */
470 476 0, /* nb_remainder */
471 477 0, /* nb_divmod */
472 478 0, /* nb_power */
473 479 0, /* nb_negative */
474 480 0, /* nb_positive */
475 481 0, /* nb_absolute */
476 482 PythonQtInstanceWrapper_nonzero, /* nb_nonzero */
477 483 0, /* nb_invert */
478 484 0, /* nb_lshift */
479 485 0, /* nb_rshift */
480 486 0, /* nb_and */
481 487 0, /* nb_xor */
482 488 0, /* nb_or */
483 489 0, /* nb_coerce */
484 490 0, /* nb_int */
485 491 0, /* nb_long */
486 492 0, /* nb_float */
487 493 0, /* nb_oct */
488 494 0, /* nb_hex */
489 495 0, /* nb_inplace_add */
490 496 0, /* nb_inplace_subtract */
491 497 0, /* nb_inplace_multiply */
492 498 0, /* nb_inplace_divide */
493 499 0, /* nb_inplace_remainder */
494 500 0, /* nb_inplace_power */
495 501 0, /* nb_inplace_lshift */
496 502 0, /* nb_inplace_rshift */
497 503 0, /* nb_inplace_and */
498 504 0, /* nb_inplace_xor */
499 505 0, /* nb_inplace_or */
500 506 0, /* nb_floor_divide */
501 507 0, /* nb_true_divide */
502 508 0, /* nb_inplace_floor_divide */
503 509 0, /* nb_inplace_true_divide */
504 510 };
505 511
506 512 PyTypeObject PythonQtInstanceWrapper_Type = {
507 513 PyObject_HEAD_INIT(&PythonQtClassWrapper_Type)
508 514 0, /*ob_size*/
509 515 "PythonQt.PythonQtInstanceWrapper", /*tp_name*/
510 516 sizeof(PythonQtInstanceWrapper), /*tp_basicsize*/
511 517 0, /*tp_itemsize*/
512 518 (destructor)PythonQtInstanceWrapper_dealloc, /*tp_dealloc*/
513 519 0, /*tp_print*/
514 520 0, /*tp_getattr*/
515 521 0, /*tp_setattr*/
516 522 PythonQtInstanceWrapper_compare, /*tp_compare*/
517 523 PythonQtInstanceWrapper_repr, /*tp_repr*/
518 524 &PythonQtInstanceWrapper_as_number, /*tp_as_number*/
519 525 0, /*tp_as_sequence*/
520 526 0, /*tp_as_mapping*/
521 527 (hashfunc)PythonQtInstanceWrapper_hash, /*tp_hash */
522 528 0, /*tp_call*/
523 529 PythonQtInstanceWrapper_str, /*tp_str*/
524 530 PythonQtInstanceWrapper_getattro, /*tp_getattro*/
525 531 PythonQtInstanceWrapper_setattro, /*tp_setattro*/
526 532 0, /*tp_as_buffer*/
527 533 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
528 534 "PythonQtInstanceWrapper object", /* tp_doc */
529 535 0, /* tp_traverse */
530 536 0, /* tp_clear */
531 537 0, /* tp_richcompare */
532 538 0, /* tp_weaklistoffset */
533 539 0, /* tp_iter */
534 540 0, /* tp_iternext */
535 541 0, /* tp_methods */
536 542 0, /* tp_members */
537 543 0, /* tp_getset */
538 544 0, /* tp_base */
539 545 0, /* tp_dict */
540 546 0, /* tp_descr_get */
541 547 0, /* tp_descr_set */
542 548 0, /* tp_dictoffset */
543 549 (initproc)PythonQtInstanceWrapper_init, /* tp_init */
544 550 0, /* tp_alloc */
545 551 PythonQtInstanceWrapper_new, /* tp_new */
546 552 };
547 553
548 554 //-------------------------------------------------------
549 555
General Comments 0
You need to be logged in to leave comments. Login now