def eventFilter(self, obj, event): if event.type() == QtCore.QEvent.MouseButtonPress: self.close() return True elif isinstance(event, QtGui.QHoverEvent): if self.bgcolor != obj.bgcolor: self.bgcolor = obj.bgcolor windowsoptions['frameqss'] = makeFrameQss(obj.bgcolor) views['MainWindow'].setskin() return False else: return super(ColorPopupFrame, self).eventFilter(obj, event)
def updateBg(self, color): self.bgcolor = 'rgb(%s, %s, %s)' % (color.red(), color.green(), color.blue()) windowsoptions['frameqss'] = makeFrameQss(self.bgcolor) views['MainWindow'].setskin()