I have an label that displays an image, however the image is cut off since its size is bigger than the label, I have tried self.logo_buttons.SetScaledContents(True)
but this only resizes my image to fit in the label.
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class GUI(QMainWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.initUI()
def initUI(self):
self.logo_button = QtWidgets.QLabel(self)
self.logo_button.setPixmap(QtGui.QPixmap('image.png'))
self.logo_button.setScaledContents(True)
def window():
app = QApplication(sys.argv)
root = GUI()
root.show()
sys.exit(app.exec_())
window()