[PyQt] Problems connecting to a KIO-Slave
Magnus Kulke
magnus.kulke at radicalapproach.de
Thu Dec 11 17:54:25 GMT 2008
Hello,
i am currently playing around with pyKDE and stumbled at the very
beginning. I can't seem to connect my slots to signals emited by a
KIO-slave. The KIO-job is executed, but the slotResult method is never
called. I tried connecting a click-signal from a pushbutton to my slot
and this has worked well. i am quite puzzled here, maybe some can give
me a hint what might be wrong.
thanks in advance,
magnus
i am using:
python-qt4 4.4.3-1ubuntu1
python-kde4 4:4.1.3-0ubuntu1~intrepid1
the code:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs, KUrl
from PyKDE4.kdeui import KApplication, KMainWindow
from PyKDE4.kio import *
from ui_kasablancamainwindow import Ui_KasablancaMainWindow
class KasablancaMainWindow (KMainWindow, Ui_KasablancaMainWindow):
listjob = None
def __init__ (self):
KMainWindow.__init__ (self)
self.setupUi(self)
copyjob = KIO.copy (KUrl("/home/mkulke/xarchiver.png"),
KUrl("/home/mkulke/xarchiver.png.2"))
self.connect (copyjob, SIGNAL ("result (KIO::Job *)"), self.slotResult)
def slotResult(self, job):
print "result"
if __name__ == '__main__':
appName = "kasablanca"
catalog = ""
programName = ki18n ("kasablanca")
version = "0.5"
description = ki18n ("kasablanca ftp client")
license = KAboutData.License_GPL
copyright = ki18n ("(c) 2008 Magnus Kulke")
text = ki18n ("none")
homePage = "kasablanca.berlios.de"
bugEmail = "mkulke at bla.com"
aboutData = KAboutData (appName, catalog, programName, version,
description, license, copyright, text, homePage, bugEmail)
KCmdLineArgs.init (sys.argv, aboutData)
app = KApplication ()
mainWindow = KasablancaMainWindow ()
mainWindow.show()
app.exec_ ()
More information about the PyQt
mailing list