Important: Please read the Qt Code of Conduct -

how to change delete a scroller of a qscrollBar

  • Hello guys,

    i'm trying to change the width of the scroller of my QScroolBar, for that i used stylesheet and i put at the beginning my width to 0 but i still see the scroller. and even if i put a small value it's not working, it start working after a certain value. i have a range from 0 to 60 and a size of my bar 160.

    so my question is how can we put to 0 my scroller.
    i need to change each time my width!!!

     setStyleSheet(QString("QScrollBar:horizontal{background-color: %2; border: 2px solid %2; border-radius: 1px; margin: 0px; height:15 px;}"
                              "QScrollBar::handle:horizontal{background-color: %1 ; min-width:%3;}"
                              "QScrollBar::add-line:horizontal {border: none; background: none;}"
                              "QScrollBar::sub-line:horizontal {border: none; background: none;}"
                             ).arg(BackgroundGraph, backgroundBar).arg(width));

    this is what i got at width=0

  • Lifetime Qt Champion


    What exactly are you trying to achieve with that design ?

Log in to reply