How to Set the Hiding and Displaying of QScrollBar through QSS Statements
-
Regarding the scroll bar in QScrollArea, how can I display the scroll bar when the mouse is moved to the scroll bar area and disappear (or become transparent) when the mouse is moved out of the scroll bar area? Do I want to try to display the parts that are blocked by the scroll bar? Can it be achieved through QSS statements?
-
@XiaofengXu
That can't be achieved through QSS, I am afraid.
You can implement it in C++ by installing an event filter and show/hide it when a mouse enter/leave event is consumed. -
Hi,
In addition to @Axel-Spoerl, macOS already handles scroll bars like that. If memory serves well, KDE might also do it like that.
-
@Axel-Spoerl Thank you first! I use QScrollBar in QScrollArea. I think it is difficult to get capture the mouse leave or enter enevt in this case.
-