Trying to get an image to display, but it just shows a blank screen, the path to the image is also correct because when I hover over the directory, it shows a preview of the image.
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (
QLabel,
QVBoxLayout,
QMainWindow, QApplication, QStackedWidget,
)
class LoadingScreen(QMainWindow):
def __init__(self):
super().__init__()
self.image_lbl = QLabel()
self.load_image()
lay = QVBoxLayout(self)
lay.addWidget(self.image_lbl)
def load_image(self):
pixmap = QPixmap("../images/Loading.gif")
self.image_lbl.setPixmap(QPixmap(pixmap))
if __name__ == '__main__':
# main()
app = QApplication(sys.argv)
window = LoadingScreen()
widget = QStackedWidget()
widget.addWidget(window)
widget.setFixedSize(450, 480)
widget.show()
app.exec_()