[QScintilla] ScrollBar does not work
Phil Thompson
phil at riverbankcomputing.com
Wed Nov 30 09:59:28 GMT 2016
On 30 Nov 2016, at 1:20 am, Gabriel Acosta <acostadariogabriel at gmail.com> wrote:
>
> 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?
https://www.riverbankcomputing.com/pipermail/qscintilla/2016-November/001172.html
Phil
More information about the QScintilla
mailing list