本文整理汇总了Python中MT.attachToSignal方法的典型用法代码示例。如果您正苦于以下问题:Python MT.attachToSignal方法的具体用法?Python MT.attachToSignal怎么用?Python MT.attachToSignal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MT
的用法示例。
在下文中一共展示了MT.attachToSignal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import MT [as 别名]
# 或者: from MT import attachToSignal [as 别名]
def __init__(self, parent=None):
self.start = 0
self.end = 100
self.frame = 1
self.isPlaying = False
self.visibleStart = self.start
self.visibleEnd = self.end
QWidget.__init__(self)
self.setLayout(QVBoxLayout())
self.layout().setSpacing(0)
self.layout().setMargin(0)
self.scrubwidget = TimelineScrubWidget(self)
self.layout().addWidget(self.scrubwidget)
start = QSpinBox()
start.setRange(0, 99999999)
end = QSpinBox()
end.setRange(0, 99999999)
visiblestart = QSpinBox()
visiblestart.setRange(0, 99999999)
visibleend = QSpinBox()
visibleend.setRange(0, 99999999)
self.frameBox = QSpinBox()
self.frameBox.valueChanged.connect(self.setFrame)
self.frameBox.setRange(self.start, self.end)
self.playbutton = QPushButton("Play")
self.playbutton.clicked.connect(self.play)
stop = QPushButton("stop")
stop.clicked.connect(self.stop)
start.setValue(self.start)
end.setValue(self.end)
self.frameBox.setValue(self.frame)
visiblestart.setValue(self.visibleStart)
visibleend.setValue(self.visibleEnd)
lay = QHBoxLayout()
self.layout().addLayout(lay)
lay.addWidget(start)
lay.addWidget(visiblestart)
lay.addStretch()
lay.addWidget(self.playbutton)
lay.addWidget(stop)
lay.addWidget(self.frameBox)
lay.addStretch()
lay.addWidget(visibleend)
lay.addWidget(end)
self.cb = MT.attachToSignal("frameChanged", self.setFrame)
示例2: __init__
# 需要导入模块: import MT [as 别名]
# 或者: from MT import attachToSignal [as 别名]
def __init__(self, node = None, parent=None):
QWidget.__init__(self, parent)
self.tree = QTreeView()
self.model = QStandardItemModel(0, 2, parent);
self.tree.setModel(self.model)
self.model.setHorizontalHeaderLabels(["Name", "Value"])
self.tree.setItemDelegate(Delegate(self))
lay = QVBoxLayout()
lay.setContentsMargins(0, 0, 0, 0)
lay.setSpacing(0)
self.setLayout(lay)
lay.addWidget(self.tree)
self.customWidget = None
self.node = None
if node is None:
self.cb = MT.attachToSignal("selectionChanged", self.updateEditor)
self.cb2 = MT.attachToSignal("linkChanged", self.updateEditorLinks)
self.tree.expanded.connect(self.connect)
self.tree.collapsed.connect(self.disconnect)
else:
self.updateEditor(node)