fuzzywuzzy01
27th August 2007, 23:33
How do I determine if my vertical scrollbar is going to be displayed at the time I'm setting up my dialog? In Qt3 MyTable->verticalScrollBar()->isHidden() always worked for me. I've tried isEnabled(), isHidden() and isVisible() but they seem to return the same thing regardless of how many items are in the table. The scroll bar policy is set to as needed. I imagine isVisible would work after the dialog is displayed but that is too late.
Also does anyone know which of the following lines is the preferable way to determine the scroll bar width? They both seem to work on my dev machine.
int ScrollBarWidth1 = ui.MyTable->verticalScrollBar()->sizeHint().width();
int ScrollBarWidth2 = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
Thanks!
Also does anyone know which of the following lines is the preferable way to determine the scroll bar width? They both seem to work on my dev machine.
int ScrollBarWidth1 = ui.MyTable->verticalScrollBar()->sizeHint().width();
int ScrollBarWidth2 = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
Thanks!