Does not graph the image with QPixmap()

31 Views Asked by At

Good morning colleagues,

I am developing a small project in Python, as a free practice using the PyQt6 framework, and I want to show an image with the QPixmap library using a QLabel and I enter this in a vertical Layout, but when I run the program it does not graph the image and It doesn't give me any errors either

def generate_reproductor_tab(self):
    main_V_box = QVBoxLayout()
    button_h_box = QHBoxLayout()
    buttons_cointainer = QWidget()
    
    **song_image = QLabel()
    pixmap = QPixmap("PYQT6\Reproductor\images\song_image.png")
    song_image.setPixmap(pixmap)
    song_image.setScaledContents(True)**
    
    button_repeat = QPushButton("Repeat")
    button_before = QPushButton("Before")
    button_play = QPushButton("Play")
    button_next = QPushButton("next")
    button_random = QPushButton("Random")
    
    button_h_box.addWidget(button_repeat)
    button_h_box.addWidget(button_before)
    button_h_box.addWidget(button_play)
    button_h_box.addWidget(button_next)
    button_h_box.addWidget(button_random)
    
    buttons_cointainer.setLayout(button_h_box)
    main_V_box.addWidget(song_image)
    main_V_box.addWidget(buttons_cointainer)
    self.reproductor_cointainer.setLayout(main_V_box)
0

There are 0 best solutions below