Example #1
0
 def reconfig(self, width, height):
     if width > 0 and width < 2**16:
         self.vwidth = width
     if height > 0 and height < 2**16:
         self.vheight = height
     if self.vwidth and self.vheight:
         self.childwidget.img_width = self.vwidth
         self.childwidget.img_height = self.vheight
         if (not self.sized_once) and width:
             self.childwidget.setMinimumSize(
                 Q.QSize(self.vwidth, self.vheight))
             self.adjustSize()
             self.adjustSize()
             parent = self.parent()
             if parent:
                 parent.adjustSize()
                 parent = parent.parent()
                 if parent:
                     parent.adjustSize()
             self.window().update()
             if not self.sized_once:
                 self.sized_once = True
                 self.show()
Example #2
0
 def sizeHint(self):
     return Q.QSize(self.img_width, self.img_height)