[PyKDE] How to test if two PyQt instances wrap the same C++ object?

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Wed Oct 22 10:19:01 BST 2003


I have difficulty to translate this C++ idiom in Python:

bool Plot::eventFilter(QObject *object, QEvent *e)
    if ( e->type() == QEvent::Resize )
        const QSize &size = ((QResizeEvent *)e)->size();
        if ( object == (QObject *)axis(yLeft) )  // HOW TO THIS IN PYTHON?
	// ...

    return QwtPlot::eventFilter(object, e);

Of course I could write for PyQwt a function:

qwt.compareCPlusPlusPointers(SuperObject, DerivedObject)

but if it is really needed, it belongs in PyQt.


More information about the PyQt mailing list