Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Change stylesheet

    General and Desktop
    2
    4
    2960
    Loading More Posts
    • 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.
    • C
      chikymanzanares last edited by

      Hi,

      I don't know how to change the GUI style.

      I push the right button on, for example, a listWidget, I push change stylesheet. I write

      @
      QScrollBar:vertical {
      border: 2px solid grey;
      background: #32CC99;
      height: 15px;
      margin: 0px 20px 0 20px;
      }
      QScrollBar::handle:vertical {
      background: white;
      min-width: 20px;
      }
      QScrollBar::add-line:vertical {
      border: 2px solid grey;
      background: #32CC99;
      width: 20px;
      subcontrol-position: right;
      subcontrol-origin: margin;
      }

      QScrollBar::sub-line:vertical {
      border: 2px solid grey;
      background: #32CC99;
      width: 20px;
      subcontrol-position: left;
      subcontrol-origin: margin;
      }
      @

      I run, but the style don't change. Should I do something more?

      My qt versión is the following

      Qt Creator 2.1.0
      Based on Qt 4.7.1 (32 bit)

      Built on Mar 22 2011 at 13:04:36

      From revision e80bb4437c

      1 Reply Last reply Reply Quote 0
      • E
        Eddy last edited by

        If you try your code with a horizontal QScrollBar you will see the results you want.
        If you use it on a vertical one you will not.

        You probably copied the stylesheet code, which was meant for a horizontal scrollbar and tried to use it for a vertical one.

        where you use height, you should use width instead and vice versa.

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply Reply Quote 0
        • C
          chikymanzanares last edited by

          thanks Eddy, Now I understand. You're right in all.

          1 Reply Last reply Reply Quote 0
          • E
            Eddy last edited by

            You're welcome!

            Could you please edit your title and add [solved] in front of it?

            Qt Certified Specialist
            www.edalsolutions.be

            1 Reply Last reply Reply Quote 0
            • First post
              Last post