我在为pyqt5应用程序的任务栏管理器附加相同图标时遇到了麻烦,就像我为pyqt5应用程序的图标所做的那样。我已经附上了下面的代码以在pyqt5中显示图标,只需要一点帮助来编写用于在任务栏中显示应用程序相同图标的代码。
![enter image description here](https://istack.dev59.com/VRPxS.webp)
![enter image description here](https://istack.dev59.com/y0q02.webp)
import sys
from SplashScreen import *
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QColor, qGray, QImage, QPainter, QPalette,QIcon
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtWidgets import QApplication, QWidget
if __name__ == "__main__":
app = QApplication(sys.argv)
app.setWindowIcon(QIcon('./cricket.png'))
w = QWidget()
w.resize(300,300)
w.setWindowTitle('Quick Cricket')
w.show()
sys.exit(app.exec_())
提前感谢
import sys from SplashScreen import * from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QColor, qGray, QImage, QPainter, QPalette,QIcon from PyQt5.QtCore import Qt, QUrl from PyQt5.QtWidgets import QApplication, QWidget if __name__ == "__main__": app = QApplication(sys.argv) app.setWindowIcon(QIcon('./cricket.png')) w = QWidget() w.resize(300,300) w.setWindowTitle('Quick Cricket') w.show() sys.exit(app.exec_())
- Abdul Rehman