- Qt 6.10
- Qt Remote Objects
- QML Types
- Host
- Qt 6.10.2 Reference Documentation

# Host QML Type

A host node on a Qt Remote Objects network. More...

Import Statement: | `import QtRemoteObjects 6.10`
In C++: | QRemoteObjectHost

- List of all members, including inherited members

## Properties

- hostUrl : url

## Methods

- bool disableRemoting(object remoteObject)
- bool enableRemoting(object object, string name)

## Detailed Description

The Host type provides an entry point to a Qt Remote Objects network. A network can be as simple as two nodes, or an arbitrarily complex set of processes and devices.

Hosts have the same capabilities as Nodes, but they can also be connected to and can share source objects on the network.

## Property Documentation

hostUrl : url

The host address for the node.

This is the address where source objects remoted by this node will reside.

## Method Documentation

bool disableRemoting(object remoteObject)

Disables remote access for the QObject remoteObject. Returns `false` if the current node is a client node or if the remoteObject is not registered, and returns `true` if remoting is successfully disabled for the Source object.

Warning: Replicas of this object will no longer be valid after calling this method.

See also enableRemoting().

bool enableRemoting(object object, string name)

Enables a host node to dynamically provide remote access to the QObject object. Client nodes connected to the node hosting this object may obtain Replicas of this Source.

The optional name defines the lookup-name under which the QObject can be acquired using QRemoteObjectNode::acquire() . If not explicitly set then the name given in the QCLASSINFO_REMOTEOBJECT_TYPE will be used. If no such macro was defined for the QObject then the QObject::objectName() is used.

Returns `false` if the current node is a client node, or if the QObject is already registered to be remoted, and `true` if remoting is successfully enabled for the dynamic QObject.

See also disableRemoting().