On Thursday 26 February 2004 09:52, Jacob Abraham wrote: > Dear Tutors, > I would like to use this funtion in pyqt and came > across the following problems. > void QTable::removeRows ( const QMemArray<int> & rows > ) > > 1. > from qt import QMemArray > ImportError: cannot import name QMemArray > 2. > mylist=[5] > self.mytable.removeRows(mylist) > > QGArray::at: Absolute index 0 out of range > Segmentation fault > > """ > #http://www.riverbankcomputing.co.uk/pyqt/docs/PyQt.html#AEN668 > QMemArray<type> (Qt v3+) > > Types based on the QMemArray template are > automatically converted to and from Python lists of > the type. > """ > How do I pass the QMemArray Object to the > removeRows funtion?
Looks like a bug. Can you apply the attached patch and re-build PyQt. Phil
--- qmemarray.sip.orig 2004-02-26 18:41:20.000000000 +0000 +++ qmemarray.sip 2004-02-26 18:42:49.000000000 +0000 @@ -60,7 +60,7 @@ return 0; } - QMemArray<int> *qma = new QMemArray<int>; + QMemArray<int> *qma = new QMemArray<int>(PyList_GET_SIZE(sipPy)); PyErr_Clear();
