Monitor QScrollArea's Bar Changes
-
hi,
how to monitor QScrollBarVertical Bar changes ?
regards
-
thx 4 answers
and srry 4 asking w/o deep searchi wsolved with
@
QAbstractSlider *VBar= (QAbstractSlider *)scrollArea->verticalScrollBar();
connect(VBar,SIGNAL(sliderReleased()),this, SLOT(Func()));
@ -
You must not cast to QAbstractSlider pointer type. A QScrollBar inherits from QAbstractSlider, so you can safely assign directly:
@
QAbstractSlider *VBar= scrollArea->verticalScrollBar();
@And you're better off to assign it to a QScrollBar pointer, to have access to the other methods too, if necessary. And yes, you do have access to QAbstractSlider's methods and signals too.