本文整理匯總了Python中PyQt4.QtGui.QCursor方法的典型用法代碼示例。如果您正苦於以下問題:Python QtGui.QCursor方法的具體用法?Python QtGui.QCursor怎麽用?Python QtGui.QCursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui
的用法示例。
在下文中一共展示了QtGui.QCursor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setupUi
# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QCursor [as 別名]
def setupUi(self):
self.connectLayout = QHBoxLayout(self)
self.connectLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
self.avatarLB = QLabel(self)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.avatarLB.sizePolicy().hasHeightForWidth())
self.avatarLB.setSizePolicy(sizePolicy)
self.avatarLB.setFixedSize(24, 24)
self.avatarLB.hide()
self.nameLB = QLabel(self)
self.nameLB.setFocusPolicy(Qt.ClickFocus)
self.nameLB.setTextFormat(Qt.RichText)
self.nameLB.setText("<html><head/><body><p><span style=\"text-decoration: underline; color:#00557f;\">Add Connection</span></p></body></html>")
self.setCursor(QCursor(Qt.PointingHandCursor))
self.connectLayout.addWidget(self.avatarLB)
self.connectLayout.addWidget(self.nameLB)
示例2: doHeavyLifting
# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QCursor [as 別名]
def doHeavyLifting(self):
"""
UI callback, starts the thread with the proper arguments.
"""
if self.thread: # Sanity check.
return
self.singleProgress.setValue(1)
self.progressDialog.show();
self.mytimer.start(1000);
QtGui.QApplication.setOverrideCursor(
QtGui.QCursor(QtCore.Qt.WaitCursor))
self.thread = WorkThread(target=self.display_result)
QtCore.QObject.connect(self.thread, QtCore.SIGNAL("mainThread"),
self.mainThread)
QtCore.QObject.connect(self.thread, QtCore.SIGNAL("finished()"), self.threadDone)
self.thread.start()
示例3: keyPressEvent
# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QCursor [as 別名]
def keyPressEvent(self,e):
# Ctrl key changes mouse cursor
if e.key() == QtCore.Qt.Key_Control:
QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
# Backspace deletes last point from polygon
elif e.key() == QtCore.Qt.Key_Backspace:
if not self.drawPolyClosed:
del self.drawPoly[-1]
self.update()
# set alpha to temporary zero
elif e.key() == QtCore.Qt.Key_0:
self.transpTempZero = True
self.update()
elif e.key() == QtCore.Qt.Key_E:
self.select_next_correction()
elif e.key() == QtCore.Qt.Key_R:
self.select_previous_correction()
elif e.key() == QtCore.Qt.Key_1:
self.modify_correction_type(CorrectionBox.types.TO_CORRECT)
elif e.key() == QtCore.Qt.Key_2:
self.modify_correction_type(CorrectionBox.types.TO_REVIEW)
elif e.key() == QtCore.Qt.Key_3:
self.modify_correction_type(CorrectionBox.types.RESOLVED)
elif e.key() == QtCore.Qt.Key_4:
self.modify_correction_type(CorrectionBox.types.QUESTION)
elif e.key() == QtCore.Qt.Key_D and self.config.correctionMode:
self.delete_selected_annotation()
elif e.key() == QtCore.Qt.Key_M and self.config.correctionMode:
self.modify_correction_description()
# Key released
示例4: enterEvent
# 需要導入模塊: from PyQt4 import QtGui [as 別名]
# 或者: from PyQt4.QtGui import QCursor [as 別名]
def enterEvent(self, event):
QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
return super(HoverButton, self).enterEvent(event)
# @Override