Check out Kite (free AI Coding Assistant) → Link



Buy Me a Coffee? Your support is much appreciated!

PayPal Me: https://www.paypal.me/jiejenn/5
Venmo: @Jie-Jenn

Source Code:    

import sys
from PyQt5.QtWidgets import QApplication, QWidget, QCheckBox, QHBoxLayout 


class AppDemo(QWidget):
    def __init__(self):
        super().__init__()
        self.resize(600, 200)
        self.setStyleSheet('''
            QCheckBox {
                font-size: 55px;
            }

            QCheckBox::indicator {
                width: 40px;
                height: 40px;
                border: 5px solid green;
                background-color: yellow;
            }

            QCheckBox::indicator:checked {
                image: url(checked.png)
            }

            QCheckBox::indicator:unchecked {
                background-color: yellow;
            }

            QCheckBox::indicator:hover {
                border: 5px solid red;
                background-color: yellow;
            }

        

        ''')

        layout = QHBoxLayout()

        self.checkBoxYes = QCheckBox('Yes')
        layout.addWidget(self.checkBoxYes)

        self.checkBoxNo = QCheckBox('No')
        layout.addWidget(self.checkBoxNo)

        self.setLayout(layout)

if __name__ == '__main__':
    app = QApplication(sys.argv)

    demo = AppDemo()
    demo.show()

    try:
        sys.exit(app.exec_())
    except SystemExit:
        print('Closing Window...')