PDA

View Full Version : model/view: how do i get the data from a Qtableview model?



fatecasino
24th February 2011, 00:16
Consider that I have a simple qtableview model/view.

two columns: one for name and one for surname
several rows, for instance 4.

Ok, the program runs and the user writes in some data of names and surnames.
Now I want for instance to have an external Qlineedit that will print out a simple message for row No1, like:


Name: John ----- Surname: Smith

Is there a built in signal to connect the model data to the slot of the Qlineedit setText(QString).

I am trying to build a simple program to understand the model/view architecture in Qt.
I have read several times the corresponding tutorials, but without building my own simple example I cannot understand it!

Thanks in advance for your time and any small code example is more than welcome!

tbscope
24th February 2011, 05:54
Try: http://doc.qt.nokia.com/4.7/qdatawidgetmapper.html