From 64ed5517a93e97ce45f8fcdf05f5363d208e52fb Mon Sep 17 00:00:00 2001 From: Irony <892768447@qq.com> Date: Thu, 8 Aug 2019 00:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BE=8B=E5=AD=90=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simpleswitch/directconnectdynamicserver.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/QtRemoteObjects/simpleswitch/directconnectdynamicserver.py b/QtRemoteObjects/simpleswitch/directconnectdynamicserver.py index acdd242..ca2d263 100644 --- a/QtRemoteObjects/simpleswitch/directconnectdynamicserver.py +++ b/QtRemoteObjects/simpleswitch/directconnectdynamicserver.py @@ -55,7 +55,7 @@ import sys from PyQt5.QtCore import (pyqtProperty, pyqtSignal, pyqtSlot, QCoreApplication, QObject, QTimer, QUrl) -from PyQt5.QtRemoteObjects import QRemoteObjectHost, QRemoteObjectRegistryHost +from PyQt5.QtRemoteObjects import QRemoteObjectHost class SimpleSwitch(QObject): @@ -121,13 +121,8 @@ if __name__ == '__main__': # Create the simple switch. srcSwitch = SimpleSwitch() - # Create the node that hosts the registry. This could be in a separate - # process. - regNode = QRemoteObjectRegistryHost(QUrl('local:registry')) - - # Create the host object node. This will connect to the registry node - # rather than to a client. - srcNode = QRemoteObjectHost(QUrl('local:replica'), QUrl('local:registry')) + # Create the host object node. + srcNode = QRemoteObjectHost(QUrl('local:replica')) # Enable remoting. srcNode.enableRemoting(srcSwitch, 'SimpleSwitch')