So setzen Sie das Anwendungssymbol in PYQT5 auf macOS

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: So setzen Sie das Anwendungssymbol in PYQT5 auf macOS

by Guest » 07 Feb 2025, 04:09

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:

Top