Skip to content

Commit 64ed551

Browse files
committed
修正例子错误
1 parent 6c69759 commit 64ed551

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

QtRemoteObjects/simpleswitch/directconnectdynamicserver.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
from PyQt5.QtCore import (pyqtProperty, pyqtSignal, pyqtSlot, QCoreApplication,
5757
QObject, QTimer, QUrl)
58-
from PyQt5.QtRemoteObjects import QRemoteObjectHost, QRemoteObjectRegistryHost
58+
from PyQt5.QtRemoteObjects import QRemoteObjectHost
5959

6060

6161
class SimpleSwitch(QObject):
@@ -121,13 +121,8 @@ def _timeout(self):
121121
# Create the simple switch.
122122
srcSwitch = SimpleSwitch()
123123

124-
# Create the node that hosts the registry. This could be in a separate
125-
# process.
126-
regNode = QRemoteObjectRegistryHost(QUrl('local:registry'))
127-
128-
# Create the host object node. This will connect to the registry node
129-
# rather than to a client.
130-
srcNode = QRemoteObjectHost(QUrl('local:replica'), QUrl('local:registry'))
124+
# Create the host object node.
125+
srcNode = QRemoteObjectHost(QUrl('local:replica'))
131126

132127
# Enable remoting.
133128
srcNode.enableRemoting(srcSwitch, 'SimpleSwitch')

0 commit comments

Comments
 (0)