I have a QScrollArea with a 4,000-pixel (height), custom-painted widget on it. But the actual part of the widget displayed at any given time is more like 400 pixels. How can I determine this number exactly?
I've tried:
myScrollArea->height();
myScrollArea->height();
To copy to clipboard, switch view to plain text mode
and
QRegion treg
= myScrollArea
->visibleRegion
();
QRect trect
= tregion.
boundingRect();
qDebug(" height = %d", trect.height() );
QRegion treg = myScrollArea->visibleRegion();
QRect trect = tregion.boundingRect();
qDebug(" height = %d", trect.height() );
To copy to clipboard, switch view to plain text mode
The first returns "480" (though that's not correct), and the 2nd returns 0. Ideas?
Bookmarks