Bug 452883 - PageRow::lastItem is not updated when a page is removed
Summary: PageRow::lastItem is not updated when a page is removed
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-22 22:39 UTC by Connor Carney
Modified: 2022-04-27 19:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.94
Sentry Crash Report:


Attachments
qml example (679 bytes, text/x-qml)
2022-04-22 22:39 UTC, Connor Carney
Details

Note You need to log in before you can comment on or make changes to this bug.
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