Hello

Question about PyQT program shutdown.

Example code is almost as desired.  When I run the code in IDE (Eric5) 
everything is OK. Program start and close after ten seconds. When pressing the 
button the program shuts down immediately.
In Windows Task Manager Applications tab I can see when  the program start-up 
and closing. In Windows Task Manager Processes tab, they are not visible.

If I make XXXclose.exe using  CXfreeze program (cxfreeze  XXXclose.exe.pyw - 
base-name = Win32GUI - target-dir Package)

and starting its

Task Manager Application tab displays the program start-up and closing. In 
addition to Processes tab shows the start of the program, but the process does 
not turn off when the program goes out. Zombie process?
When re-started, the second process start

I mean how the code should be corrected so the (Task Manager) process start, 
waiting a while and then end.

best regards Kaarme42

Python3.2.2


from PyQt4 import QtGui
from PyQt4.QtGui import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtTest import QTest
import sys

class GuiPart(QDialog):    
    def __init__(self, parent=None):     
        super(GuiPart, self).__init__(parent)   
        self.shutButton = QPushButton("Close")
        self.connect(self.shutButton, SIGNAL("clicked()"), self.buttonClose)
      
        self.grid = QGridLayout()
        self.grid.addWidget(self.shutButton, 1,  0 )
        self.setLayout(self.grid) 
        self.setWindowTitle("XXX close")
        
    def buttonClose(self):
        self.close()
        sys.exit(root.exec_())
        
    def testFunction(self):
        QTest.qWait(10000)
        self.close()
        sys.exit(root.exec_())
        
       
# -------------------------------------------------------------------------
root = QtGui.QApplication(sys.argv)
client = GuiPart(None)
client.show()

client.testFunction()
client.close()
sys.exit(root.exec_())
                                          
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to