Skip to content

Property binding for structs #2520

Answered by ogoffart
isaac-eiter asked this question in General
Discussion options

You must be logged in to vote

Unfortunatelt, we don't support binding to memeber of the struct yet.
We might support that int the future, there is an issue to track it: #814

In the mean time, wou will have to do some manual work: Use the accepted or edited callback of the LineEdit to notify your backend.
And add some functions in your ui to reload the config.


export component MainWindow inherits Window {
    title: "Demo";

    in-out property<ProjectSettings> settings <=> settings-page.settings;

    settings-page := SettingsPage{}

    public function reload_settings() { settings-page.reload_settings(); }
}

export component SettingsPage {
    in-out property <ProjectSettings> settings;

    le := LineEdit {
      …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by isaac-eiter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants