forked from qt-creator/qt-creator
Timeline: Tolerate TimelineModelAggregator::prevItem(m, -1, t)
Apparently there is some way of having a valid model index and an invalid item index in QML root item. We don't know how that happens, but we can work around it with a one character change. Change-Id: Id2f611bfefe3119f3527e10b00249036d883334f Task-number: QTCREATORBUG-16282 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -199,7 +199,7 @@ QVariantMap TimelineModelAggregator::prevItem(int selectedModel, int selectedIte
|
||||
for (int i = 0; i < modelCount(); i++) {
|
||||
const TimelineModel *currentModel = model(i);
|
||||
if (selectedModel == i) {
|
||||
itemIndexes[i] = (selectedItem == 0 ? currentModel->count() : selectedItem) - 1;
|
||||
itemIndexes[i] = (selectedItem <= 0 ? currentModel->count() : selectedItem) - 1;
|
||||
} else {
|
||||
itemIndexes[i] = currentModel->lastIndex(time);
|
||||
if (itemIndexes[i] == -1)
|
||||
|
||||
Reference in New Issue
Block a user