Calculadora: criando um botão com QPushButton no PySide6
This commit is contained in:
15
aula202-calculadora/buttons.py
Normal file
15
aula202-calculadora/buttons.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from PySide6.QtWidgets import QPushButton
|
||||
from variables import MEDIUM_FONT_SIZE
|
||||
|
||||
|
||||
class Button(QPushButton):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.configStyle()
|
||||
|
||||
def configStyle(self):
|
||||
font = self.font()
|
||||
font.setPixelSize(MEDIUM_FONT_SIZE)
|
||||
self.setFont(font)
|
||||
self.setMinimumSize(75, 75)
|
||||
self.setProperty('cssClass', 'specialButton')
|
||||
Reference in New Issue
Block a user