So I never found a built in way to figure this out. I ended up sub-classing QTableWidget and writing my own query to see if it was visible. Here it is for anyone else who runs into this problem.
bool ExtTable::IsVerticalScrollBarVisible()
{
bool IsVisible = false;
int HeightOfAllRows = 0;
for (int i = 0; i < rowCount(); i++)
HeightOfAllRows += rowHeight(i);
int HeaderHeight = horizontalHeader()->height();
int TableHeight = height();
if ( (HeightOfAllRows + HeaderHeight) > TableHeight )
IsVisible = true;
return IsVisible;
}
bool ExtTable::IsVerticalScrollBarVisible()
{
bool IsVisible = false;
int HeightOfAllRows = 0;
for (int i = 0; i < rowCount(); i++)
HeightOfAllRows += rowHeight(i);
int HeaderHeight = horizontalHeader()->height();
int TableHeight = height();
if ( (HeightOfAllRows + HeaderHeight) > TableHeight )
IsVisible = true;
return IsVisible;
}
To copy to clipboard, switch view to plain text mode
Bookmarks