2

I have this table view where I write some data in different columns. I am adding the data by writing it in text boxes and clicking the "add" button. And I am modifying it by selecting a row in the table view, copying the data into the text boxes, editing it and pressing the "save" button.

The data from the text boxes apart from being sent to the table view is also being used for other calculations in my application.

I would like to be able to modify the data directly on the table view and then send the changed data to do the calculations that I need in another class - in my case.

For now I can modify the data on the table view but how could I send the signal that the data has been modified in the view?

Any ideas?

1 Answer 1

2

The data modification is handled by the model in Qt's Model/View framework.

To do what you want, get a handle to your TableView's model (via it's model() member), and connect a slot to the model's dataChanged signal.

This signal is emitted whenever the data in an existing item changes.

(There's a different signal if you want to react on column or row header changes.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.