QScrollArea *scrollArea = new QScrollArea(this);
scrollArea->verticalScrollBar()->width();
Im trying to get the width of verticalScrollBar of QScrollArea. So I ran the code above and I got “member access into incomplete type QScrollBar error”. What did I do wrong? and How can i get the width of verticalScrollBar?
The solution is to #include <QScrollBar>
because verticalScrollBar()
returns a QScrollBar*
and you de-reference that pointer and call width()
, for that to work you need to include QScrollBar
header file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With