The code below creates a single Dialog
window with two checkboxes
.
Second checkbox was constrained to a 8x8px size with setMaximumSize(8, 8)
function.
But it appears that the smaller size of the checkbox widget was not applied to the cross icon. So the icon is clipped by the boundaries of the checkbox widget. How to make sure the cross icon is scaled proportionally with the checkbox widget?
from PyQt4 import QtCore, QtGui
app = QtGui.QApplication([])
panel=QtGui.QDialog()
panel.setLayout(QtGui.QVBoxLayout())
checkbox1 = QtGui.QCheckBox()
panel.layout().addWidget(checkbox1)
checkbox2 = QtGui.QCheckBox()
checkbox2.setMaximumSize(8, 8)
panel.layout().addWidget(checkbox2)
panel.show()
app.exec_()