Switch from DelegateRecycler to reuseItems (except for queue)

This commit is contained in:
Bart De Vries 2021-09-27 16:48:12 +02:00
parent 06e8d8d573
commit 4a20959522
3 changed files with 12 additions and 18 deletions

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
import QtQuick 2.14
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.14
@ -78,14 +78,13 @@ Kirigami.ScrollablePage {
}
ListView {
anchors.fill: parent
reuseItems: true
model: PodcastSearchModel {
id: podcastSearchModel
}
spacing: 5
clip: true
delegate: Kirigami.DelegateRecycler {
width: parent ? parent.width : implicitWidth
sourceComponent: delegateComponent
}
delegate: delegateComponent
}
}

View File

@ -131,13 +131,9 @@ Kirigami.ScrollablePage {
id: episodeList
anchors.fill: parent
visible: count !== 0
model: episodeProxyModel
reuseItems: true
// TODO: seems like reuseItems is way too slow; using DelegateRecycler
// for now; still have to find out why...
delegate: Kirigami.DelegateRecycler {
width: episodeList.width
sourceComponent: episodeListDelegate
}
model: episodeProxyModel
delegate: episodeListDelegate
}
}

View File

@ -4,8 +4,8 @@
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
import QtQuick 2.14
import QtQuick.Controls 2.14 as Controls
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.15
@ -45,6 +45,8 @@ Kirigami.OverlaySheet {
id: errorList
visible: errorList.count > 0
implicitWidth: Kirigami.Units.gridUnit * 20
reuseItems: true
model: ErrorLogModel
Component {
@ -89,10 +91,7 @@ Kirigami.OverlaySheet {
}
}
delegate: Kirigami.DelegateRecycler {
width: errorList.width
sourceComponent: errorListDelegate
}
delegate: errorListDelegate
}
contentItem: errorList.count > 0 ? errorList : placeholder