mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
PSFListModel isa ListModel instead of hasa
This commit is contained in:
parent
d2cf042a88
commit
421edbfa1e
6 changed files with 10 additions and 26 deletions
|
@ -98,7 +98,7 @@ Column {
|
|||
}
|
||||
ListView {
|
||||
id: scroll;
|
||||
model: suggestions.model;
|
||||
model: suggestions;
|
||||
orientation: ListView.Horizontal;
|
||||
highlightFollowsCurrentItem: false
|
||||
highlightMoveDuration: -1;
|
||||
|
|
|
@ -785,7 +785,7 @@ Rectangle {
|
|||
resizable: false;
|
||||
}
|
||||
|
||||
model: connectionsUserModel.model;
|
||||
model: connectionsUserModel;
|
||||
Connections {
|
||||
target: connectionsTable.flickableItem;
|
||||
onAtYEndChanged: {
|
||||
|
|
|
@ -519,7 +519,7 @@ Item {
|
|||
}
|
||||
visible: !connectionsLoading.visible;
|
||||
clip: true;
|
||||
model: connectionsModel.model;
|
||||
model: connectionsModel;
|
||||
onAtYEndChanged: if (connectionsList.atYEnd && !connectionsList.atYBeginning) { connectionsModel.getNextPage(); }
|
||||
snapMode: ListView.SnapToItem;
|
||||
// Anchors
|
||||
|
|
|
@ -583,7 +583,7 @@ Rectangle {
|
|||
id: purchasesContentsList;
|
||||
visible: purchasesModel.count !== 0;
|
||||
clip: true;
|
||||
model: purchasesModel.model;
|
||||
model: purchasesModel;
|
||||
snapMode: ListView.SnapToItem;
|
||||
// Anchors
|
||||
anchors.top: separator.bottom;
|
||||
|
|
|
@ -323,7 +323,7 @@ Item {
|
|||
height: parent.height;
|
||||
visible: transactionHistoryModel.count !== 0;
|
||||
clip: true;
|
||||
model: transactionHistoryModel.model;
|
||||
model: transactionHistoryModel;
|
||||
delegate: Item {
|
||||
width: parent.width;
|
||||
height: (model.transaction_type === "pendingCount" && model.count !== 0) ? 40 : ((model.status === "confirmed" || model.status === "invalidated") ? transactionText.height + 30 : 0);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
import QtQuick 2.7
|
||||
|
||||
Item {
|
||||
ListModel {
|
||||
id: root;
|
||||
// Used when printing debug statements
|
||||
property string listModelName: endpoint;
|
||||
|
@ -50,7 +50,7 @@ Item {
|
|||
// Not normally set directly, but rather by giving a truthy argument to getFirstPage(true);
|
||||
property bool delayedClear: false;
|
||||
function resetModel() {
|
||||
if (!delayedClear) { finalModel.clear(); }
|
||||
if (!delayedClear) { root.clear(); }
|
||||
currentPageToRetrieve = 1;
|
||||
retrievedAtLeastOnePage = false;
|
||||
}
|
||||
|
@ -87,12 +87,12 @@ Item {
|
|||
}
|
||||
|
||||
if (delayedClear) {
|
||||
finalModel.clear();
|
||||
root.clear();
|
||||
delayedClear = false;
|
||||
}
|
||||
finalModel.append(processed); // FIXME keep index steady, and apply any post sort
|
||||
root.append(processed); // FIXME keep index steady, and apply any post sort
|
||||
retrievedAtLeastOnePage = true;
|
||||
debugView('after handlePage');
|
||||
console.debug(listModelName, 'after handlePage count', root.count);
|
||||
}
|
||||
function debugView(label) {
|
||||
if (!listView) { return; }
|
||||
|
@ -152,20 +152,4 @@ Item {
|
|||
requestPending = true;
|
||||
getPage();
|
||||
}
|
||||
|
||||
// Redefining members and methods so that the parent of this Item
|
||||
// can use PSFListModel as they would a regular ListModel
|
||||
property alias model: finalModel;
|
||||
property alias count: finalModel.count;
|
||||
function clear() { finalModel.clear(); }
|
||||
function get(index) { return finalModel.get(index); }
|
||||
function remove(index) { return finalModel.remove(index); }
|
||||
function setProperty(index, prop, value) { return finalModel.setProperty(index, prop, value); }
|
||||
function move(from, to, n) { return finalModel.move(from, to, n); }
|
||||
function insert(index, newElement) { finalModel.insert(index, newElement); }
|
||||
function append(newElements) { finalModel.append(newElements); }
|
||||
|
||||
ListModel {
|
||||
id: finalModel;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue