[PyKDE] Filling QPixmap from C code

Giaco777 giaco777 at gmx.de
Wed Apr 16 09:25:01 BST 2003


Hi PyQters,

first of all I would like to thank Phil for this great RAD environment
for QT. 

In my application I would like a QPixmap generated by PYQt
to be filled by a C subroutine. My first try would look like this (in principal):

Python:

qp=QPixmap(...)
fillQPixmap(qp)     # this is realized in C

C:

// this is the C subroutine which fills QPixmap
static PyObject *fillQPixmap(PyObject *self, PyObject *args) {
    PyObject * po;
    if(!PyArg_ParseTuple(args, "O", &po)) return NULL;

    // interpret object as QPixmap pointer
   QPixmap *pm = (QPixmap*) PyCObject_AsVoidPtr(po); 

   // do something with pm

   Py_INCREF(Py_None);
   return Py_None; 
}


Is there a chance that this will work or is there a better solution?

Thanks
Joachim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030416/6b2b58d4/attachment.html


More information about the PyQt mailing list