本文整理汇总了Python中AnyQt.QtCore.QCoreApplication.postEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QCoreApplication.postEvent方法的具体用法?Python QCoreApplication.postEvent怎么用?Python QCoreApplication.postEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtCore.QCoreApplication
的用法示例。
在下文中一共展示了QCoreApplication.postEvent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mousePressEvent
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def mousePressEvent(self, event):
anchor_item = self.scene.item_at(event.scenePos(),
items.NodeAnchorItem,
buttons=Qt.LeftButton)
if anchor_item and event.button() == Qt.LeftButton:
# Start a new link starting at item
self.from_item = anchor_item.parentNodeItem()
if isinstance(anchor_item, items.SourceAnchorItem):
self.direction = NewLinkAction.FROM_SOURCE
self.source_item = self.from_item
else:
self.direction = NewLinkAction.FROM_SINK
self.sink_item = self.from_item
event.accept()
helpevent = QuickHelpTipEvent(
self.tr("Create a new link"),
self.tr('<h3>Create new link</h3>'
'<p>Drag a link to an existing node or release on '
'an empty spot to create a new node.</p>'
'<p>Hold Shift when releasing the mouse button to '
'edit connections.</p>'
# '<a href="help://orange-canvas/create-new-links">'
# 'More ...</a>'
)
)
QCoreApplication.postEvent(self.document, helpevent)
return True
else:
# Whoever put us in charge did not know what he was doing.
self.cancel(self.ErrorReason)
return False
示例2: end
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def end(self):
self.cleanup()
# Remove the help tip set in mousePressEvent
self.macro = None
helpevent = QuickHelpTipEvent("", "")
QCoreApplication.postEvent(self.document, helpevent)
UserInteraction.end(self)
示例3: _stateChanged
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def _stateChanged(self, future, state):
"""
The `future` state has changed (called by :class:`Future`).
"""
ev = StateChangedEvent(state)
if self.thread() is QThread.currentThread():
QCoreApplication.sendEvent(self, ev)
else:
QCoreApplication.postEvent(self, ev)
示例4: start
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def start(self):
self.document.view().setCursor(Qt.CrossCursor)
helpevent = QuickHelpTipEvent(
self.tr("Click and drag to create a new arrow"),
self.tr('<h3>New arrow annotation</h3>'
'<p>Click and drag to create a new arrow annotation.</p>'
# '<a href="help://orange-canvas/arrow-annotations>'
# 'More ...</a>'
)
)
QCoreApplication.postEvent(self.document, helpevent)
UserInteraction.start(self)
示例5: on_done
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def on_done(f):
assert f is future
selfref = selfweakref()
if selfref is None:
return
try:
QCoreApplication.postEvent(
selfref, QEvent(FutureWatcher.__FutureDone))
except RuntimeError:
# Ignore RuntimeErrors (when C++ side of QObject is deleted)
# (? Use QObject.destroyed and remove the done callback ?)
pass
示例6: start
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def start(self):
QCoreApplication.postEvent(self, QEvent(Task.__ExecuteCall))
示例7: start
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def start(self):
QCoreApplication.postEvent(self, ExecuteCallEvent())
示例8: __on_anchorClicked
# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
def __on_anchorClicked(self, anchor):
ev = QuickHelpDetailRequestEvent(anchor.toString(), anchor)
QCoreApplication.postEvent(self, ev)