Bug 473605 - Add Collection buttons are floating, not going with scrolling.
Summary: Add Collection buttons are floating, not going with scrolling.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Collections (show other bugs)
Version: 8.2.0
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-21 16:47 UTC by Kane
Modified: 2023-08-22 16:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.2.0


Attachments
screenshot (731.36 KB, image/png)
2023-08-21 16:47 UTC, Kane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kane 2023-08-21 16:47:31 UTC
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
Comment 1 caulier.gilles 2023-08-22 07:13:34 UTC
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
Comment 2 Maik Qualmann 2023-08-22 07:32:12 UTC
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
Comment 3 caulier.gilles 2023-08-22 08:01:26 UTC
Right, as it's the role to QObject to delete the children instance.

Gilles
Comment 4 caulier.gilles 2023-08-22 08:02:50 UTC
Why not to plug these button as listwiew widget as well. They will be integrated in the scroll view automatically.

Gilles
Comment 5 Maik Qualmann 2023-08-22 08:22:04 UTC
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
Comment 6 caulier.gilles 2023-08-22 08:32:32 UTC
Do you try to use QObject::deleteLater() ?
Comment 7 Maik Qualmann 2023-08-22 11:23:46 UTC
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
Comment 8 Maik Qualmann 2023-08-22 16:52:20 UTC
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