MCPcopy Create free account
hub / github.com/PyQt5/PyQt / __init__

Method __init__

QtRemoteObjects/SyncUi/WindowSlave.py:20–31  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

18class WindowSlave(QWidget):
19
20 def __init__(self, *args, **kwargs):
21 super(WindowSlave, self).__init__(*args, **kwargs)
22 self.setupUi()
23 # 加入Master节点
24 node = QRemoteObjectNode(parent=self)
25 node.connectToNode(QUrl('local:WindowMaster'))
26 # 获取WindowMaster对象
27 self.windowMaster = node.acquireDynamic('WindowMaster')
28 # 初始化成功后才能去绑定信号等
29 self.windowMaster.initialized.connect(self.onInitialized)
30 # 状态改变 https://doc.qt.io/qt-5/qremoteobjectreplica.html#State-enum
31 self.windowMaster.stateChanged.connect(self.onStateChanged)
32
33 def setupUi(self):
34 self.setWindowTitle('WindowSlave')

Callers

nothing calls this directly

Calls 1

setupUiMethod · 0.95

Tested by

no test coverage detected