Skip to content

Convenience function to cast / convert to other types #6294

Open
@NigelBreslaw

Description

@NigelBreslaw

I still find code like this unnecessarily complex width: self.source.width / root.frames-wide * 1px;.

Even though it's technically the same thing, would it be possible to have px(width: self.source.width / root.frames-wide) and postfix (width: self.source.width / root.frames-wide).px(). Or toInt() or whatever the best name is. It would make the language look more friendly to new starters (especially design folk), you don't have to understand math order of operations, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:language-slintCompiler for the .slint language (mO,bF)rfcRequest for comments: proposals for changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions