[PyQt] Reassigning resizeEvent -- changes in 4.6

David Boddie dboddie at trolltech.com
Mon Oct 12 16:06:05 BST 2009


On Mon Oct 12 11:17:30 BST 2009, Roshan Mathews 

> In the attached code, I reassign setText and resizeEvent for a
> label object.
>
> The method for setText is called, but the one for resizeEvent isn't.
>
> This behavior is changed from PyQt-4.5.4, is it a bug, or is it
> the expected behavior from now on?

Actually, you implement resizeLabel(), not resizeEvent(), in your code:

    def setText(self, text):
        super(BroadLabel, self.label).setText('!!!! %s !!!!' % text)

    def resizeLabel(self, event):
        print 'Resizing label'

Is that intentional?

David


More information about the PyQt mailing list