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

I am creating a window with PyQt6 for which I set an icon.It shows on the top left of the window and t

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745557561a4632910.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信