F
F
FreezkoSS2019-11-25 10:46:10
Qt
FreezkoSS, 2019-11-25 10:46:10

How to get id from TableView field?

5ddb8629eeb1e133108566.png
5ddb86347cfb9414923143.png
Hello, I'm making a request to enter data into a table and I wanted the field with employees to be selected from the TableView, but no matter how I tried to pull out the id, nothing worked, maybe someone has encountered this problem and knows how to get from the displayed records in the TableView id of the selected field when clicking on it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ittakir, 2019-11-25
@FreezkoSS

It is not QTableView that sends a signal about a change in the currently selected item, but its QItemSelectionModel.
Subscribe to signal
And then from QModelIndex you get the necessary data, such as text, row, column.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question