code: def adjustSizeConstraint(self):
          
          widget = self.currentWidget()
          if not widget:
              return
              
          offw = 4
          offh = 4
          
          #if self.tabBar().isVisible():
          #    offh += 20 # tab bar height
          
          minw = min(widget.minimumWidth() + offw,   MAX_INT)
          minh = min(widget.minimumHeight() + offh,  MAX_INT)
          maxw = min(widget.maximumWidth() + offw,   MAX_INT)
          maxh = min(widget.maximumHeight() + offh,  MAX_INT)
          
          self.setMinimumSize(minw, minh)
          self.setMaximumSize(maxw, maxh)
          self.setSizePolicy(widget.sizePolicy())
docs: Adjusts the min/max size based on the current tab.