Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed callbacks are not all triggered when aliasing properties #7747

Open
hunger opened this issue Feb 26, 2025 · 1 comment
Open

changed callbacks are not all triggered when aliasing properties #7747

hunger opened this issue Feb 26, 2025 · 1 comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working need triaging Issue that the owner of the area still need to triage

Comments

@hunger
Copy link
Member

hunger commented Feb 26, 2025

Bug Description

When running the code below, I get this output:

Incrementing test-value in Demo
Inner: test-value CHANGED

I would expect all changed signals to fire as all the values have changed. It should IMHO not matter that they are all aliased together and technically only one of them exists.

Reproducible Code (if applicable)

import { Button } from "std-widgets.slint";

component Inner inherits HorizontalLayout {
    in-out property <int> test-value;

    changed test-value => {
        debug("Inner: test-value CHANGED")
    }

    Rectangle {
        background: red;
        height: 50px;
        width: 50px;
    }
}

component Intermediate inherits HorizontalLayout {
    in-out property <int> test-value;

    changed test-value => {
        debug("Intermediate: test-value CHANGED")
    }

    Inner {
        test-value <=> root.test-value;
    }
}

export component Demo {
    property <int> test-value: 42;

    changed test-value => {
        debug("Demo: test-value CHANGED")
    }

    VerticalLayout {
        Button {
            text: "Click me";
            clicked => {
                debug("Incrementing test-value in Demo");
                root.test-value += 1;
            }
        }

        Intermediate {
            test-value <=> root.test-value;
        }
    }
}

Environment Details

  • Slint Version: master
  • Platform/OS: Linux
  • Programming Language: Slint
  • Backend/Renderer: Slintpad

Product Impact

No response

@hunger hunger added bug Something isn't working need triaging Issue that the owner of the area still need to triage a:compiler Slint compiler internal (not the codegen, not the parser) labels Feb 26, 2025
@ogoffart
Copy link
Member

ogoffart commented Mar 3, 2025

I think this is a bug in how the remove_alias pass not merge the changed event as it should.

Another possible similar report in #7781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working need triaging Issue that the owner of the area still need to triage
Projects
None yet
Development

No branches or pull requests

2 participants