本文整理汇总了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())
示例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
示例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)