I want to use add an Logo to the QWizardPage, however nothing is displayed. I'm using PySide6.
from PySide6.QtCore import Qt
from PySide6.QtWidgets import (QVBoxLayout, QApplication, QWizardPage, QWizard)
from PySide6.QtGui import (QIcon, QPixmap, QImage)
class Page1(QWizardPage):
def __init__(self, img, parent=None):
super().__init__(parent)
self.setTitle('General Properties')
self.setSubTitle('Enter general properties for this project.')
# Just for testing, include the same image - this is displayed!
layout = QVBoxLayout()
graphics = QLabel(self)
graphics.setPixmap(QPixmap(img))
layout.addWidget(graphics)
self.setLayout(layout)
class ProjectWizard(QWizard):
def __init__(self, parent=None):
super().__init__(parent)
img = './Icon_256.png'
self.addPage(Page1(img, self))
self.setWindowTitle("New Project")
# setPixmap(QWizard::WizardPixmap which, const QPixmap &pixmap)
self.setPixmap(QWizard.LogoPixmap, QPixmap.fromImage(QImage(img)))
The path to the image is valid and accessible (I've included the image in the dialog as well), however, no Image is displayed. Also a change of the which
parameter of setPixmap(which, pixmap)
does not help. I also did not find anything helpful in the documentation of the QWizardPage documentation page.
Thank you in advance!