本文整理汇总了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