Improving/extending QML type system: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
m (wikified mark-up)
 
Line 9: Line 9:
==Notes==
==Notes==


- optionals are actually sum types of void and SomeType
* optionals are actually sum types of void and SomeType
- actual sum types? QVariant converters are evil because  
* actual sum types? QVariant converters are evil because  
- extend QMetaType to specify sum types and underlying types
* extend QMetaType to specify sum types and underlying types
  - possibly expressed as std::variant
** possibly expressed as std::variant
- allow that as types in QML to allow restrictions on what can be assigned to a property
* allow that as types in QML to allow restrictions on what can be assigned to a property
- Something similar with function types
* Something similar with function types
  - possibly expressed as std::function
** possibly expressed as std::function
  - QMetaMethod?
** QMetaMethod?
  - member functions!
** member functions!
- Interface types? We have sort of half interfaces in QML already. Let's not invent another one.
* Interface types? We have sort of half interfaces in QML already. Let's not invent another one.


In QML: optional/sum unwrapping implicit or explicit?
In QML: optional/sum unwrapping implicit or explicit?
- z ?? "red"
* z ?? "red"
- z as color
* z as color
- There will be lots of corner cases.
* There will be lots of corner cases.


Fabian will do some prototyping and post on mailing list.
Fabian will do some prototyping and post on mailing list.

Latest revision as of 14:54, 1 December 2023


Session Summary

Session Owners

Notes

  • optionals are actually sum types of void and SomeType
  • actual sum types? QVariant converters are evil because
  • extend QMetaType to specify sum types and underlying types
    • possibly expressed as std::variant
  • allow that as types in QML to allow restrictions on what can be assigned to a property
  • Something similar with function types
    • possibly expressed as std::function
    • QMetaMethod?
    • member functions!
  • Interface types? We have sort of half interfaces in QML already. Let's not invent another one.

In QML: optional/sum unwrapping implicit or explicit?

  • z ?? "red"
  • z as color
  • There will be lots of corner cases.

Fabian will do some prototyping and post on mailing list.