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. scrollbar stylesheet not working in listview ;
Forum Updated to NodeBB v4.3 + New Features

scrollbar stylesheet not working in listview ;

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 2.7k 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.
  • S Offline
    S Offline
    saber
    wrote on last edited by saber
    #1

    here is the stylesheet

    0_1525428822524_rw.png

    QWidget{
    background-color: #232323;
    border: 1px rgb(0, 0, 0);
    padding: 10px 5px 5px 5px;
    }
    
    
    QScrollBar::groove {
        background: red;
        position: absolute;
        left: 4px; right: 4px;
    }
    
    QScrollBar::handle {
       background: white;
        height:10px;
    }
    
    QScrollBar::add-page {
        background: #172027;
    }
    
    QScrollBar::sub-page{
        background: #172027;
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      How are you applying it ?
      What version of Qt are you using ?
      On what OS ?

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

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        How are you applying it ?
        What version of Qt are you using ?
        On what OS ?

        S Offline
        S Offline
        saber
        wrote on last edited by
        #3

        @SGaist
        via qt desinger ,
        i am in linux,qt 5.10.1

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

          What widgets did you use in your custom widget ?

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

          S 1 Reply Last reply
          0
          • SGaistS SGaist

            What widgets did you use in your custom widget ?

            S Offline
            S Offline
            saber
            wrote on last edited by
            #5

            @SGaist
            it is not a custom widget.
            it is a list widget

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

              There's no evidence of it in your picture since you did some heavy customisation.

              Can you show how you are setting it up and apply the stylesheet ?

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

              S 1 Reply Last reply
              0
              • SGaistS SGaist

                There's no evidence of it in your picture since you did some heavy customisation.

                Can you show how you are setting it up and apply the stylesheet ?

                S Offline
                S Offline
                saber
                wrote on last edited by
                #7

                @SGaist
                i made that with the qt designer
                and also applying the stylesheet by designer.

                mrjjM 1 Reply Last reply
                0
                • S saber

                  @SGaist
                  i made that with the qt designer
                  and also applying the stylesheet by designer.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @saber
                  Hi
                  It does work, but your style might not be complete enough.

                  using bigger sample, it does have effect
                  alt text

                  please see
                  http://doc.qt.io/qt-5/stylesheet-examples.html
                  and Customizing QScrollBar

                  S 1 Reply Last reply
                  0
                  • mrjjM mrjj

                    @saber
                    Hi
                    It does work, but your style might not be complete enough.

                    using bigger sample, it does have effect
                    alt text

                    please see
                    http://doc.qt.io/qt-5/stylesheet-examples.html
                    and Customizing QScrollBar

                    S Offline
                    S Offline
                    saber
                    wrote on last edited by
                    #9

                    @mrjj

                    this works on my other widget (qscroll area ) .
                    so i am sure that scroll bar's style sheet is correct .

                    mrjjM 1 Reply Last reply
                    0
                    • S saber

                      @mrjj

                      this works on my other widget (qscroll area ) .
                      so i am sure that scroll bar's style sheet is correct .

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @saber
                      Ok. no idea then.
                      QScrollbar is QScrollbar no matter who uses it.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        saber
                        wrote on last edited by
                        #11

                        it seems that the stylesheet is conflicts with the parent widget's stylesheet.
                        i applied the stylesheet through the parent and remove the stylesheet from the listwidget and it is fixed.
                        thanks.

                        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