Skip to content

Draft: Introduce Kirigami.ActionExt attached replacement for Kirigami.Action

ivan tkachenko requested to merge work/ratijas/action-ext into master

Kirigami.Action type has always been a bit cumbersome to work with: either API providers required properties/objects being Kirigami.Action types even when consumers didn't need any of the extended functionality, or else types were left at permissive defaults T.Action while their usages got messy with wordy instanceof checks and fallback values.

All this can be swapped for a simplicity of a native attached type leveraging these two essential properties:

  1. they provide sane fallback values through property getters;
  2. they "always exist", in a sense that no matter whether client code queries attached property, assigns to it or declares a binding -- attached object will be automatically created if it didn't already exist.
  3. bonus point: C++ API allows for an optimization that won't create an attached object if it doesn't exist already.

Standalone Kirigami.Action type is planned to be phased out until KF7, at which point ActionExt might get renamed to simply "Action". For the KF6 lifespan, a backward compatibility layer of ActionExt will keep all mirrored properties in sync when attachee is Kirigami.Action instance.

Merge request reports