當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。