As a basic example,
from PySide2.QtWidgets import QApplication, QDialog, QCheckBox, QHBoxLayout
import sys
app = QApplication([])
window = QDialog()
layout = QHBoxLayout()
check = QCheckBox('Checkie McCheckerson')
layout.addWidget(check)
layout.addStretch(1)
window.setLayout(layout)
window.show()
sys.exit(app.exec_())
When the window is resized by the end-user, I want the checkbox's indicator to stretch with it, either as well as or instead of the text label next to it. Is there a way to achieve this?
This should be what the end-user sees on app start up.
This is what happens when the end-user resizes the window.
This is what I'd like to happen.
It should be noted that I understand this could be done with specific stylesheet bindings, but that would mean finite sizes, and I'd rather have a continuum. I've also tried using percentages, auto
and inherit
for the QCheckBox::indicator
width
and height
fields, which left them as a static size (this is how the 'intended behavior' image was generated).