在 D-Bus 适配器中声明信号

类中的任何信号派生自 QDBusAbstractAdaptor will be automatically relayed into D-Bus, provided that the signal's parameters conform to certain rules (see Qt D-Bus 类型系统 for more information). No special code is necessary to make this relay.

However, signals must still be emitted. The easiest way to emit an adaptor signal is to connect another signal to it, so that Qt's signals and slots mechanism automatically emits the adaptor signal, too. This can be done in the adaptor's constructor, as you can see in the D-Bus Complex Ping Pong 范例。

The QDBusAbstractAdaptor::setAutoRelaySignals () convenience function can also be used to make and break connections between signals in the real object and the corresponding signals in the adaptor. It will inspect the list of signals in both classes and connect those whose parameters match exactly.

另请参阅 使用 Qt D-Bus 适配器 , 在 D-Bus 适配器中声明槽 , Qt D-Bus 类型系统 ,和 QDBusAbstractAdaptor .

在 D-Bus 适配器中声明槽 Qt D-Bus 类型系统