[PyQt] disconnectNotify never called

Laurent Hamery laurent-h at moving-picture.com
Sat Jan 12 12:03:40 GMT 2008


Hi guys,
It seems - for me - as a bug but the virtual method disconnectNotify()
is never called. And perhaps the connectNotify is called in place of it. 
So .. did I miss something ?
Im using PyQt 4.2 and python2.4.3 but I cant test with the latest version.

Cheers
Laurent




#!/usr/bin/env python2.4.3

# Author : Laurent Hamery 2007 @ laurent-h

import sys

from PyQt4.QtGui  import *
from PyQt4.QtCore import *

def connectionTest():
	pass

##########################################################################################
# Disconnection test class
##########################################################################################

class DisconnectTest(QPushButton):
	def __init__(self, parent=None):
		QPushButton.__init__(self, parent)
	
		if self.connect(self, SIGNAL('clicked'), connectionTest):
			print 'connection ok'
		if self.disconnect(self, SIGNAL('clicked'), connectionTest):
			print 'disconnection ok'
		
	def connectNotify(self, signal):
		print 'connectNotify'
		
	def disconnectNotify(self, signal):
		print 'disconnectNotify'
		
if __name__ == '__main__':
	app = QApplication(sys.argv)
	test = DisconnectTest()
	test.show()
	app.exec_()
	del test


More information about the PyQt mailing list