How to paint a composite widget in a QStyledItemDelegate, Pyside6

This FAQ:
shows how to display a screen of thumbnail images using a delegate. It uses the painter.drawImage function to draw the image

Now imagine you want to display a linedit under each thumbnail, editable, which would hold the photo caption. There appears to be no similar function to draw a lineedit, either using “painter.” or QStyle.drawControl

Ideally, I would construct a CaptionedThumbnail that was a QListWidget that had the scaled image and the line edit in a QVBoxlayout. Then display that in the list. In fact I can do that using an item-based approach (using QStandardItemModel instead of QAbstractListModel), but I see warnings that one should not use an item based approach for dynamic data, such as an editable line edit. It appears from the docs that adding edit functions to a delegate requires overriding several methods, and gets complex.

What design approach should I take here? If it is the delegate approach, how do I handle the line edit?
thanks in advance.