Hii everyone,
I have a TableView, and I want to delete a row
First you must select a row and click on Button delete
If the row is not selected ---> msg : No row is selected
My question is : Is there a way to know if the row is selected or no ???
Hii everyone,
I have a TableView, and I want to delete a row
First you must select a row and click on Button delete
If the row is not selected ---> msg : No row is selected
My question is : Is there a way to know if the row is selected or no ???
You can access the view's selection via its "selection" property.
In case you also make the selected row the current row, e.g. through code in the cell's delegate, the you could also check "currentRow"
Cheers,
_
Is the view.currentRow always returns = -1, IF no Row is selected ??
For me, the code below works fine
Qt Code:
if(view.currentRow == -1){ console.log("No Row is selected !!") } else{ console.log("Row is selected OK") }To copy to clipboard, switch view to plain text mode
currentRow is not related to selection unless your code makes it so.
Do you set currentRow, e.g. in side the delegate?
Cheers,
_
Bookmarks