R
R
Robotex2014-08-11 02:23:44
Qt
Robotex, 2014-08-11 02:23:44

QML: How to update TableView appearance after context menu is displayed?

I'm trying to show a context menu (standard Menu component) and still select the right clicked row:

downloadContextMenu.popup()
tableView.selection.clear()
tableView.selection.select(row)

But there is a problem: the TableView will redraw and display the selected row only after I move the mouse over something else, like a button. In this case, if you first select, and then display the menu:
tableView.selection.clear()
tableView.selection.select(row)
downloadContextMenu.popup()

then the problem will be when it is reopened (click outside the menu to close it, and then right click again. At the same time, you can’t click on the line with the left button, otherwise it will redraw and work as it should). Here's how to fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question