当前位置: 首页>>代码示例>>Python>>正文


Python QCoreApplication.quit方法代码示例

本文整理汇总了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()
开发者ID:gonicus,项目名称:clacks,代码行数:19,代码来源:qt_gui.py

示例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)
开发者ID:Hasimir,项目名称:PySide,代码行数:42,代码来源:udpsocket_test.py

示例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()
开发者ID:vamonster,项目名称:pomidorka,代码行数:8,代码来源:gui.py

示例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()
开发者ID:lcolman,项目名称:Litey,代码行数:7,代码来源:main.py


注:本文中的PySide.QtCore.QCoreApplication.quit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。