Code: Select all
import sys
from PyQt5.QtWidgets import (
QApplication,
QCheckBox,
QVBoxLayout,
QWidget,
)
class Window(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
# Create a Checkbox with a text label:
chkBox = QCheckBox(text="Check box if you want this option.")
# Make the checkbox large (has no effect):
chkBox.setStyleSheet('QCheckBox::indicator {width:24px; height:24px}')
layout= QVBoxLayout()
layout.addWidget(chkBox)
self.setLayout(layout)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec())