以下代码:
from PySide6.QtWidgets import (QApplication,QSystemTrayIcon,QMenu)
from PySide6.QtGui import QAction
app = QApplication([])
app.setQuitOnLastWindowClosed(False)
#Create Tray
tray = QSystemTrayIcon()
tray.setVisible(True)
# Create the menu
menu = QMenu()
# Add a Quit option to the menu.
actionQuit = QAction("Quit")
actionQuit.triggered.connect(app.quit)
menu.addAction(actionQuit)
# Add the menu to the tray
tray.setContextMenu(menu)
app.exec()
以下Pyinstaller命令:
pyinstaller --windowed --onefile './Dev-Menu-Test.py'
停靠图标将启动。然后短暂消失,大约8-10秒后返回。这是预期的行为吗
目前没有回答
相关问题 更多 >
编程相关推荐