Esempio n. 1
0
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
## $QT_END_LICENSE$
#############################################################################

import sys

from PyQt5.QtCore import QLoggingCategory, QUrl
from PyQt5.QtRemoteObjects import QRemoteObjectNode
from PyQt5.QtWidgets import QApplication, QTreeView

QLoggingCategory.setFilterRules("qt.remoteobjects.debug=false\n"
                                "qt.remoteobjects.warning=false\n"
                                "qt.remoteobjects.models.debug=false\n"
                                "qt.remoteobjects.models.debug=false")

app = QApplication(sys.argv)

node = QRemoteObjectNode(QUrl("local:registry"))
node.setHeartbeatInterval(1000)

view = QTreeView()
view.setWindowTitle("RemoteView")
view.resize(640, 480)

model = node.acquireModel("RemoteModel")
view.setModel(model)
view.show()

sys.exit(app.exec_())
Esempio n. 2
0
    from PyQt5.QtCore import QLoggingCategory, QUrl
    from PyQt5.QtRemoteObjects import QRemoteObjectNode
    from PyQt5.QtWidgets import QApplication, QTreeView
except ImportError:
    from PySide2.QtCore import QUrl
    from PySide2.QtRemoteObjects import QRemoteObjectNode
    from PySide2.QtWidgets import QApplication, QTreeView

try:
    QLoggingCategory.setFilterRules('qt.remoteobjects.debug=false\n'
                                    'qt.remoteobjects.warning=false\n'
                                    'qt.remoteobjects.models.debug=false\n'
                                    'qt.remoteobjects.models.debug=false')
except NameError:
    pass

app = QApplication(sys.argv)

node = QRemoteObjectNode(QUrl('local:registry'))
node.setHeartbeatInterval(1000)

view = QTreeView()
view.setWindowTitle("RemoteView")
view.resize(640, 480)

model = node.acquireModel('RemoteModel')
view.setModel(model)
view.show()

sys.exit(app.exec_())