Closed Ultrajackstr closed 1 month ago
Thanks for the report. Looks like this is caused by https://github.com/slint-ui/slint/pull/5813 Do you have an example i can use to reproduce?
Hi Olivier, The project is quite big so I do not have an isolated example to provide. However, I just found the problematic line:
Button {
text: "Yes";
clicked => {
ProtocolManagerLogic.delete-protocol-by-type-uuid(root.current-selected-protocol-type, protocol.uuid);
if root.current-selected-protocol-name-uuid[1] == protocol.uuid {
root.current-selected-protocol-name-uuid = ["", ""]
};
/////// When I comment out the next line, the program compiles fine.
root.current-selected-protocol-type == "unit" ? btn-show-unit-protocols.clicked() : btn-show-global-protocols.clicked();
///////
search-field.text = "";
root.is_confirm_delete_open = false;
}
}
This is the code for the buttons:
btn-show-unit-protocols := Button {
text: "Show Unit Protocols";
checked: root.current-selected-protocol-type == "unit";
clicked => {
root.get-all-unit-protocols();
}
}
btn-show-global-protocols := Button {
text: "Show Global Protocols";
checked: root.current-selected-protocol-type == "global";
clicked => {
root.get-all-global-protocols();
}
}
This is the code for the functions (only for "unit", "global" is essentially the same):
function get-all-unit-protocols() {
ProtocolManagerLogic.get-all-unit-protocols();
root.current-selected-protocol-type = "unit";
root.current-selected-protocol-name-uuid = [current-displayed-protocols[0].name, current-displayed-protocols[0].uuid];
root.is_confirm_delete_open = false;
if current-displayed-protocols[0].uuid != "" {
ProtocolManagerLogic.get-protocol-by-type-uuid(root.current-selected-protocol-type, current-displayed-protocols[0].uuid)
}
search-field.text = "";
root.current-searched-protocols = root.current-displayed-protocols;
protcol-list.viewport-y = 0px;
}
Thanks, I was able to reproduce. (and fix in #5884)
Workaround: use if/else
if root.current-selected-protocol-type == "unit" {
btn-show-unit-protocols.clicked();
} else {
btn-show-global-protocols.clicked();
}
It works now. Thank you for your quick answer !
W11 Pro 22631.3880 stable-x86_64-pc-windows-msvc rustc 1.80.1 (3f5fd8dd4 2024-08-06)
Hello,
I am getting a compile error starting at version 1.7.2, including the Git version. It compiles fine with version 1.7.1 or below. I could not find any related issue on Github.
Thank you,
Jack