[Qt-interest] Need some practical advice here... model/view framework

Eric Clark eclark at ara.com
Thu Jul 2 22:11:32 CEST 2009


I would inherit the QAbstractItemModel class myself and implement the setData function to allow setting of the data.

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Patric
Sent: Thursday, July 02, 2009 3:09 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Need some practical advice here... model/view framework

Hello guys,
I need an advice here...
I have to create a table, and the items in it have to be taken from a text file.
For example, the text file consists of :

value1::value2::value3
value1::value2::value3
value1::value2::value3
...

And every row in the table should be a row in the file. I need to edit the file directly from the table, to select rows, etc.

I was reading the documentation for the model/view framework, but still some things are unclear to me. (I think it'll be best to use the view based, not the widget based).

So please, give me some practical advice what model to use.
I would use QTableView for the view...

But for the model, I understand I have three options.
To use the ready QStringListModel, the QStandartItemModel or to implement a model by myself. I'm confused. I didn't actually understand when I should use QStandartItemModel, usually we need only string data in out views.

What do you think, what should I use in my case ?

Thank you very much in advance !

Patric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090702/51a07b77/attachment.html 


More information about the Qt-interest-old mailing list