So setzen Sie das Anwendungssymbol in PYQT5 auf macOSPython

Python-Programme
Guest
 So setzen Sie das Anwendungssymbol in PYQT5 auf macOS

Post by Guest »

Ich erstelle eine App in Python mit Pyqt5 auf einem MacOS-Computer. -Override ">

Code: Select all

from PyQt5.QtWidgets import QApplication, QWidget, QLabel

app = QApplication([])

window = QWidget()
window.setWindowTitle('Alarm App')

label = QLabel('Alarm App', window)

label.move(100, 50)
window.show()

app.exec_()
< /code>
Wenn ich die App ausführe, wird das Fenster angezeigt und und ich kann das Symbol auf dem Dock sehen,
Das Symbol ist das Python -Launcher -Symbol, das nicht Icon ist, das ich möchte, in der Verzeichnis des Projekts Ich habe ein Symbol. >window.setWindowIcon(QIcon("icon.png"))
Aber das Symbol sieht immer noch so aus:

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post