Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.1
-
None
-
Windows 7, Linux
Description
First issue: The currentRow value is set to its previous value if the window lost its focus
- select e.g. the second entry in table
- click on "clear selection". CurrentRow is set to -1 and highlight disappears
- Click on another window and then back to the example application.
- After the example application has the focus again, the previous selected row is highlighted. I expected that no row is highlighted.
Second issue: The first row is selected after setting a new model
- restart the application
- select the second entry in table
- click on "set model" (now a new model is set)
- Now, the first entry is highlighted. I expected that no row is highlighted.
The issues can be reproduced with following code:
import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Dialogs 1.0 import QtQuick.Window 2.0 ApplicationWindow { width: 200 height: 200 ListModel { id: firstModel ListElement { name: "test 1" } ListElement { name: "test 2" } } ListModel { id: secondModel ListElement { name: "test 3" } ListElement { name: "test 4" } } Column { Row { Button { text: "clear selection" onClicked: { table.currentRow = -1 } } Button { text: "set model" onClicked: { table.model = secondModel } } } TableView { id: table TableViewColumn { role: "name" title: "Name" } model: firstModel onCurrentRowChanged: { console.log("currentRow: "+ table.currentRow) console.trace() } } } }