Compare commits
2 commits
ade833bb94
...
085b5684ac
Author | SHA1 | Date | |
---|---|---|---|
outfoxxed | 085b5684ac | ||
outfoxxed | 4bb71e57bd |
|
@ -236,7 +236,7 @@ you supply. (A component is a re-usable tree of objects.)
|
||||||
The most common use of `Variants` in a shell is to create instances of
|
The most common use of `Variants` in a shell is to create instances of
|
||||||
a window (your bar) based on your monitor list (the data model).
|
a window (your bar) based on your monitor list (the data model).
|
||||||
|
|
||||||
Variants will inject the properties in the data model directly into each new
|
Variants will inject the values in the data model into each new
|
||||||
component's `modelData` property, which means we can easily pass each screen
|
component's `modelData` property, which means we can easily pass each screen
|
||||||
to its own component.
|
to its own component.
|
||||||
(See [Window.screen](/docs/types/quickshell/qswindow/#prop.screen).)
|
(See [Window.screen](/docs/types/quickshell/qswindow/#prop.screen).)
|
||||||
|
@ -456,7 +456,7 @@ component wrapping the window and place the window directly into the
|
||||||
`delegate` property.
|
`delegate` property.
|
||||||
2. The [Variants.delegate](/docs/types/quickshell/variants/#prop.delegate)
|
2. The [Variants.delegate](/docs/types/quickshell/variants/#prop.delegate)
|
||||||
property is a [Default Property](/docs/configuration/qml-overview/#the-default-property),
|
property is a [Default Property](/docs/configuration/qml-overview/#the-default-property),
|
||||||
which means we can skip the `component: ` part of the assignment.
|
which means we can skip the `delegate: ` part of the assignment.
|
||||||
We're already using [ShellRoot](/docs/types/quickshell/shellroot/)'s
|
We're already using [ShellRoot](/docs/types/quickshell/shellroot/)'s
|
||||||
default property to store our Variants, Process, and Timer components
|
default property to store our Variants, Process, and Timer components
|
||||||
among other things.
|
among other things.
|
||||||
|
|
|
@ -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
|
##### Property change signals
|
||||||
Every property has an associated signal, which powers QML's [reactive bindings](#reactive-bindings).
|
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.
|
The signal is named `<propertyname>Changed` and works exactly the same as any other signal.
|
||||||
|
|
Loading…
Reference in a new issue