UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.27k stars 241 forks source link

QGroupBox the setCheckable parameter does not accept the theme setting #33

Closed edwardgra4ev closed 2 years ago

edwardgra4ev commented 2 years ago

If you set the setCheckable parameter in QGroupBox, then it will not accept the same themes as QCheckBox Windows 11 Platform Python 3.9 and 3.10 Library PySide6 Example:

# -*- coding: utf-8 -*-

from PySide6.QtCore import (QCoreApplication,QMetaObject, QRect,)

from PySide6.QtWidgets import (QApplication, QCheckBox, QGroupBox, QMainWindow,
    QMenuBar, QStatusBar, QVBoxLayout, QWidget)

import sys
from qt_material import apply_stylesheet

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(303, 147)
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.verticalLayout_2 = QVBoxLayout(self.centralwidget)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_3 = QVBoxLayout()
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.groupBox = QGroupBox(self.centralwidget)
        self.groupBox.setObjectName(u"groupBox")
        self.groupBox.setCheckable(True)
        self.groupBox.setChecked(False)
        self.verticalLayout = QVBoxLayout(self.groupBox)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.checkBox = QCheckBox(self.groupBox)
        self.checkBox.setObjectName(u"checkBox")
        self.checkBox.setChecked(True)
        self.verticalLayout.addWidget(self.checkBox)
        self.verticalLayout_3.addWidget(self.groupBox)
        self.verticalLayout_2.addLayout(self.verticalLayout_3)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QMenuBar(MainWindow)
        self.menubar.setObjectName(u"menubar")
        self.menubar.setGeometry(QRect(0, 0, 303, 22))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QStatusBar(MainWindow)
        self.statusbar.setObjectName(u"statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.retranslateUi(MainWindow)
        QMetaObject.connectSlotsByName(MainWindow)
    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
        self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"GroupBox", None))
        self.checkBox.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
    # retranslateUi

class ExampleApp(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super().__init__()
        self.setupUi(self)

def main():
    app = QApplication(sys.argv)
    window = ExampleApp()
    apply_stylesheet(app, theme='dark_blue.xml')
    window.show()
    app.exec_()

if __name__ == '__main__': 
    main() 

image image

5yutan5 commented 2 years ago

I created pull request. I'm waiting for the maintainer's reply.

YeisonCardona commented 2 years ago

Hi @5yutan5 and @edwardgra4ev

That pull request was merged and now is available on PyPi too. Thanks for your apports.