当前位置: 首页>>代码示例>>Python>>正文


Python QCoreApplication.postEvent方法代码示例

本文整理汇总了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
开发者ID:RachitKansal,项目名称:orange3,代码行数:36,代码来源:interactions.py

示例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)
开发者ID:RachitKansal,项目名称:orange3,代码行数:9,代码来源:interactions.py

示例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)
开发者ID:RachitKansal,项目名称:orange3,代码行数:12,代码来源:concurrent.py

示例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)
开发者ID:RachitKansal,项目名称:orange3,代码行数:16,代码来源:interactions.py

示例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
开发者ID:astaric,项目名称:orange3,代码行数:16,代码来源:concurrent.py

示例6: start

# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
 def start(self):
     QCoreApplication.postEvent(self, QEvent(Task.__ExecuteCall))
开发者ID:astaric,项目名称:orange3,代码行数:4,代码来源:concurrent.py

示例7: start

# 需要导入模块: from AnyQt.QtCore import QCoreApplication [as 别名]
# 或者: from AnyQt.QtCore.QCoreApplication import postEvent [as 别名]
 def start(self):
     QCoreApplication.postEvent(self, ExecuteCallEvent())
开发者ID:RachitKansal,项目名称:orange3,代码行数:4,代码来源:concurrent.py

示例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)
开发者ID:PrimozGodec,项目名称:orange3,代码行数:5,代码来源:quickhelp.py


注:本文中的AnyQt.QtCore.QCoreApplication.postEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。