The following code runs, but the checkbox is tiny (it should be large). Why doesn't this work as expected? (One can use styling to resize the text, but that's not what I'm trying to do here). I'll be grateful for any suggestions.
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())

widthandheightdon't affect it. After all, up-scale resampling of a small bitmap cannot be done accurately. To solve this problem, you can mimic checkbox with your own control using different graphical element used to draw the check image.widthandheightdocs clearly explain: "Unless otherwise specified, this property has no effect when set on widgets. If you want a widget with a fixed height, set the min-height and max-height to the same value"; 2. as also explained in the Sub-Controls docs: "With complex widgets [...] if one property or sub-control is customized, all the other properties or sub-controls must be customized as well".