Introduce a DelegateRecycler attached object
ClosedPublic

Authored by apol on Dec 14 2018, 11:27 PM.

Details

Summary

It allows us to reach the context of the delegate from our delegate component.

Test Plan

Now I can call highlighted: Kirigami.DelegateRecycler.recycler.ListView.isCurrentItem.

Diff Detail

Repository
R169 Kirigami
Branch
arcpatch-D17592
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6107
Build 6125: arc lint + arc unit
apol created this revision.Dec 14 2018, 11:27 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptDec 14 2018, 11:27 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol requested review of this revision.Dec 14 2018, 11:27 PM
mart requested changes to this revision.Dec 17 2018, 9:35 AM

recycler should have a notify signal, because it's going to change all the time.
the delegaterecycler instances are created/destroyed all the time like normal listview delegates, and the delegates instances, those that are actually recycled, will be assigned a new recycler when actually recycled.
since is saved anyways as a context property, perhaps is better to just base off that one and taking care that's always kept up to date to the new recycler.

src/delegaterecycler.cpp
256

tracking this property directly from qml will woirk as is the correct recycler, on the other hand the attached property won't, so is probably better to just have this one

This revision now requires changes to proceed.Dec 17 2018, 9:35 AM
apol updated this revision to Diff 47719.Dec 17 2018, 3:30 PM

Use QML so the property emits updates upon change

apol marked an inline comment as done.Dec 17 2018, 3:31 PM
apol updated this revision to Diff 47785.Dec 18 2018, 5:59 PM

Remove attached object

mart accepted this revision.Dec 19 2018, 4:50 PM
This revision is now accepted and ready to land.Dec 19 2018, 4:50 PM
apol closed this revision.Dec 19 2018, 4:50 PM
aacid added a subscriber: aacid.Dec 19 2018, 8:51 PM

@apol you broke the build