I think at the time your code is executed the scroll area has not yet updated the scrollbar size. Try executing the code after all events are processed, by putting the code into a private slot and trigger it by a single shot timer:
...
QTimer::singleShot(0,
this,
SLOT(scrollRight
()));
...
void MyClass::scrollRight()
{
int max = imageList->horizontalScrollBar()->maximum();
imageList->horizontalScrollBar()->setValue(max);
}
...
QTimer::singleShot(0, this, SLOT(scrollRight()));
...
void MyClass::scrollRight()
{
int max = imageList->horizontalScrollBar()->maximum();
imageList->horizontalScrollBar()->setValue(max);
}
To copy to clipboard, switch view to plain text mode
Bookmarks