Replies: 6 comments 5 replies
-
This looks very nice! A crash is never OK, there is definitely a bug there... IIRC there was something like this fixed for 1.6, which version are you using? We are working towards having for pin_info[idx] in root.info.inputs: Pin {
name: pin_info.name;
changed absolute-position => {
root.pin_position_updated(
idx,
self.absolute-position.x,
self.absolute-position.y,
);
}
} It is an experimental feature at this point in time (which obviously works best on master branch), so if you venture down that route (search our code for |
Beta Was this translation helpful? Give feedback.
-
Somewhat different question, how do I access view tree from Rust? I hope I can workaround by simply iterating views in rust and querying their absolute position. I cannot google any info in this, nor examples are helpful. |
Beta Was this translation helpful? Give feedback.
-
There is an example for a single node: #3608 There are a lot of problems which actually prevent you from writing this:
Most are known issues, except the third one for some reason. Maybe @ogoffart knows a better way, as the author of the original suggestion. Here is an example implemented in QML: https://github.com/houmain/QML-NodeGraph |
Beta Was this translation helpful? Give feedback.
-
I Actually Did ItHere is something that works on stable slint 1.6.0: SlintPad link But be ready for THE most hacky code ever. |
Beta Was this translation helpful? Give feedback.
-
I still have the // instead of the init(), use a immediately invoking timer.
portelem := Rectangle {
...
Timer {
interval: 0;
running: true;
triggered() => {
self.running = false;
ports[idx].x = portelem.absolute-position.x;
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Fyi, I opened an issue for the |
Beta Was this translation helpful? Give feedback.
-
I'm trying to build a node editor with Rust. Here is what I have:
What I want:
I need to get absolute-position of pin elements, but find it impossible to achieve.
I tried to get abs-pos on init, but it crashes slint preview and app:
Maybe I can somehow bind curve points to pins.. or get it done in rust side..?
I'm very new to slint. I'm asking for your ideas and suggestions. Thanks
Beta Was this translation helpful? Give feedback.
All reactions