Re: [PyQt] SIP_ANYSLOT vs SIP_SLOT vs SIP_SLOT_CON()

2013-09-13 Thread Sébastien Sablé
2013/9/10 Phil Thompson p...@riverbankcomputing.com


 That doesn't sound like a great design...

I agree but it is not my call. It may change when the code gets migrated to Qt5.

 SIP_SLOT just checks that the argument has been created by QtCore.SLOT(),
 ie. that it is a string that begins with the magic character. Plenty of
 examples in PyQt4.

Thanks for the explanations.
So I decided to start simple and go for SIP_SLOT for the moment. The
sip code I have looks like the following:

namespace Foo
{
namespace Bar
{
class PointsCloud
{
...
void connect(const int eventType, QObject *, SIP_SLOT member);
%MethodCode
sipCpp-connect(a0, a1, a2);
%End
...
}
}
}

The Python code looks like this:

class Starfield(QObject):
def run(self):
 self.cloud = Foo.Bar.PointsCloud()

self.cloud.connect(Foo.Bar.DomainOjbect.DomainObjectErased, self,
QtCore.SLOT('onCloudErased(Foo::Bar::DomainObjectErasedArgs)'))
 self.cloud.erase()

@pyqtSlot('Foo::Bar::DomainObjectErasedArgs')
def onCloudErased(self, args):
print called


In the end it works but I can't pass Python callables directly.
To have that, I would need to know the signature for the signal to
pass it to sipConnectRx, but I cannot get that.

Best regards

Sebastien
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Coinstalling PyQt5 for Python 2 and Python 3

2013-09-13 Thread Luca Beltrame
Hello,

While packaging PyQt5 for openSUSE I noticed that there are two plugins that 
are compiled which may conflict on a system that wants PyQt5 both for Python 2 
and Python 3.

I'm talking about the Designer plugin and the QML plugin, in particular. Are 
they Python version independent (I'm inclined on no)? What can be done to 
ensure proper coinstallation of PyQt with both Py2 and Py3?

Thanks.

-- 
Luca Beltrame - KDE Forums team
KDE Science supporter
GPG key ID: 6E1A4E79


signature.asc
Description: This is a digitally signed message part.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Coinstalling PyQt5 for Python 2 and Python 3

2013-09-13 Thread Phil Thompson
On Fri, 13 Sep 2013 21:01:02 +0200, Luca Beltrame lbeltr...@kde.org
wrote:
 Hello,
 
 While packaging PyQt5 for openSUSE I noticed that there are two plugins
 that 
 are compiled which may conflict on a system that wants PyQt5 both for
 Python 2 
 and Python 3.
 
 I'm talking about the Designer plugin and the QML plugin, in particular.
 Are 
 they Python version independent (I'm inclined on no)? What can be done
 to 
 ensure proper coinstallation of PyQt with both Py2 and Py3?

Do the same as what you do with PyQt4 - whatever that is.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt