Note Corrected Subject (was New vs New ...  sorry)

I have 2 cases where I am having difficulties in PyQwt signals.  Since my 
original post I have investiagted the PyQwt code a bit closer and the 
following comes from that.  The previous discussions helped me in looking 
further into the problem.

1) a c++ typedef variable appears to cause problems

        The old style signal works
        self.picker.connect(picker,SIGNAL('selected(const QwtPolygon &)')
                        ,self.slot)

   however the new style signal does not work.

        self.picker.selected[QwtPolygon].connect(self.slot)

Reported error
        NameError: global name 'QwtPolygon' is not defined

Yet the MetaObject lists the following as a signal signature
        selected(QwtPolygon).

The reasoning appears to be that in the c++ code QwtPolygon is typedef'ed from 
QPolygon. Shouldnt this be handled?

2) Problems with template argument the signal definition. For example

        self.picker.connect(self.picker, 
                SIGNAL('selected(const QwtArray<QwtDoublePoint>&)'), self.slot)

returns an error
        TypeError: C++ type 'QwtArray<QwtDoublePoint>' is not supported as a 
slot 
argument type

The signature is listed in the GmetaObject.

In the sip code QwtArray<QwtDoublePoint> is MappedTyped as 
QwtArrayQwtDoublePoint - using this as the signature as below returns yet 
another error

        self.picker.connect(self.picker, 
                SIGNAL('selected(const QwtArrayQwtDoublePoint&)'), self.slot)
and also as a new signal
        self.picker.selected[QwtArrayQwtDoublePoint].connect(self.slot)

TypeError: connect() failed between selected(QwtArrayQwtDoublePoint) and 
unislot()

Phil Thompson has said that in this case the python code should accept the c++ 
signature but it does not.

Intriquingly the definition of QwtArray is also a c++ typedef in the Qwt code.

The trouble is that for this particlar picker class, the selected signal is 
overloaded multiple times so the signatures are necessary.

Any further help is appreciated.  

John



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to