Remove everything, just leave self.setFont(QFont(...))
as it is, inside __init__
. This worked for me. The problem with your code is that, you used single leading and trailing underscores for init
method. Put double underscores, def __init__(self, parent=None))
.
class StandardComboBox(QComboBox):
def __init__(self, parent = None):
super(StandardComboBox, self).__init__(parent)
self.setFont(QFont('Courier New', 30))
This code is enough to change the font of comboBox.