4

Looking for a comprehensive listing of the various SIGNALS emitted by the built in QT4 widgets. Have looked around - can't seem to find one. (Using PyQT 4.x and Python 3.2)

TIA

Vector
  • 10,879
  • 12
  • 61
  • 101

2 Answers2

7

The following code lists all signals for all QObject subclasses in QtGui:

from PyQt4 import QtGui, QtCore
import inspect
for name in dir(QtGui):
    obj = getattr(QtGui, name)
    if inspect.isclass(obj) and issubclass(obj, QtCore.QObject):
        for name2 in dir(obj):
            obj2 = getattr(obj, name2)
            if isinstance(obj2, QtCore.pyqtSignal):
                print name, name2
Luke
  • 11,374
  • 2
  • 48
  • 61
  • thanks! I guess you truncated the last line when you copied it - for 3.2 I used: **`if isinstance(obj2, QtCore.pyqtSignal): s=name+": "+name2 print (s)`** – Vector Jul 03 '11 at 22:05
  • works fine - formatted it HTML, now I have my own index. Although just now I did see that the PyQT docs list signals for each widget, after the methods, this is easier. – Vector Jul 04 '11 at 00:25
4

I would think that the Qt documentation has all available signals.

bjoernz
  • 3,852
  • 18
  • 30
  • Thus far I Haven't found the comprehensive list index I'm looking for up there - thus my question. But just now I did find the QSignalSpy and QSignalMapper classes - hopefully I can get them working in PyQT. – Vector Jul 03 '11 at 01:52
  • I guess you would have to write a crawler, if you want all signals on one page. – bjoernz Jul 03 '11 at 10:31