From eb2df59fb203668734d652808c74b0504864cc1e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 17 Nov 2016 10:04:14 +0100 Subject: DefaultFileDialog: check cur selection properly on okButton clicked TableView has currentRow not currentIndex. Task-number: QTBUG-56663 Change-Id: I9376354364bc843d118a672fcd1d9dfbba8e775c Reviewed-by: J-P Nurmi --- src/dialogs/DefaultFileDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dialogs/DefaultFileDialog.qml b/src/dialogs/DefaultFileDialog.qml index 02815f17..394e04a3 100644 --- a/src/dialogs/DefaultFileDialog.qml +++ b/src/dialogs/DefaultFileDialog.qml @@ -469,8 +469,8 @@ AbstractFileDialog { id: okButton text: root.selectFolder ? qsTr("Choose") : (selectExisting ? qsTr("Open") : qsTr("Save")) onClicked: { - if (view.model.isFolder(view.currentIndex) && !selectFolder) - dirDown(view.model.get(view.currentIndex, "filePath")) + if (view.model.isFolder(view.currentRow) && !selectFolder) + dirDown(view.model.get(view.currentRow, "filePath")) else if (!(root.selectExisting)) currentPathField.doAccept() else -- cgit v1.2.1 From 32831880512272968e26ed6a85a5cd98ecbda3b6 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Wed, 23 Nov 2016 10:08:38 +0100 Subject: Fixed possible crash due to out of memory on ARM When diving two real values we can obtain an Infinite value. The qml engine perform an implicit conversion (and silent) if this value is directly assigned to an "int" property. On Arm the conversion of Infinite to int gives the value +2147483648. Thus the Repeater model instantiate 2147483648 items and crashes. By morphing both the rowHeight and paddedRowCount properties to "real" we keep the Infinite value semantic. This allows the Repeater to handle properly the Infinite case. Task-number: QTBUG-57283 Change-Id: I376f9ca497bea1f1aab413d1c1ba87d918b73fbb Reviewed-by: Mitch Curtis --- src/controls/Private/BasicTableView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml index afec226d..b919f135 100644 --- a/src/controls/Private/BasicTableView.qml +++ b/src/controls/Private/BasicTableView.qml @@ -471,8 +471,8 @@ ScrollView { property bool pressed: false } } - property int rowHeight: rowSizeItem.implicitHeight - property int paddedRowCount: height/rowHeight + property int rowHeight: Math.floor(rowSizeItem.implicitHeight) + property int paddedRowCount: rowHeight != 0 ? height/rowHeight : 0 y: listView.contentHeight - listView.contentY + listView.originY width: parent.width -- cgit v1.2.1