From fef62c9b40ff1d79e62778e67c90f956da84b238 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig <jens.bache-wiig@digia.com> Date: Tue, 4 Jun 2013 19:28:26 +0200 Subject: [PATCH] Prevent possible division by zero This might cause problems on certain platforms. While hard to reproduce it seems safer to add the check. Note that we do not get the alternating pattern if there is nothing set on the model, but this was already the case. Change-Id: I984df9cfef30b4de0e72e8ccf14cc65bddbf04ef Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> --- src/controls/TableView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml index a71264da0..fad6ee47a 100644 --- a/src/controls/TableView.qml +++ b/src/controls/TableView.qml @@ -470,7 +470,7 @@ ScrollView { // Fills extra rows with alternate color Column { id: rowfiller - property int rowHeight: listView.contentHeight/count + property int rowHeight: count ? listView.contentHeight/count : height property int paddedRowCount: height/rowHeight property int count: listView.count y: listView.contentHeight -- GitLab