Is there a way to force QScrollArea to stay down ?
Like an instant messenger conversation.
I tried with the following implementation, but it makes the view flickers:
void ZeScrollAreaWidget::onRangeChanged(int min, int max)
{
if (isStayDown() == true)
{
if (verticalScrollBar()->sliderPosition() == mOldMax
||
mOldMax == -1)
{
verticalScrollBar()->setSliderPosition(max);
}
}
mOldMax = max;
}
void ZeScrollAreaWidget::onRangeChanged(int min, int max)
{
if (isStayDown() == true)
{
if (verticalScrollBar()->sliderPosition() == mOldMax
||
mOldMax == -1)
{
verticalScrollBar()->setSliderPosition(max);
}
}
mOldMax = max;
}
To copy to clipboard, switch view to plain text mode
Is there a way to avoid this hack? Or do I have to reimplement QAbstractScrollArea
Thanks.
Bookmarks