History: keep sorting on page change

This commit is contained in:
Ilya Kitaev 2016-11-06 15:33:41 +03:00
parent de7d97db85
commit a803c1efb1

View file

@ -40,9 +40,15 @@ Rectangle {
id: root
property var model
QtObject {
id: d
property bool initialized: false
}
color: "#F0EEEE"
onModelChanged: {
if (typeof model !== 'undefined') {
if (!d.initialized) {
// setup date filter scope according to real transactions
fromDatePicker.currentDate = model.transactionHistory.firstDateTime
toDatePicker.currentDate = model.transactionHistory.lastDateTime
@ -55,8 +61,11 @@ Rectangle {
model.sortRole = TransactionHistoryModel.TransactionTimeStampRole
model.sort(0, Qt.DescendingOrder);
d.initialized = true
// TODO: public interface for 'Header' item that will cause 'sortRequest' signal
}
}
}