QRemoteObjectHost Class | Qt Remote Objects 5.12.9

- Qt 5.12
- Qt Remote Objects
- C++ Classes
- QRemoteObjectHost
- Qt 5.12.9 Reference Documentation

# QRemoteObjectHost Class

A (Host) Node on a Qt Remote Objects network. More...

Header: | #include <QRemoteObjectHost>
qmake: | QT += remoteobjects
Inherits: | QRemoteObjectHostBase

- List of all members, including inherited members
- Obsolete members

## Public Functions

| QRemoteObjectHost(QObject *parent = nullptr)
| QRemoteObjectHost(const QUrl &address, const QUrl &registryAddress = QUrl(), QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly, QObject *parent = nullptr)
| QRemoteObjectHost(const QUrl &address, QObject *parent)
virtual | ~QRemoteObjectHost() override

## Reimplemented Public Functions

virtual QUrl | hostUrl() const override
virtual bool | setHostUrl(const QUrl &hostAddress, QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly) override

- 8 public functions inherited from QRemoteObjectHostBase
- 18 public functions inherited from QRemoteObjectNode
- 31 public functions inherited from QObject

## Static Public Members

const QMetaObject | staticMetaObject

- 9 static public members inherited from QObject

### Additional Inherited Members

- 3 properties inherited from QRemoteObjectNode
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 4 signals inherited from QRemoteObjectNode
- 2 signals inherited from QObject
- 1 protected function inherited from QRemoteObjectNode
- 9 protected functions inherited from QObject

## Detailed Description

A (Host) Node on a Qt Remote Objects network.

The QRemoteObjectHost class provides an entry point to a QtRemoteObjects network. A network can be as simple as two nodes, or an arbitrarily complex set of processes and devices.

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

Nodes may connect to each other directly using connectToNode, or they can use the QRemoteObjectRegistry to simplify connections.

The QRemoteObjectRegistry is a special replica available to every node that connects to the uegistry Url. It knows how to connect to every QRemoteObjectSource object on the network.

See also QRemoteObjectNode and QRemoteObjectRegistryHost.

## Member Function Documentation

### QRemoteObjectHost::QRemoteObjectHost(QObject *parent = nullptr)

Constructs a new QRemoteObjectHost Node (i.e., a Node that supports exposing Source objects on the QtRO network) with the given parent. This constructor is meant specific to support QML in the future as it will not be available to connect to until setHostUrl() is called.

See also setHostUrl, (), and setRegistryUrl().

### QRemoteObjectHost::QRemoteObjectHost(const QUrl &address, const QUrl &registryAddress = QUrl(), QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly, QObject *parent = nullptr)

Constructs a new QRemoteObjectHost Node (i.e., a Node that supports exposing Source objects on the QtRO network) with address address. If set, registryAddress will be used to connect to the QRemoteObjectRegistry at the provided address. The allowedSchemas parameter is only needed (and should be set to AllowExternalRegistration) if the schema of the url should be used as an External Schema by the registry.

See also setHostUrl, (), and setRegistryUrl().

### QRemoteObjectHost::QRemoteObjectHost(const QUrl &address, QObject *parent)

Constructs a new QRemoteObjectHost Node (i.e., a Node that supports exposing Source objects on the QtRO network) with a url of address and the given parent. This overload is provided as a convenience for specifying a QObject parent without providing a registry address.

See also setHostUrl() and setRegistryUrl().

### `[override virtual]` QRemoteObjectHost::~QRemoteObjectHost()

Destroys the instance of QRemoteObjectHost. The destructor is virtual.

### `[override virtual]` QUrl QRemoteObjectHost::hostUrl() const

Returns the host address for the QRemoteObjectNode as a QUrl. If the Node is not a Host node, it return an empty QUrl.

See also setHostUrl and ().

### `[override virtual]` bool QRemoteObjectHost::setHostUrl(const QUrl &hostAddress, QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly)

Sets the hostAddress for a host QRemoteObjectNode.

Returns `true` if the Host address is set, otherwise `false`.

The allowedSchemas parameter is only needed (and should be set to AllowExternalRegistration) if the schema of the url should be used as an External Schema by the registry.

See also hostUrl().