Commit 66bf7547 authored by Dan Pascu's avatar Dan Pascu

Avoid unnecessary use of getattr

parent 2bd85313
......@@ -2456,12 +2456,12 @@ class ChatSessionIconLabel(QLabel):
def __init__(self, parent=None):
super(ChatSessionIconLabel, self).__init__(parent)
self.pixmaps = PixmapContainer()
self.icon = None
self.icon_size = 12
self.selectedCompositionColor = Qt.transparent
self.icon = None
def event(self, event):
if event.type() == QEvent.DynamicPropertyChange and event.propertyName() in ('icon', 'selectedCompositionColor') and getattr(self, 'icon', None) is not None:
if event.type() == QEvent.DynamicPropertyChange and event.propertyName() in ('icon', 'selectedCompositionColor') and self.icon is not None:
self.pixmaps.standard = self.icon.pixmap(self.icon_size)
self.pixmaps.selected = QPixmap(self.pixmaps.standard)
painter = QPainter(self.pixmaps.selected)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment