[SOLVED] What would be the best way to display a list of items in Qt
-
Ok, it looks like this is a complicated task which I'm not prepared for yet.
So far the best solution I think is to use the QTextEdit, load the .txt file, change as needed and save it again.
Last question, if I go with the QTextEdit I'm describing here, what would be the best way to style the content in the .txt file? Do I need to work with an HTML file instead?
Side note: I'm very proficient in HTML and CSS.
Thanks
-
I got my own answer on this one, it looks like I can work with an HTML file and use embedded CSS for styling.
Thank you for your time, believe it or not I learn a lot about this topic, my limitations about .txt files etc.
Thanks a lot
-
150 people, all editing the same file containing data? That sounds like a job for a database...
-
No!
150 Items on the list.
10 Users.The file will only be updated once or twice a YEAR by a random user.
Thanks a lot
-
Still sounds like you want a database to me:-)
-
Thanks for the advice!
-
You might or you might not want a database, but using a database as a storage mechism will not help you solve the display issue. They are independent.
-
How about "QSqlTabelModel":http://qt-project.org/doc/qt-4.8/qsqltablemodel.html and "QTableView":http://qt-project.org/doc/qt-4.8/qtableview.html? I haven't used this combination, but combined with QSqlDatabase it sounds quite useful.
-
It is useful, but it does not provide the grouping that fs_tigre is looking for. QSqlTableModel provides a table, as the name already implies, while you would need a tree model to create the grouping. At least in the Qt widget world. QML of course has a list view that has grouping build in based on a flat list...
-
Oh you're right I forgot about the hierachy.
-
Thank you all, I'm actually using HTML and loading and saving the whole file every time a change is made.