Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103855

Cannot change checkbox border color from QListWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.3.0
    • Widgets: Style Sheets
    • None
    • Linux/Wayland

    Description

      I didn't success to set border color to checkboxes inside a QListWidget. Both with C++ and PySide6.
      It was working with PySide2.

      It is quite problematic because, we cannot have checkbox for Qt application in dark theme.

       

      #include <QApplication>
      #include <QtWidgets>
      #include <QtCore>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QListWidget widget;
      
          for (int i=0; i <10; ++i)
          {
              QListWidgetItem * item = new QListWidgetItem("test");
              item->setCheckState(Qt::Checked);
              widget.addItem(item);
      
      
      
          }
      
          widget.show();
          a.setStyleSheet("QTableView::indicator:checked {background-color:red}");
      
          return a.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            sschutz sacha schutz
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes