How can one hide the scrollbars in a QScrollArea
? Currently I use the hide()
method on the scrollbars returned by QScrollArea::horizontalScrollBar()
and QScrollArea::verticalScrollBar()
but the space reserved for scrollbars still remains. Obviously this looks very ugly and is not space efficient. If I remove the scrollbars altogether I can no longer easily scroll to a specific point using QScrollBar::setValue()
.
相关问题
- QML: Cannot read property 'xxx' of undefin
- QTextEdit.find() doesn't work in Python
- QT Layouts, how to make widgets in horizontal layo
- QT GUI freezes even though Im running in separate
- QGraphicsView / QGraphicsScene size matching
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Is there a non-java, cross platform way to launch
- How to get a settings storage path in a cross-plat
- Why doesn't valgrind detect a memory leak in m
- QTreeView remove decoration/expand button for all
- qt界面拥挤
- how do I correctly return values from pyqt to Java
From Qt documents for
scrollContentsBy()
:You can hide it using a style sheet. Use
height:0px;
to hide the horizontal scroll bar andwidth=0px;
to hide the vertical scroll bar. Like that:And voila!.No scroll bars, and you can still manipulate them using
setValue()
.Use this code:
This piece of code can do the job: