當前位置: 首頁>>代碼示例>>Python>>正文


Python MT.attachToSignal方法代碼示例

本文整理匯總了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)
開發者ID:viviwu,項目名稱:MindTree,代碼行數:52,代碼來源:timelinewidget.py

示例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)
開發者ID:frigge,項目名稱:MindTree,代碼行數:26,代碼來源:editor.py


注:本文中的MT.attachToSignal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。