You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This worked quite well. I could create empty MyRowInfos by calling default() - and I could also put them it in a VecModel and set this as the content of MyTableView (In fact, it was a bit more elaborated, but for the sake of simplicity, I stripped it down)
But how can I move the rust code into the library crate?
The my-tableview.slint file is included from my application crate, which also does the slint::include_modules!(); call. So the MyRowInfo struct is generated there and I have to keep the impl MyRowInfo code in the application crate.
I tried a few things like adding my-tableview.slint to build.rs of the library crate and call slint::include_modules!(); in the library crate. But then I am stuck with MyTableView being compiled twice (once from the library crate and once from the application)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Initially, I created a
MyTableView, based on theTableViewfrom the std-widgets.This slint file also declared a struct:
In the application, I added the following code
This worked quite well. I could create empty
MyRowInfos by callingdefault()- and I could also put them it in aVecModeland set this as the content ofMyTableView(In fact, it was a bit more elaborated, but for the sake of simplicity, I stripped it down)So far so good :)
Now, I had the idea to put all of this into a library crate as it is described in https://docs.slint.dev/latest/docs/slint/guide/language/coding/file/#component-libraries
So the
my-tableview.slintfile (which also contains theexport struct MyRowInfostatement) is now in a library crate.But how can I move the rust code into the library crate?
The
my-tableview.slintfile is included from my application crate, which also does theslint::include_modules!();call. So theMyRowInfostruct is generated there and I have to keep theimpl MyRowInfocode in the application crate.I tried a few things like adding
my-tableview.slinttobuild.rsof the library crate and callslint::include_modules!();in the library crate. But then I am stuck withMyTableViewbeing compiled twice (once from the library crate and once from the application)Beta Was this translation helpful? Give feedback.
All reactions