Bug 452883

Summary: PageRow::lastItem is not updated when a page is removed
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Connor Carney <kbugs>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.94
Sentry Crash Report:
Attachments: qml example

Description Connor Carney 2022-04-22 22:39:05 UTC
Created attachment 148311 [details]
qml example

When the last page is removed from a PageRow using pop(), the lastItem property continues to point to the now-removed page (or null, if that page gets garbage collected), instead of being updated to point to the new last page.
Comment 1 Connor Carney 2022-04-25 15:06:06 UTC
Underlying issue seems to be that ColumnView doesn't notify on contentChildren when a page is removed, so dependent QML bindings don't get re-evaluated.

Submitted a pull request that fixes the issue: https://invent.kde.org/frameworks/kirigami/-/merge_requests/528
Comment 2 Marco Martin 2022-04-26 08:52:05 UTC
Git commit 086a8dc52e68f122dfe6814c535c883e9877ab54 by Marco Martin, on behalf of Connor Carney.
Committed on 26/04/2022 at 08:51.
Pushed by mart into branch 'master'.

ColumnView notifies for contentChildren when page is removed

M  +1    -0    src/columnview.cpp

https://invent.kde.org/frameworks/kirigami/commit/086a8dc52e68f122dfe6814c535c883e9877ab54