slint icon indicating copy to clipboard operation
slint copied to clipboard

unable to convert Vec<String> into mismatched types expected struct `ModelRc<slint::SharedString>` found struct `Vec<String>`rustcClick for full compiler diagnostic

Open learncodingforweb opened this issue 1 year ago • 1 comments

slint=1.4.1 unable to convert Vec<String> into ModelRcslint::SharedString

export component AppWindow inherits Window {
    width: 480px;
    height: 320px;
    in-out property<int> counter: 42;
    in-out property <[string]> ports;
    callback request-increase-value();
    VerticalBox {
        HorizontalBox {
            ComboBox {
                // model: ["com1", "com2"];
                model: ports;
            }
            Button {
                text: "open";
            }
        }
        Text {
            text: "Counter: \{root.counter}";
        }
        Button {
            text: "Increase value";
            clicked => {
                root.request-increase-value();
            }
        }

    }
}

how can i set ports in rust code? where in rust code i am having value in Vec<String>? unable to find any solution?

learncodingforweb avatar Feb 18 '24 17:02 learncodingforweb

Somebody just asked recently the same question in this discussion: https://github.com/slint-ui/slint/discussions/4632

So I'm closing this as a duplicate

Note: for questions, please use the discussions: https://github.com/slint-ui/slint/discussions issues are meant for bug reports.

ogoffart avatar Feb 18 '24 17:02 ogoffart