Created attachment 161093 [details] screenshot SUMMARY button is floating, not going with scrolling, see "STEPS TO REPRODUCE" below NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** STEPS TO REPRODUCE 1. goto Configure/Collection screen 2. add serveral Collection, enough to make the list longer than its display box, that way you need to scroll up/down to see the top/buttom collection OBSERVED RESULT While scrolling the list, the following buttons: - "Add Collection" buttons of "Local Collections"/"Collections on Removable Media"/"Collections on Network Shares" - 2/3 action buttons (add/updates/delete) for each collection (located at the right of each collection row) they're still and not scrolling with the collection list EXPECTED RESULT these buttons should be scrolling up & down with the entire list, within the white box (I'm using the default scheme) SOFTWARE/OS VERSIONS macOS: 10.15.7 ADDITIONAL INFORMATION
It's fully reproducible under Linux Kubuntu 22.04. Just reduce the size of the dialog to turn on the scroll sliders and move up/down the list. In fact the Add Collection buttons are not attached to the listview and just placed over it. Gilles Caulier
I've already investigated, we have to set itemView->viewport as parent for the widgets in ItemViewDelegatePool instead of itemView as parent. However, the delete of the widgets is monitored and the order is no longer correct, so that a debug warning is printed. I consider this monitoring and the manual deletion of the widgets to be unnecessary, since they are safely deleted via the parent. Maik
Right, as it's the role to QObject to delete the children instance. Gilles
Why not to plug these button as listwiew widget as well. They will be integrated in the scroll view automatically. Gilles
https://invent.kde.org/graphics/digikam/-/blob/master/core/utilities/setup/collections/dwitemdelegatepool.cpp#L124 If this line is changed it works to: widget->setParent(d->delegate->d->itemView->viewport()); But then we get this error message because the viewport and the widgets are logically deleted before the itemView: https://invent.kde.org/graphics/digikam/-/blob/master/core/utilities/setup/collections/dwitemdelegatepool.cpp#L191 Maik
Do you try to use QObject::deleteLater() ?
By the way, I caused this bug 5 years ago when I wanted to fix the debug warning. https://invent.kde.org/graphics/digikam/-/commit/b09562d6c485376df3a50f01b9de895169d2dd3b I'm going to clean up some stuff now, there's some dead code. Maik
Git commit 25cf51659be3f1a8cf96221d132bbe077edd8e2f by Maik Qualmann. Committed on 22/08/2023 at 18:50. Pushed by mqualmann into branch 'master'. fix floating widgets in collection view FIXED-IN: 8.2.0 M +1 -1 NEWS M +1 -1 core/utilities/setup/collections/dwitemdelegatepool.cpp https://invent.kde.org/graphics/digikam/-/commit/25cf51659be3f1a8cf96221d132bbe077edd8e2f