本文整理汇总了Python中Qt.QtCore.Signal方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.Signal方法的具体用法?Python QtCore.Signal怎么用?Python QtCore.Signal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Qt.QtCore
的用法示例。
在下文中一共展示了QtCore.Signal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: evaluateGraph
# 需要导入模块: from Qt import QtCore [as 别名]
# 或者: from Qt.QtCore import Signal [as 别名]
def evaluateGraph(self):
"""
Create a list of connection tuples.
[("sourceNode.attribute", "TargetNode.attribute"), ...]
"""
scene = self.scene()
data = list()
for item in scene.items():
if isinstance(item, ConnectionItem):
connection = item
data.append(connection._outputConnectionData())
# Emit Signal
self.signal_GraphEvaluated.emit()
return data
示例2: onClick
# 需要导入模块: from Qt import QtCore [as 别名]
# 或者: from Qt.QtCore import Signal [as 别名]
def onClick(self, *args):
""" Signal to open the selected file in the current tab.
"""
self.openFile.emit(QtCore.QUrl(self.path))
示例3: dropable
# 需要导入模块: from Qt import QtCore [as 别名]
# 或者: from Qt.QtCore import Signal [as 别名]
def dropable(widget):
class Filter(QtCore.QObject):
drop_in = QtCore.Signal(list)
def eventFilter(self, obj, event):
if obj == widget:
if event.type() in [QtCore.QEvent.DragEnter, QtCore.QEvent.DragMove]:
if event.mimeData().hasUrls():
event.acceptProposedAction()
return True
else:
event.ignore()
return False
if event.type() == QtCore.QEvent.Drop:
in_paths = []
for url in event.mimeData().urls():
path = url.toLocalFile()
in_paths.append(path)
self.drop_in.emit(in_paths)
return True
return False
if hasattr(widget, "setAcceptDrops"):
widget.setAcceptDrops(True)
obj = Filter(widget)
widget.installEventFilter(obj)
return obj.drop_in