Does anyone know how to make a custom scrollbar that looks as follows:

  • I've been messing around with creating my own scrollbar class to make it look like a specific one (I'll attach it). The problem I keep having is that the scroll arrows are only hidden and not removed, so the scrollbar doesn't fully scroll down. I also don't know how to make the scroll area a different color than the rest of the table that it's on. I'll attach the example and the code I have so far.


    class CustomScrollBar(QtWidgets.QScrollBar):
    def init(self, *args, **kwargs):
    QtWidgets.QScrollBar.init(self, *args, **kwargs)
    self.baseSheet = '''
    QScrollBar::right-arrow:vertical, QScrollBar::left-arrow:vertical{{
    border: none;
    background: none;
    color: none;

            QScrollBar::add-line:vertical {{
              border: none;
              background: none;
            QScrollBar::sub-line:vertical {{
              border: none;
              background: none;


  • @sherief if you go look at the documentation here ( and pull up QScrollBar you would find that it inherits from QAbstractSlider which in turn inherits from QWidget.

    So the chances are if you want to create your own QScrollBar you will probably need to use its parent QAbstractSlider or its grand-parent QWidget to implement the things you are attempting to do.

    Note not only does QScrollBar inherit from QAbstractSlider but also QDial and QSlider do as well so if you wanting ideas on how to manipulate the QAbstractSlider perhaps these other two child classes might help you.

  • Lifetime Qt Champion

    If you mean for it to have no arrows.
    then something like
    alt text

Log in to reply