I am writing a slot method for the signal of scrolling down a scrollbar in QPlainTextEdit.
I only found this signalQPlainTextEdit.verticalScrollBar().valueChanged
.
I tested this signal and it returned the position number when scrolls to a new position.
My purpose is that when the scrollbar move down and trigger the slot method. But in that signal when move up it also triggeres the slot. I read the document but I couldn't find other signals.
A possible solution is to save the previous position and compare with the new position using
sliderPosition
property:Another possible option is to implement a use of the mousePressEvent and mouseMoveEvent events of the QScrollBar:
OR: