feat: begin work on docs, also minor refactoring

This commit is contained in:
outfoxxed 2024-02-12 04:21:24 -08:00
parent 5de0ae095b
commit 424a45be05
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
12 changed files with 197 additions and 13 deletions

View file

@ -21,10 +21,20 @@ public:
QList<QPair<K, V>> values;
};
///! Creates instances of a component based on a given set of variants.
/// Creates and destroys instances of the given component when the given property changes.
///
/// See [QuickShell.screens] for an example of using `Variants` to create copies of a window per
/// screen.
///
/// [QuickShell.screens]: ../quickshell#prop.screens
class Variants: public Scavenger, virtual public Scavengeable {
Q_OBJECT;
/// The component to create instances of
Q_PROPERTY(QQmlComponent* component MEMBER mComponent);
Q_PROPERTY(QVariantList variants MEMBER mVariants WRITE setVariants);
/// The list of sets of properties to create instances with.
/// Each set creates an instance of the component, which are updated when the input sets update.
Q_PROPERTY(QList<QVariant> variants MEMBER mVariants WRITE setVariants);
Q_CLASSINFO("DefaultProperty", "component");
QML_ELEMENT;