Closed edwardgra4ev closed 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()
I created pull request. I'm waiting for the maintainer's reply.
Hi @5yutan5 and @edwardgra4ev
That pull request was merged and now is available on PyPi too. Thanks for your apports.
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: