According to bug 353380, KViewStateSerializer::restoreScrollBarState() calls QScrollBar::maximum() on an invalid (i.e. already deleted) scrollbar. This means, the enclosing QAbstractScrollArea has been deleted between the call to ::restoreScrollState() and the deferred (via a single shot timer) ::restoreScrollBarState().
This bug had already been reported against the kdelibs4 KViewStateSaver as bug 328755. The commit there (comment #9) was not forward-ported to KWidgetsAddons, but also was not effective, evidenced by the more recent comments.
The actual cause (i.e. the view is destroyed before the state saver) could probably also be fixed in the calling code, but according to LXR, there are many users of ETMViewStateSaver, and I got confused about the comment at https://lxr.kde.org/source/kde/pim/korganizer/src/akonadicollectionview.cpp#0226
This commit works around the issue by allowing users to delete the view immediately after ::restoreScrollState() was called.