def set_up_button(self, style, str_icon_on, str_icon_off, auto_repeat,
size, receiver, key, str_key):
self.__size = size
self.__style = style
self.__icon_on = str_icon_on
self.__icon_off = str_icon_off
self.__auto_repeat = auto_repeat
self.__receiver = receiver
self.__key = key
self.__str_key = str_key
if str_key not in ['KB', 'A?', '?', '?', 'backspace']:
self.setText(str_key)
self.setFixedSize(size[0], size[1])
self.setStyleSheet(style)
self.setIconSize(QSize(size[0], size[1]))
self.setIcon(QIcon(self.__path + str_icon_off + ".png"))
self.setAutoRepeat(auto_repeat)
# pix_map = QPixmap(self.__path + str_icon_off + ".png")
# self.setMask(pix_map.mask())
self.pressed.connect(self.key_pressed)
self.released.connect(self.key_released)
评论列表
文章目录