Coder Social home page Coder Social logo

Comments (3)

ogoffart avatar ogoffart commented on June 20, 2024

Slint struct and other types can currently only contains fields of type known to Slint.
I don't know if we can support this usecase.
It can be worked around by using an integer id, and have mapping between id and the actual type in Rust.

from slint.

Areopagitics avatar Areopagitics commented on June 20, 2024

Slint struct and other types can currently only contains fields of type known to Slint. I don't know if we can support this usecase. It can be worked around by using an integer id, and have mapping between id and the actual type in Rust.

True, it's possible to do this with an id; but if you want to do anything more complicated inside the for loop, like calling a common function that affects each child individually, I think you would need the ability to pass more complicated types of variables as parameters in the function, like Widget types. This would be a huge bonus. This is one huge advantage of Flutter. It is similar to issue #4891.

It would be interesting to know how difficult this would be. I think this is a bottle-neck for a lot of functionality.

from slint.

ogoffart avatar ogoffart commented on June 20, 2024

We would need to support importing rust struct.
I think this would be a duplicate of #1726
So it would allow to import Rust struct from Slint code
Closing this issue as duplicate of #1726

from slint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.