[QScintilla] ScrollBar does not work

Gabriel Acosta acostadariogabriel at gmail.com
Wed Nov 30 01:20:34 GMT 2016


Hello,

I have a custom QScrollBar that draws markers:

class ScrollBarMarker(QScrollBar):

    def __init__(self, sci):
        QScrollBar.__init__(self, sci)
        self._editor = sci
        self._editor.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
        self._editor.setVerticalScrollBar(self)

    def paintEvent(self, event):
        op = QStyleOptionSlider()
        self.initStyleOption(op)
        if op.maximum > 0:
            super(ScrollBarMarker, self).paintEvent(event)
        painter = QPainter(self)
        # Draw markers
        self.__draw_markers(painter)

The problem is in "self._editor.setVerticalScrollBar(self)", when I
drag the slider, the editor does not scroll. But when I move the
editor, the slider moves. It's as if the connections are los, Why is
this happening?

Regards!
-- 
Gabriel Acosta
NINJA-IDE Core Developer
https://centaurialpha.github.io


More information about the QScintilla mailing list