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. QTableView - Transparent scrollbars background

QTableView - Transparent scrollbars background

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 4.1k Views
  • 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.
  • David.ReznicekD Offline
    David.ReznicekD Offline
    David.Reznicek
    wrote on last edited by
    #1

    Hello,

    I would like to know if is possible to style scrollbars like is shown in following screenshots:
    Screenshot
    I tried to use style:
    QScrollBar:vertical {
    border: transparent;
    background-color: transparent;
    width: 10px;
    margin: 0 0 0 0;}
    But scrollbar background still "hides" table rows...
    Can anyone help me please?

    Thanks, David.

    David.ReznicekD raven-worxR 2 Replies Last reply
    0
    • David.ReznicekD David.Reznicek

      Hello,

      I would like to know if is possible to style scrollbars like is shown in following screenshots:
      Screenshot
      I tried to use style:
      QScrollBar:vertical {
      border: transparent;
      background-color: transparent;
      width: 10px;
      margin: 0 0 0 0;}
      But scrollbar background still "hides" table rows...
      Can anyone help me please?

      Thanks, David.

      David.ReznicekD Offline
      David.ReznicekD Offline
      David.Reznicek
      wrote on last edited by
      #2

      @David.Reznicek little progress:

      QScrollBar:vertical {border: none;background-color: #282828;width: 10px;margin: 25px 0 0px 0;}\
      QScrollBar::handle:vertical{border-radius: 4px;border-color: rgba(216, 216, 216, 75%);border-width: 1px; border-style: solid; background-color: rgba(216, 216, 216, 75%); min-height: 25px;}\
      QScrollBar::add-line:vertical{width: 0px; height: 0px;}\
      QScrollBar::sub-line:vertical{width: 0px; height: 0px;}\
      QScrollBar::add-page:vertical{background-color: transparent;}\
      QScrollBar::sub-page:vertical{background-color: transparent;}\
      

      BUT QscrollBar is still not transparent :(

      1 Reply Last reply
      0
      • David.ReznicekD David.Reznicek

        Hello,

        I would like to know if is possible to style scrollbars like is shown in following screenshots:
        Screenshot
        I tried to use style:
        QScrollBar:vertical {
        border: transparent;
        background-color: transparent;
        width: 10px;
        margin: 0 0 0 0;}
        But scrollbar background still "hides" table rows...
        Can anyone help me please?

        Thanks, David.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @David.Reznicek
        Thats because the viewport and the scrollbars are layouted side-by-side instead of stacked above.
        So you wont receive the result you want with QScrollArea directly.

        Either way you reimplement your custom scrollarea or you subclass QScrollArea, set the scrollbar policy of both scrollbars to "AlwaysOff" and add your custom scrollbars as a child to the viewport. Also you need to make sure that you reposition the scrollbars on resize and keep the hidden and custom scrollbars in sync.
        I haven't tried it, but i think it should work.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        2
        • David.ReznicekD Offline
          David.ReznicekD Offline
          David.Reznicek
          wrote on last edited by
          #4

          Thanks a lot..I'll try it.

          1 Reply Last reply
          0

          • Login

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