I wrote a program that create a tray. I want to hide it with below code,but it not work(tray icon is visible). how solve this problem?
from PyQt5 import QtGui, QtWidgets
if __name__ == '__main__':
app = QtWidgets.QApplication([])
sysTray =QtWidgets.QSystemTrayIcon()
sysTray.setIcon(QtGui.QIcon('1.jpg'))
sysTray.hide()
app.exec_()
Just add sysTray.show()
before sysTray.hide()