title: PyQT5 qsytemtrayicon
body: <p>I have problem with qsystemtray. When I run code this code without "while", I can watch the icon. With while I can't watch icon (I checked that the program enters the condition "if (a.inbox.unread_count)> 0"), but region where icon must be not available.That is, the tray icon appears, but is not drawn. Are there any methods to solve this problem? OS: Astra-linux(fork debian)</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  # Form implementation generated from reading ui file 'qttray.ui'
  #
  # Created by: PyQt5 UI code generator 5.10.1
  #
  # WARNING! All changes made in this file will be lost!
  
  from PyQt5 import QtCore, QtGui, QtWidgets
  import extest4
  import time
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(1014, 680)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setMaximumSize(QtCore.QSize(800, 547))
          self.centralwidget.setObjectName("centralwidget")
          self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget)
          self.horizontalLayout_2.setObjectName("horizontalLayout_2")
          self.horizontalLayout = QtWidgets.QHBoxLayout()
          self.horizontalLayout.setObjectName("horizontalLayout")
          self.horizontalLayout_2.addLayout(self.horizontalLayout)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 1014, 30))
          self.menubar.setObjectName("menubar")
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
  
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      email = 'testemail'
      server = '********'
      tr = QtWidgets.QSystemTrayIcon(QtGui.QIcon(r'payments.PNG'), app)
      print(tr.isSystemTrayAvailable())
      while(1):
          a = extest4.connect(server, email)
          if(a.inbox.unread_count)&gt;0:
              a.inbox.refresh()
              tr.setVisible(True)
              tr.show()
          else:
              tr.hide()
          extest4.close_connections()
          time.sleep(10)
      sys.exit(app.exec_())
  </code></pre>