本文整理汇总了Python中PySide.QtCore.QCoreApplication.quit方法的典型用法代码示例。如果您正苦于以下问题:Python QCoreApplication.quit方法的具体用法?Python QCoreApplication.quit怎么用?Python QCoreApplication.quit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.QCoreApplication
的用法示例。
在下文中一共展示了QCoreApplication.quit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: accept
# 需要导入模块: from PySide.QtCore import QCoreApplication [as 别名]
# 或者: from PySide.QtCore.QCoreApplication import quit [as 别名]
def accept(self):
if self.userEdit.text() == "" or self.passwordEdit.text() == "":
if self.userEdit.text() == "":
self.userEdit.setFocus()
else:
self.passwordEdit.setFocus()
# meldung ausgeben, dass das doof ist so
err = QMessageBox()
err.setWindowTitle(_("Please provide credentials"))
err.setText(_("You need to enter a user name and a password!"))
err.setIcon(QMessageBox.Critical)
err.setModal(True)
err.exec_()
else:
QCoreApplication.quit()
示例2: HttpSignalsCase
# 需要导入模块: from PySide.QtCore import QCoreApplication [as 别名]
# 或者: from PySide.QtCore.QCoreApplication import quit [as 别名]
class HttpSignalsCase(unittest.TestCase):
'''Test case for bug #124 - readDatagram signature
QUdpSocket.readDatagram must return a tuple with the datagram, host and
port, while receiving only the max payload size.'''
def setUp(self):
#Acquire resources
self.called = False
self.app = QCoreApplication([])
self.socket = QUdpSocket()
self.server = QUdpSocket()
self.server.bind(QHostAddress(QHostAddress.LocalHost), 45454)
def tearDown(self):
#Release resources
del self.socket
del self.server
del self.app
def sendPackage(self):
addr = QHostAddress(QHostAddress.LocalHost)
self.socket.writeDatagram('datagram', addr, 45454)
def callback(self):
while self.server.hasPendingDatagrams():
datagram, host, port = self.server.readDatagram(self.server.pendingDatagramSize())
self.called = True
self.app.quit()
def testDefaultArgs(self):
#QUdpSocket.readDatagram pythonic return
# @bug 124
QObject.connect(self.server, SIGNAL('readyRead()'), self.callback)
self.sendPackage()
self.app.exec_()
self.assert_(self.called)
示例3: _closeApplication
# 需要导入模块: from PySide.QtCore import QCoreApplication [as 别名]
# 或者: from PySide.QtCore.QCoreApplication import quit [as 别名]
def _closeApplication():
"""
Close the application. Save all needed information.
"""
logging.debug('Application is shut down')
QCoreApplication.quit()
示例4: close
# 需要导入模块: from PySide.QtCore import QCoreApplication [as 别名]
# 或者: from PySide.QtCore.QCoreApplication import quit [as 别名]
def close(self):
if not self.closeCheck():
return
from PySide.QtCore import QCoreApplication
QCoreApplication.quit()