Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to Set the Hiding and Displaying of QScrollBar through QSS Statements
Qt 6.11 is out! See what's new in the release blog

How to Set the Hiding and Displaying of QScrollBar through QSS Statements

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 788 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    XiaofengXu
    wrote on last edited by
    #1

    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?

    Axel SpoerlA 1 Reply Last reply
    0
    • X XiaofengXu

      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?

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @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.

      Software Engineer
      The Qt Company, Oslo

      X 1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        In addition to @Axel-Spoerl, macOS already handles scroll bars like that. If memory serves well, KDE might also do it like that.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • Axel SpoerlA Axel Spoerl

          @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.

          X Offline
          X Offline
          XiaofengXu
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • X XiaofengXu has marked this topic as solved on

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved