PDA

View Full Version : View/edit database in a table and in a form



igorko
13th June 2006, 13:56
Dear All,

I have a task where a user should be able to view/edit a database in both table and form style.
I have made a model for my data and it works fine with QTableView.
But I have problems with viewing/editing records in a form-like style.Forms are to be made with QDesigner.
QLineEdit-s, QComboBox-es, e.t.c. should represent fields from database querries.
I tried to inherit QAbstractItemView (as shown in PieView example)
but so far I have no luck.

I would highly appreciate you giving me a good hint how to do it and would be gratefull if you could share your experience.

Thanks a million in advance.

Qt4.1

wysota
16th June 2006, 09:09
If you search the forum, you'll notice a thread or two where I wrote about implementing a controller for standalone widgets to act as small model views where each widget is responsible for a single item (or even a single role of an item). You should do it this way too. Of course if you insist on implementing a complete view, it'll work nicely too. In that case if you tell us what problems you have, we'll try to help you.