[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Solid in Python
From:       Thomas Olsen <tanghus () gmail ! com>
Date:       2010-06-15 11:43:30
Message-ID: 201006151343.31369.tanghus () gmail ! com
[Download RAW message or body]

On Tuesday 15 June 2010 13:32:49 Stefan Majewsky wrote:
> On Tuesday 15 June 2010 13:24:38 Thomas Olsen wrote:
> > QObject.connect(Solid.Networking.Notifier, SIGNAL("statusChanged()"),
> > self.netstate_changed)
> > 
> > Which gives me these errors:
> >     QObject.connect(Solid.Networking.Notifier, SIGNAL("statusChanged()"),
> > 
> > self.netstate_changed)
> > 
> > TypeError: arguments did not match any overloaded call:
> >   QObject.connect(QObject, SIGNAL(), QObject, SLOT(),
> > 
> > Qt.ConnectionType=Qt.AutoConnection): argument 1 has unexpected type
> > 'PyQt4.QtCore.pyqtWrapperType'
> 
> I have no experience with PyKDE at all, but the message looks to me like
> "Solid.Networking.Notifier" is a type, i.e. you need to do something like
> 
> instance = Solid.Networking.Notifier()
> QObject.connect(instance, ...)
> 
> Greetings
> Stefan

Just tried it:

TypeError: PyKDE4.solid.Notifier cannot be instantiated or sub-classed

But I also just tried "new-style" signal/slots:

Solid.Networking.Notifier.statusChanged.connect(self.netstate_changed)

Which gave:

Traceback (most recent call last):
  File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", 
line 75, in init
    self.pyapplet.init()
  File "/home/tol/google-translator/google-translator/contents/code/main.py", 
line 55, in init
    self.setup_network()
  File "/home/tol/google-translator/google-translator/contents/code/main.py", 
line 301, in setup_network
    Solid.Networking.Notifier.statusChanged.connect(self.netstate_changed)
AttributeError: 'builtin_function_or_method' object has no attribute 'connect'

Which could indicate that statusChanged hasn't been implemented as a signal in 
PyKDE? Or am I totally on the wrong track here?


-- 
Best Regards / Med venlig hilsen

Thomas Olsen
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic