You can also use the dynamic signal connection syntax.
Component.onCompleted: {
someObjectId.someSignal.connect(otherObjectId.methodName)
}
A connections element is less error-prone, and more declarative – but does involve the instantiation of a QObject, and has some performance implications. In most cases, I’d suggest the use of the Connections element, but there are times when using an imperative signal connection is the better choice.
Cheers,
Chris.
↧