本文整理匯總了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)