Skip to content
Verified Commit 14f09409 authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

Material: Drop "attached property enforcement"

As can be easily demonstrated, attached properties are getting created
on any Qt object any time it is accessed in any way in QML, be it
property read or write, or even simply querying the object itself like
`delegate.Layout` or `this.Material`. Thus, no such "enforcement" is
needed.

The output is identical when running the following snippet with both
Qt 5.15 and 6.5 QML runtimes.

```qml
import QtQuick 2.15
import QtQuick.Controls.Material 2.0
import org.kde.kirigami 2.20 as Kirigami

Item {
    Kirigami.BasicThemeDefinition {
        id: hack

        Material.elevation: 2

        textColor: hack.Material.foreground
    }

    Kirigami.BasicThemeDefinition {
        id: nohack

        textColor: nohack.Material.foreground
    }

    Kirigami.BasicThemeDefinition {
        id: nothing

        textColor: "#111111"
    }

    Component.onCompleted: {
        print(hack, hack.Material)
        print(hack.textColor, hack.Material.foreground)
        print(hack.highlightColor, hack.Material.accent)

        print(nohack, nohack.Material)
        print(nohack.textColor, nohack.Material.foreground)
        print(nohack.highlightColor, nohack.Material.accent)

        print(nothing, nothing.Material)
        print(nothing.textColor, nothing.Material.foreground)
        print(nothing.highlightColor, nothing.Material.accent)
    }
}
```
parent a7bef2c9
Pipeline #430743 passed with stage
in 4 minutes and 50 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment