QML: Modify extension settings tutorial a bit
Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
112191b027
commit
066f8dd53c
|
@ -11,6 +11,7 @@ only for small data storage like global user settings.
|
||||||
At first set the settings option `X-Falkon-Settings=true` in the desktop
|
At first set the settings option `X-Falkon-Settings=true` in the desktop
|
||||||
file to tell Falkon the settings for the extension are available.
|
file to tell Falkon the settings for the extension are available.
|
||||||
|
|
||||||
|
metadata.desktop
|
||||||
```ini
|
```ini
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Tutorial8 QML
|
Name=Tutorial8 QML
|
||||||
|
@ -25,6 +26,7 @@ X-Falkon-Version=1.0.0
|
||||||
X-Falkon-Settings=true
|
X-Falkon-Settings=true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
main.qml
|
||||||
```qml
|
```qml
|
||||||
Falkon.Settings {
|
Falkon.Settings {
|
||||||
id: settings
|
id: settings
|
||||||
|
@ -44,6 +46,9 @@ object. The available API can be found at
|
||||||
or
|
or
|
||||||
[code](https://github.com/KDE/falkon/blob/master/src/lib/plugins/qml/api/settings/qmlsettings.h)
|
[code](https://github.com/KDE/falkon/blob/master/src/lib/plugins/qml/api/settings/qmlsettings.h)
|
||||||
|
|
||||||
|
The `settingsWindow` is same as button popup and sidebar content. It
|
||||||
|
contains some QMT element to draw stuff.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
If you try to use the Qt style settings syntax
|
If you try to use the Qt style settings syntax
|
||||||
`settings.value('key', 'default')` you will receive an error message
|
`settings.value('key', 'default')` you will receive an error message
|
||||||
|
|
Loading…
Reference in New Issue
Block a user