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


Python QtCore.Qt方法代码示例

本文整理汇总了Python中PyQt4.QtCore.Qt方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.Qt方法的具体用法?Python QtCore.Qt怎么用?Python QtCore.Qt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtCore的用法示例。


在下文中一共展示了QtCore.Qt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: save

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import Qt [as 别名]
def save(self):

        # Only open dialog if there is no filename yet
        if not self.filename:
          self.filename = QtGui.QFileDialog.getSaveFileName(self, 'Save File')

        # Append extension if not there yet
        if not self.filename.endswith(".writer"):
          self.filename += ".writer"

        # We just store the contents of the text file along with the
        # format in html, which Qt does in a very nice way for us
        with open(self.filename,"wt") as file:
            file.write(self.text.toHtml()) 
开发者ID:goldsborough,项目名称:Writer-Tutorial,代码行数:16,代码来源:part-1.py

示例2: _toNativeValue

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import Qt [as 别名]
def _toNativeValue(self, pyValue):
		"""
			\remarks	[virtual] 	converts the inputed value from Qt/Python to whatever value is required for the native application
			\param		pyValue	<variant>
			\return		<variant>
		"""
		from PyQt4.QtCore import QString

		# we should not pass back QString value's to an application, as they will not expect it.  Standard python strings/unicodes will be auto-converted
		if (type(pyValue) == QString):
			return unicode(pyValue)

		# by default, we assume that any other type can be naturally processed
		return pyValue 
开发者ID:blurstudio,项目名称:cross3d,代码行数:16,代码来源:abstractscene.py

示例3: emitSubmitError

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import Qt [as 别名]
def emitSubmitError(self, error, progressSection='Submitting Job'):
		"""
			\remarks	emits the submit success signal if the signals are not blocked and cleans the submit process
			\param		error				<str>	resulting error feedback
			\param		progressSection		<str>	the name of the progress section to be updated using emitProgressUpdated
		"""
		from PyQt4.QtCore import Qt
		from PyQt4.QtGui import QApplication

		QApplication.instance().restoreOverrideCursor()

		if (not self.signalsBlocked()):
			self.progressErrored.emit(progressSection, error)
			self.submitError.emit(error) 
开发者ID:blurstudio,项目名称:cross3d,代码行数:16,代码来源:abstractscene.py


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