Solved How to remove or hide scrollbars when delete the widget of qscrollarea?
-
Hi, I have this code:
QWidget *w = ui->scrollArea->takeWidget(); delete w;
and the inner widget of qscrollarea is deleted correctly, but the scrollbars remain. How can I hide or remove this scrollbars in this case?
-
Hi,
I am surprised they do not disappear however you can access them directly and hide them. See for example horizontalScrollBar and its vertical friend.
-
Thanks, I updated the code to:
QWidget *w = ui->scrollArea->takeWidget(); delete w; ui.scrollArea->verticalScrollBar()->hide();
it works fine.