I am creating a window with PyQt6 for which I set an icon.
It shows on the top left of the window and the task bar for the main window, but not on my second and third screen.
It works the same when I execute my script as well as running it from the exe. I convert the script to.
This is the code I use to set the icon:
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi(os.path.join(os.path.dirname(__file__), "DesignMainWindow.ui"), self)
self.setWindowTitle("My title")
icon_path = os.path.join(os.path.dirname(__file__), "icon.png")
self.setWindowIcon(QtGui.QIcon(icon_path))
Python 3.9.7 PyQt6==6.7.1 # Versions