最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pyqt6 - Python window is not showing the task bar icon on all screens (only on the main one) - Stack Overflow

programmeradmin2浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论