2 Attachment(s)
how to implement list of lists and display it
Hello, firstly I have to tell that im absolutely beginner in Qt .
My task is to create program which supports a shop. At the beginning i'd like to create a list of products and display it on the screen but i have no idea how to do it. There are a lots of libs and documentation is very extensive that i dont know what and HOW to use it.
My problem on pics looks like this:
Attachment 8974
and as a result i'd like to get view like this:
Attachment 8975
Re: how to implement list of lists and display it
Re: how to implement list of lists and display it
one more question, how can i save/load my whole complicated structure to file ? i've found s11n for c++ but maybe Qt involves some library ?
Re: how to implement list of lists and display it
One simple way is to use QSettings, it supports most of the Qt types already.
One other you can serialize data into XML stream and save it.
Re: how to implement list of lists and display it
Quote:
Originally Posted by
Santosh Reddy
One simple way is to use QSettings, it supports most of the Qt types already.
One other you can serialize data into XML stream and save it.
im not sure that QSettings lives up my expectations because as i've read in documentation it is generally used for saving/reading application settings.
in my case, i'd like to read/write whole data from lists etc.
Re: how to implement list of lists and display it
Re: how to implement list of lists and display it
Quote:
Originally Posted by
amleto
have you tried it?
no, i've looked into documenation - http://qt-project.org/doc/qt-4.8/qsettings.html
Useful method which I see here are beginReadArray and beginWriteArray . okei but i see i should use it.
Re: how to implement list of lists and display it
and what is wrong with
http://doc.qt.io/qt-4.8/qsettings.html#setValue
?
(you can put quite a lot inside a QVariant)