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:
Qt Code:
  1. myScrollArea->height();
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. QRegion treg = myScrollArea->visibleRegion();
  2. QRect trect = tregion.boundingRect();
  3. 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?