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. [SOLVED] QListWidget style sheet - transperent background with custom check box.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QListWidget style sheet - transperent background with custom check box.

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

    I need to use icon as a check box in my QListWidgetItem, also I need transparent background for my list widget.I don't know style shets. Can anybody help me please ?
    The code that I have:
    @setStyleSheet("QListWidget::indicator:checked { image: url(:/Console/ButtonTemplate/RedLedOn.png)}
    QListWidget::indicator:unchecked { image: url(:/Console/ButtonTemplate/RedLedOff.png)}
    QListWidget::indicator:indeterminate { image: url(:/Console/ButtonTemplate/WhiteLedOff.png)}
    QListWidget::indicator { width: 24px; height:24px; }");
    //QWidget::background: transparent;};");
    //background: transparent;");@
    The result is custom check icon with custom size, but no transparent background and no shifting of text, I need to move text for about 2-3 px to the right border.

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

      Here is solution: @setStyleSheet("QListWidget::indicator:checked { image: url(:/Console/ButtonTemplate/RedLedOn.png)}
      QListWidget::indicator:unchecked { image: url(:/Console/ButtonTemplate/RedLedOff.png)}
      QListWidget::indicator:indeterminate { image: url(:/Console/ButtonTemplate/WhiteLedOff.png)}
      QListWidget::indicator { width: 24px; height:24px; }
      QListWidget::item { padding-left: 0px; }
      QListView::item:text {color: black;}
      QListView {background: transparent;}");@
      Thanks, everyone.

      1 Reply Last reply
      2

      • Login

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