Skip to content

Commit

Permalink
修正例子错误
Browse files Browse the repository at this point in the history
  • Loading branch information
892768447 committed Aug 7, 2019
1 parent 6c69759 commit 64ed551
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions QtRemoteObjects/simpleswitch/directconnectdynamicserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

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):
Expand Down Expand Up @@ -121,13 +121,8 @@ def _timeout(self):
# 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')
Expand Down

0 comments on commit 64ed551

Please sign in to comment.