overview: mention Connections

This commit is contained in:
outfoxxed 2024-06-23 02:44:12 -07:00
parent ade833bb94
commit 4bb71e57bd
Signed by: outfoxxed
GPG Key ID: 4C88A185FB89301E
1 changed files with 23 additions and 0 deletions

View File

@ -536,6 +536,29 @@ ColumnLayout {
}
```
##### Indirect signal handlers
When it is not possible or not convenient to directly define a signal handler, before resorting
to `.connect`ing the properties, a [Connections] object can be used to access them.
This is especially useful to connect to signals of singletons.
```qml
Item {
Button {
id: myButton
text "click me"
}
Connections {
target: myButton
function onClicked() {
// ...
}
}
}
```
##### Property change signals
Every property has an associated signal, which powers QML's [reactive bindings](#reactive-bindings).
The signal is named `<propertyname>Changed` and works exactly the same as any other signal.