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. Red Background in QTreeWidget
Qt 6.11 is out! See what's new in the release blog

Red Background in QTreeWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 228 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.
  • K Offline
    K Offline
    Kangon
    wrote on last edited by
    #1

    95194e4f-cd4f-4b91-bf4d-d80f3905efd5-image.png

    I was trying to change the icon of an item in my QTreeWidget, but the red background keeps appearing. It is always visible, whether I click on an item or not.
    My stylesheet looks like this:

    /* Grundlayout für das TreeWidget */
    QListWidget {
    background: #121418;
    color: #e6e6e6;
    border: 1px solid #2a2e36;
    border-radius: 8px;
    padding: 4px;
    outline: none;
    }

    /* Hover-Effekt /
    QListWidget::item:hover {
    background: #8a9ba8; /
    helleres Orange beim Überfahren */
    color: black;
    outline: none;
    }

    QListWidget::item:selected {
    background: #5c7080; /* helleres Orange beim Überfahren */
    color: black;
    outline: none;
    }

    /* Basis */
    QScrollBar {
    background: transparent;
    margin: 0px;
    }

    /* Vertikal /
    QScrollBar:vertical {
    width: 8px;
    }
    QScrollBar::handle:vertical {
    background: rgba(238, 125, 0, 0.3); /
    dezent orange /
    min-height: 20px;
    border-radius: 4px;
    }
    QScrollBar::handle:vertical:hover {
    background: #ee7d00; /
    volle Farbe beim Hover */
    }
    QScrollBar::add-line:vertical,
    QScrollBar::sub-line:vertical {
    background: none;
    height: 0px;
    border: none;
    }
    QScrollBar::add-page:vertical,
    QScrollBar::sub-page:vertical {
    background: transparent;
    }

    /* Horizontal */
    QScrollBar:horizontal {
    height: 8px;
    }
    QScrollBar::handle:horizontal {
    background: rgba(238, 125, 0, 0.3);
    min-width: 20px;
    border-radius: 4px;
    }
    QScrollBar::handle:horizontal:hover {
    background: #ee7d00;
    }
    QScrollBar::add-line:horizontal,
    QScrollBar::sub-line:horizontal {
    background: none;
    width: 0px;
    border: none;
    }
    QScrollBar::add-page:horizontal,
    QScrollBar::sub-page:horizontal {
    background: transparent;
    }

    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