ui/BoundingBox.py
def paint(self, painter: QPainter, option: QStyleOptionGraphicsItem,
              widget: typing.Optional[QWidget] = ...) -> None:
        """
        Paint the item within the scene
        :param painter: Painter object
        :param option: Style object
        :param widget: Optional widget
        :return:
        """
        pen = QPen(self.color.lighter(), 4 if self.highlighted else 2)
        painter.setPen(pen)
        painter.drawRect(0, 0, self.width, self.height)

        painter.setFont(QFont('Helvetica', 12, QFont.Bold))
        draw_text = self.label if self.label else 'No label'
        if self.source.part is not None and self.source.part != 'self':
            draw_text += ' ' + self.source.part
        painter.drawText(0, self.height,
                         self.width, 20,
                         Qt.AlignCenter | Qt.TextDontClip,
                         draw_text)

        Paint the item within the scene
        :param painter: Painter object
        :param option: Style object
        :param widget: Optional widget
        :return:
        
Paint the item within the scene
Paint the item within the scene
def paint(self, painter: QPainter, option: QStyleOptionGraphicsItem,
              widget: typing.Optional[QWidget] = ...) -> None:
        pen = QPen(self.color.lighter(), 4 if self.highlighted else 2)
        painter.setPen(pen)
        painter.drawRect(0, 0, self.width, self.height)
        painter.setFont(QFont('Helvetica', 12, QFont.Bold))
        draw_text = self.label if self.label else 'No label'
        if self.source.part is not None and self.source.part != 'self':
            draw_text += ' ' + self.source.part
        painter.drawText(0, self.height,
                         self.width, 20,
                         Qt.AlignCenter | Qt.TextDontClip,
                         draw_text)
def paint ( self , painter : QPainter , option : QStyleOptionGraphicsItem , widget : typing . Optional [ QWidget ] = ... ) -> None : pen = QPen ( self . color . lighter ( ) , 4 if self . highlighted else 2 ) painter . setPen ( pen ) painter . drawRect ( 0 , 0 , self . width , self . height ) painter . setFont ( QFont ( 'Helvetica' , 12 , QFont . Bold ) ) draw_text = self . label if self . label else 'No label' if self . source . part is not None and self . source . part != 'self' : draw_text += ' ' + self . source . part painter . drawText ( 0 , self . height , self . width , 20 , Qt . AlignCenter | Qt . TextDontClip , draw_text )
Paint the item within the scene
Paint the item within the scene
"""
        Paint the item within the scene
        :param painter: Painter object
        :param option: Style object
        :param widget: Optional widget
        :return:
        """
None
self
painter
QPainter
None
option
QStyleOptionGraphicsItem
None
widget
typing.Optional[QWidget]
None