code: def paintEvent(self, ev):
      p = QtGui.QPainter(self)
      # p.setBrush(QtGui.QBrush(QtGui.QColor(100, 100, 200)))
      # p.setPen(QtGui.QPen(QtGui.QColor(50, 50, 100)))
      # p.drawRect(self.rect().adjusted(0, 0, -1, -1))
  
      # p.setPen(QtGui.QPen(QtGui.QColor(255, 255, 255)))
  
      if self.orientation == "vertical":
          p.rotate(-90)
          rgn = QtCore.QRect(
              -self.height(), 0, self.height(), self.width()
          )
      else:
          rgn = self.contentsRect()
      align = self.alignment()
      # align  = QtCore.Qt.AlignmentFlag.AlignTop|QtCore.Qt.AlignmentFlag.AlignHCenter
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          self.hint = p.drawText(rgn, align, self.text())
      p.end()
  
      if self.orientation == "vertical":
          self.setMaximumWidth(self.hint.height())
          self.setMinimumWidth(0)
          self.setMaximumHeight(16777215)
          if self.forceWidth:
              self.setMinimumHeight(self.hint.width())
          else:
              self.setMinimumHeight(0)
      else:
          self.setMaximumHeight(self.hint.height())
          self.setMinimumHeight(0)
          self.setMaximumWidth(16777215)
          if self.forceWidth:
              self.setMinimumWidth(self.hint.width())
          else:
              self.setMinimumWidth(0)
  
file_path: pyqtgraph/pyqtgraph/widgets/VerticalLabel.py
imports: import warnings
  from ..Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 3 for calling the VerticalLabel obj's underlying member method code with example usage: obj.paintEvent(ev) without return types