def __init__(self, parent=None): """ Arguments: parent -- Qt widget that is parent to this widget. """ super(MSS_AboutDialog, self).__init__(parent) self.setupUi(self) self.lblVersion.setText("Version: {}".format(__version__)) blub = QtGui.QPixmap(python_powered()) self.lblPython.setPixmap(blub)
def setup_image_message_box(self): MAX_WIDTH = MAX_HEIGHT = 300 self.messageBox = QtWidgets.QLabel() img_url = url_join(self.chat_window.mscolab_server_url, self.attachment_path) data = requests.get(img_url).content image = QtGui.QImage() image.loadFromData(data) self.message_image = image width, height = image.size().width(), image.size().height() if width > height and width > MAX_WIDTH: image = image.scaledToWidth(MAX_WIDTH) elif height > width and height > MAX_HEIGHT: image = image.scaledToHeight(MAX_HEIGHT) self.messageBox.setPixmap(QtGui.QPixmap(image)) self.messageBox.setContentsMargins(0, 5, 0, 5) self.messageBox.show()