use _parent attribute instead of parent
This commit is contained in:
@@ -27,7 +27,7 @@ class MessageWidget(QtWidgets.QWidget, Ui_Form):
|
|||||||
):
|
):
|
||||||
super(MessageWidget, self).__init__(parent)
|
super(MessageWidget, self).__init__(parent)
|
||||||
self.app = app
|
self.app = app
|
||||||
self.parent = parent
|
self._parent = parent
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setAutoFillBackground(True)
|
self.setAutoFillBackground(True)
|
||||||
self.message_item = message_item
|
self.message_item = message_item
|
||||||
@@ -108,11 +108,11 @@ class MessageWidget(QtWidgets.QWidget, Ui_Form):
|
|||||||
|
|
||||||
# Make sure the image fits within the listView
|
# Make sure the image fits within the listView
|
||||||
W = settings.value("MessageWidget/content_image/W_percentage", type=float) * (
|
W = settings.value("MessageWidget/content_image/W_percentage", type=float) * (
|
||||||
self.parent.width() - self.label_image.width()
|
self._parent.width() - self.label_image.width()
|
||||||
)
|
)
|
||||||
H = (
|
H = (
|
||||||
settings.value("MessageWidget/content_image/H_percentage", type=float)
|
settings.value("MessageWidget/content_image/H_percentage", type=float)
|
||||||
* self.parent.height()
|
* self._parent.height()
|
||||||
)
|
)
|
||||||
|
|
||||||
if pixmap.width() > W or pixmap.height() > H:
|
if pixmap.width() > W or pixmap.height() > H:
|
||||||
|
|||||||
Reference in New Issue
Block a user