2
1
Fork 0

guide: add multiple files and singletons sections to intro

This commit is contained in:
outfoxxed 2024-03-14 02:45:47 -07:00
parent dfa95a1ece
commit 581ec772ac
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 297 additions and 5 deletions

View file

@ -679,12 +679,14 @@ QML Types can be easily made into a singleton, meaning there is only one instanc
of the type.
To make a type a singleton, put `pragma Singleton` at the top of the file.
To ensure it behaves correctly with quickshell you should also make
[Singleton](/docs/types/quickshell/singleton) the root item of your type.
```qml
pragma Singleton
import ...
Item { ... }
Singleton { ... }
```
once a type is a singleton, its members can be accessed by name from neighboring