Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox of user-checkable QTableWidgetItem not in qdarkstyle #242

Closed
p2749 opened this issue Oct 27, 2020 · 0 comments
Closed

Checkbox of user-checkable QTableWidgetItem not in qdarkstyle #242

p2749 opened this issue Oct 27, 2020 · 0 comments
Assignees
Milestone

Comments

@p2749
Copy link

p2749 commented Oct 27, 2020

Describe Your Environment

Please, report the output of the command (from v2.6+) or fill the information below:

  • HARDWARE-----------------------------------------------------------------------
    • Machine....................... AMD64
    • Processor..................... Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    • Total Memory.................. 16976 MB
    • Free Memory................... 8646 MB
    • Total Swap.................... 19526 MB
    • Free Swap..................... 5805 MB
  • OPERATING SYSTEM---------------------------------------------------------------
    • System........................ Windows
    • Release....................... 10
    • Platform...................... Windows-10-10.0.18362-SP0
    • Version....................... 10.0.18362
  • THREADS------------------------------------------------------------------------
    • Version....................... None
    • Name.......................... nt
    • Lock.......................... None
  • PYTHON DISTRIBUTION------------------------------------------------------------
    • Version....................... 3.7.9
    • C Compiler.................... MSC v.1916 64 bit (AMD64)
    • C API Version................. 1013
    • Implementation................ cpython
    • Implementation Version........ 3.7.9
  • CONDA DISTRIBUTION-------------------------------------------------------------
    • Version....................... 4.8.5
    • Build......................... 3.20.3
  • QT BINDINGS--------------------------------------------------------------------
    • PyQt5 Version................. 5.15.0
    • PyQt5 Qt Version.............. 5.15.0
  • QT ABSTRACTIONS----------------------------------------------------------------
    • qtpy Version.................. 1.9.0
    • qtpy Binding.................. pyqt5
    • qtpy Binding Variable......... os.environ['QT_API']
    • qtpy Import Name.............. qtpy
    • qtpy Status................... OK
  • QDarkStyle: 2.8.1

Language

Python

Description / Steps to Reproduce [if necessary]

When a QTableWidgetItem is set to "isUserCheckable" the checkbox that comes with it is not in the style of qdarkstyle, but rather in the default style (white box with black check mark). This only holds for QTableWidgetItem; the checkbox of e.g. a QListWidgetItem is in the qdarkstyle (see example below).

Actual Result

Capture

Expected Results / Proposed Result

The checkbox of a user-checkable QTableWidgetItem should be in the same style as the other checkboxes in qdarkstyle.

Relevant Code [if necessary]

Minimal example which produces the image above:

import sys
from PyQt5 import QtWidgets, QtCore
import qdarkstyle

class Window(QtWidgets.QWidget):
    
    def __init__(self):
        super().__init__()

        self.table = QtWidgets.QTableWidget()
        self.table.setColumnCount(1)
        self.table.setRowCount(1)
        table_item = QtWidgets.QTableWidgetItem('Table item')
        table_item.setFlags(table_item.flags() | QtCore.Qt.ItemIsUserCheckable)
        table_item.setCheckState(QtCore.Qt.Checked)
        self.table.setItem(0, 0, table_item)
        
        self.list = QtWidgets.QListWidget()
        list_item = QtWidgets.QListWidgetItem('List item')
        list_item.setFlags(list_item.flags() | QtCore.Qt.ItemIsUserCheckable)
        list_item.setCheckState(QtCore.Qt.Checked)
        self.list.addItem(list_item)        
        
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.table)
        layout.addWidget(self.list)
        self.setLayout(layout)  
        self.show()                  
            
app = QtWidgets.QApplication(sys.argv)    
app.aboutToQuit.connect(app.deleteLater)
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())

w = Window()
app.exec_()
@dpizetta dpizetta self-assigned this Mar 29, 2021
@dpizetta dpizetta added this to the 3.0 milestone Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants