[PyKDE] PyQt dbus doesn't work with HAL
Kovid Goyal
kovid at theory.caltech.edu
Thu Jan 11 04:28:46 GMT 2007
Hi,
I've been testing dbus.mainloop.qt with HAL. With the glib mainloop my code
receives HAL signals, with the Qt mainloop it does not. THis is with
dbus-pythun-0.80rc3 and the latest PyQt4 snapshot.
Here's the test code
import dbus, sys
import dbus.mainloop.qt
from PyQt4.Qt import QApplication
def handle_signal(*args):
print 'received signal:', args
dbus.mainloop.qt.DBusQtMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_signal, None, None, None)
app = QApplication(sys.argv)
app.exec_()
The output I get is
QSocketNotifier: Can only be used with threads started with QThread
QSocketNotifier: Can only be used with threads started with QThread
received signal: (dbus.String(u':1.32'),)
But plugging in a USB device doesn't generate a signal. The same code with the
glib mainloop does receive a signal.
Kovid.
--
_____________________________________
Kovid Goyal MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125
home : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid at theory.caltech.edu
web : http://www.kovidgoyal.net
_____________________________________
More information about the PyQt
mailing list