Ejemplo n.º 1
0
class BreakpointOverlayWidget(OverlayWidget):
    color = "#ff6060"

    def __init__(self, parent, bp, bpModel):
        OverlayWidget.__init__(self, parent, self.color)
        self.markerBp = QPixmap(":/markers/bp.png")
        self.markerBpDisabled = QPixmap(":/markers/bp_dis.png")
        self.bp = bp
        self.__bpModel = bpModel
        self.__icon = ClickableLabel()
        self.__icon.clicked.connect(self.toggleEnabled)
        self.__text = QLabel()

        self.layout().addWidget(self.__icon, 0)
        self.layout().addWidget(self.__text, 0)
        self.__icon.setCursor(Qt.ArrowCursor)

    def update(self):
        if self.bp.name:
            self.__text.setText("Breakpoint '%s', hit %s times" %
                                (self.bp.name, self.bp.times))
        else:
            self.__text.setText("Breakpoint #%s, hit %s times" %
                                (self.bp.number, self.bp.times))
        self.__icon.setPixmap(
            self.markerBp if self.bp.enabled else self.markerBpDisabled)
        self.resize(self.sizeHint().width(), self.height())

    def toggleEnabled(self):
        if self.bp.enabled:
            self.__bpModel.disableBreakpoint(self.bp.number)
        else:
            self.__bpModel.enableBreakpoint(self.bp.number)
Ejemplo n.º 2
0
    def __init__(self, parent, bp, bpModel):
        OverlayWidget.__init__(self, parent, self.color)
        self.markerBp = QPixmap(":/markers/bp.png")
        self.markerBpDisabled = QPixmap(":/markers/bp_dis.png")
        self.bp = bp
        self.__bpModel = bpModel
        self.__icon = ClickableLabel()
        self.__icon.clicked.connect(self.toggleEnabled)
        self.__text = QLabel()

        self.layout().addWidget(self.__icon, 0)
        self.layout().addWidget(self.__text, 0)
        self.__icon.setCursor(Qt.ArrowCursor)
Ejemplo n.º 3
0
class BreakpointOverlayWidget(OverlayWidget):
    color = "#ff6060"

    def __init__(self, parent, do, bp, bpModel):
        OverlayWidget.__init__(self, parent, self.color)
        self.markerBp = QPixmap(":/markers/bp.png")
        self.markerBpDisabled = QPixmap(":/markers/bp_dis.png")
        self.bp = bp
        self.__do = do
        self.__bpModel = bpModel
        self.__icon = ClickableLabel()
        self.__icon.clicked.connect(self.toggleEnabled)
        self.__text = QLabel()

        self.layout().addWidget(self.__icon, 0)
        self.layout().addWidget(self.__text, 0)
        self.__icon.setCursor(Qt.ArrowCursor)

        self.toolTip = None

    def update(self):
        if self.bp.name:
            self.__text.setText("Breakpoint '%s', hit %s times" %
                                (self.bp.name, self.bp.times))
        else:
            self.__text.setText("Breakpoint #%s, hit %s times" %
                                (self.bp.number, self.bp.times))
        self.__icon.setPixmap(
            self.markerBp if self.bp.enabled else self.markerBpDisabled)

    def toggleEnabled(self):
        if self.bp.enabled:
            self.__bpModel.disableBreakpoint(self.bp.number)
        else:
            self.__bpModel.enableBreakpoint(self.bp.number)

    def event(self, event):
        if event.type() == QEvent.ToolTip:
            self.toolTip = BreakpointWidget(self.__do, self.__bpModel, self.bp,
                                            None)
            self.toolTip.showToolTip(QPoint(self.height() / 2, self.height()),
                                     self)
            return True
        return OverlayWidget.event(self, event)

    def leaveEvent(self, *args, **kwargs):
        if self.toolTip:
            self.toolTip.hideLater()
        return OverlayWidget.leaveEvent(self, *args, **kwargs)
Ejemplo n.º 4
0
class BreakpointOverlayWidget(OverlayWidget):
    color = "#ff6060"

    def __init__(self, parent, do, bp, bpModel):
        OverlayWidget.__init__(self, parent, self.color)
        self.markerBp = QPixmap(":/markers/bp.png")
        self.markerBpDisabled = QPixmap(":/markers/bp_dis.png")
        self.bp = bp
        self.__do = do
        self.__bpModel = bpModel
        self.__icon = ClickableLabel()
        self.__icon.clicked.connect(self.toggleEnabled)
        self.__text = QLabel()

        self.layout().addWidget(self.__icon, 0)
        self.layout().addWidget(self.__text, 0)
        self.__icon.setCursor(Qt.ArrowCursor)

        self.toolTip = None

    def update(self):
        if self.bp.name:
            self.__text.setText("Breakpoint '%s', hit %s times" % (self.bp.name, self.bp.times))
        else:
            self.__text.setText("Breakpoint #%s, hit %s times" % (self.bp.number, self.bp.times))
        self.__icon.setPixmap(self.markerBp if self.bp.enabled else self.markerBpDisabled)

    def toggleEnabled(self):
        if self.bp.enabled:
            self.__bpModel.disableBreakpoint(self.bp.number)
        else:
            self.__bpModel.enableBreakpoint(self.bp.number)

    def event(self, event):
        if event.type() == QEvent.ToolTip:
            self.toolTip = BreakpointWidget(self.__do, self.__bpModel, self.bp, None)
            self.toolTip.showToolTip(QPoint(self.height()/2, self.height()), self)
            return True
        return OverlayWidget.event(self, event)

    def leaveEvent(self, *args, **kwargs):
        if self.toolTip:
            self.toolTip.hideLater()
        return OverlayWidget.leaveEvent(self, *args, **kwargs)
Ejemplo n.º 5
0
    def __init__(self, parent, do, bp, bpModel):
        OverlayWidget.__init__(self, parent, self.color)
        self.markerBp = QPixmap(":/markers/bp.png")
        self.markerBpDisabled = QPixmap(":/markers/bp_dis.png")
        self.bp = bp
        self.__do = do
        self.__bpModel = bpModel
        self.__icon = ClickableLabel()
        self.__icon.clicked.connect(self.toggleEnabled)
        self.__text = QLabel()

        self.layout().addWidget(self.__icon, 0)
        self.layout().addWidget(self.__text, 0)
        self.__icon.setCursor(Qt.ArrowCursor)

        self.toolTip = None