@@ -69,13 +69,18 @@ bool ValueEditor::ValueViewModel::isRowLoaded(int i)
69
69
return m_model.isRowLoaded (i);
70
70
}
71
71
72
- void ValueEditor::ValueViewModel::loadRows (int start, int count )
72
+ void ValueEditor::ValueViewModel::loadRows (int start, int limit )
73
73
{
74
+ int rowsLeft = totalRowCount () - start;
75
+ int loaded = (rowsLeft > limit) ? limit : rowsLeft;
76
+
74
77
// frame already loaded
75
78
if (m_model.isRowLoaded (start)) {
76
79
m_startFramePosition = start;
80
+ m_lastLoadedRowFrameSize = loaded;
81
+
77
82
emit layoutAboutToBeChanged ();
78
- emit rowsLoaded (start, count );
83
+ emit rowsLoaded (start, loaded );
79
84
emit layoutChanged ();
80
85
return ;
81
86
}
@@ -85,15 +90,12 @@ void ValueEditor::ValueViewModel::loadRows(int start, int count)
85
90
try {
86
91
// NOTE(u_glide): Do so for proper rendering of QML table
87
92
m_lastLoadedRowFrameSize = totalRowCount () - start;
88
- m_model.loadRows (start, count , [this , start, count , msg](const QString& err)
93
+ m_model.loadRows (start, limit , [this , start, limit, loaded , msg](const QString& err)
89
94
{
90
95
if (!err.isEmpty ()) {
91
96
emit error (msg.arg (err));
92
97
return ;
93
- }
94
-
95
- int loaded = totalRowCount () - start;
96
- loaded = (loaded > count) ? count : loaded;
98
+ }
97
99
98
100
m_lastLoadedRowFrameSize = loaded;
99
101
m_startFramePosition = start;
0 commit comments