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. QListWidget Background Color not on Scrollbar
Forum Update on Monday, May 27th 2025

QListWidget Background Color not on Scrollbar

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.7k Views
  • 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.
  • A Offline
    A Offline
    Aroc
    wrote on last edited by
    #1

    Hello there

    Im trying to make a Gui with a ListView (ListWidget?) and wanted to set a background Color. This now looks like this:

    alt text

    How can i make the Background-Color only apply on the Actual Background, but not on the Scrollbar on the right?

    Hope someone can help me

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

      Hi
      if you used a stylesheet , you most likely made it too broad.
      Try using a name like
      QWidget#mylist { background-color: rgb(0, 170, 255); }

      (rename the list to mylist)
      Then it does like this
      alt text

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Aroc
        wrote on last edited by
        #3

        Hello

        Yes, i just made Rightclick on in and clicked on "Change Stylesheet". Copied your solution in, and it works. Thx for th e help

        mrjjM 1 Reply Last reply
        0
        • A Aroc

          Hello

          Yes, i just made Rightclick on in and clicked on "Change Stylesheet". Copied your solution in, and it works. Thx for th e help

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

          @Aroc
          Super :)
          Stylesheets are cascading and will affect all if you don't specify type or name.

          1 Reply Last reply
          0

          • Login

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