-
Hi, appwindow.slint
I used sidebar.slint
I tried looking around for a solution but couldn't find anything, is there a way to achieve what i'm trying to do here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Basically you cannot convert a string to an image or an image to a string. Your Sidebar class probably has a in property <[{text: string, imageUrl: string}]> model; But it imageUrl shouldn't be a string, it should be an image, like so: in property <[{text: string, imageUrl: image}]> model; Then this should work: { text: @tr("Menu" => "placeholder"), imageUrl: @image-url("./icons/image-placeholder.svg")} ( I hope this helps. |
Beta Was this translation helpful? Give feedback.
Basically you cannot convert a string to an image or an image to a string.
So this means that you need to have it marked as an image and not a string.
Your Sidebar class probably has a
But it imageUrl shouldn't be a string, it should be an image, like so:
Then this should work:
(
imageUrl
might not be the right name for it since the field is really an image and not its URL.)I hope this helps.