mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Reset the grid current index when the grid content changes
`model` object doesn't really change so we can't use `onModelChanged` in QML to reset the index.
This commit is contained in:
parent
5f5ef6833d
commit
e799513fb4
@ -259,6 +259,12 @@ void GridComicsView::setModel(ComicModel *model)
|
||||
ctxt->setContextProperty("dropManager", this);
|
||||
ctxt->setContextProperty("comicInfoHelper", comicInfoHelper);
|
||||
|
||||
auto grid = view->rootObject()->findChild<QQuickItem *>(QStringLiteral("grid"));
|
||||
|
||||
if (grid != nullptr) {
|
||||
grid->setProperty("currentIndex", 0);
|
||||
}
|
||||
|
||||
updateBackgroundConfig();
|
||||
|
||||
selectionHelper->clear();
|
||||
|
Loading…
Reference in New Issue
Block a user