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. Why i can't change selection item color in QListWidget?

Why i can't change selection item color in QListWidget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 809 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.
  • RezistenceR Offline
    RezistenceR Offline
    Rezistence
    wrote on last edited by
    #1

    I try to change selection item color in QListWidget but my styleSheet not working right on selection.

    e9568c68-21eb-458a-b236-b56d5e135c66-image.png

    My styleSheet:

    background-color: #1c1919;
    border: 0;
    color: white;
    
    QListWidget::item:selected
    {
    background-color: #db1d5c;
    }
    
    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @Rezistence said in Why i can't change selection item color in QListWidget?:

      QListWidget::item:selected

      "QListView::item:selected { background-color: green; }" this works for Qt 5.15.2 on Ubuntu 18

      RezistenceR 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @Rezistence said in Why i can't change selection item color in QListWidget?:

        QListWidget::item:selected

        "QListView::item:selected { background-color: green; }" this works for Qt 5.15.2 on Ubuntu 18

        RezistenceR Offline
        RezistenceR Offline
        Rezistence
        wrote on last edited by
        #3

        @JoeCFD said in Why i can't change selection item color in QListWidget?:

        QListView::item:selected { background-color: green; }

        I use QT ver. 6 and try this, not working.

        JoeCFDJ 1 Reply Last reply
        0
        • RezistenceR Rezistence

          @JoeCFD said in Why i can't change selection item color in QListWidget?:

          QListView::item:selected { background-color: green; }

          I use QT ver. 6 and try this, not working.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @Rezistence Try the latest Qt6 version. Good luck!

          RezistenceR 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @Rezistence Try the latest Qt6 version. Good luck!

            RezistenceR Offline
            RezistenceR Offline
            Rezistence
            wrote on last edited by
            #5

            @JoeCFD I'm using the latest QT version and unfortunately this option doesn't work.

            1 Reply Last reply
            0
            • JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #6

              Then you can send a bug report to Qt with a small example.

              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