[PyQt] Resizing QLabel
fapinkse at gmail.com
Fri Aug 19 16:41:35 BST 2011
In Order to resize my images and keeping their aspect I did subclass
Qlabel Like this as found suggested elsewhere on the net:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
def __init__(self, parent=None):
def resizeEvent(self, event):
if self.orgPixmap != None:
pixmap = self.orgPixmap
size = event.size()
It does what I want.. scaling my image when the label is resized all the
way up to screen size and down to the appliztion minimal window size.
Now when I do a Maximize on my application window and back the resizing
acts differently. I can see that the resizeEvent has been called
It does a few steps and stops when I release the mouse button I can do
this afain abd again only a few steps at the time.
What is happenign here?
I am Using windows XP, Python 3, PyQt4
More information about the PyQt