Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. change the size of the slider of the qscroolBar without having to use the stylesheet

change the size of the slider of the qscroolBar without having to use the stylesheet

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 587 Views 1 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.
  • B Offline
    B Offline
    benamiar
    wrote on last edited by
    #1

    hello ,
    i'm trying to change the size of the slider linked to my scrollBar i need to change this size each time so i looked in the class of qscrollBar and didn't find anything that allow me to change the size of the scroller so i need your help

    i don't want to use each time the stylesheet to do that .

     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:30;}"
                              "QScrollBar::add-line:horizontal {border: none; background: none;}"
                              "QScrollBar::sub-line:horizontal {border: none; background: none;}"
                             ).arg(Q2UiColorsLocator::get().getDispBackground().name(), Q2UiColorsLocator::get().getDispText().name(), Q2UiColorsLocator::get().getDisabled().name()));
    
    

    this is what i did that should be initialized in the constructor and don't want to use it again in my code .... tha's why i'm looking for another idea to resize the scroller. Help!!!!!

    M 1 Reply Last reply
    0
    • B benamiar

      hello ,
      i'm trying to change the size of the slider linked to my scrollBar i need to change this size each time so i looked in the class of qscrollBar and didn't find anything that allow me to change the size of the scroller so i need your help

      i don't want to use each time the stylesheet to do that .

       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:30;}"
                                "QScrollBar::add-line:horizontal {border: none; background: none;}"
                                "QScrollBar::sub-line:horizontal {border: none; background: none;}"
                               ).arg(Q2UiColorsLocator::get().getDispBackground().name(), Q2UiColorsLocator::get().getDispText().name(), Q2UiColorsLocator::get().getDisabled().name()));
      
      

      this is what i did that should be initialized in the constructor and don't want to use it again in my code .... tha's why i'm looking for another idea to resize the scroller. Help!!!!!

      M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      As this has nothing particular to do with mobile or embedded systems, you will have a better chance of getting suggestions on a forum that is purposed for this kind of issues

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Just as a note.
        You can apply a style sheet to the Application - then it will affect whole application.
        So you can set this ONCE and have all scrollbars follow it.

        1 Reply Last reply
        1

        • Login

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