I want to set the text of the horizontal headers in my QTableView using user typed text in several QLineEdit widgets. I'm new to model-view programming and Qt framework so I am not sure if this is the correct way to do it, but what I've got working so far is that in my MainWindow class the widget with the QLineEdits is set as the central widget and then .text() is called on all the QLineEdits. The result is passed to a list and the list of strings is passed as parameter to my model class (QAbstractTableModel). In the model I call headerData() function to display the strings in the right column headers. However since the QLineEdits are empty initially nothing is shown. Now when I try changing the text in the QLineEdit it does not update the headers and thus makes the headers stay empty. Which signals and slots should I use to connect QLineEdit with my model?
Appreciate any help.