Hi, guys!
I'm writing a book-collection manager now in QT4. And I have a question:
should I use a custom (QAbstractItemModel...) model in my app when I read/save data in xml file to/from my QTreeWidget?
Thanks in advance!
Hi, guys!
I'm writing a book-collection manager now in QT4. And I have a question:
should I use a custom (QAbstractItemModel...) model in my app when I read/save data in xml file to/from my QTreeWidget?
Thanks in advance!
Yes, but you will have to use QTreeView instead of QTreeWidget.
But why, I don't understand?
And another question in advance - how to read the data from the xml file to the model?
Because QTreeWidget has its own predefined model that uses QTreeWidgetItems.Originally Posted by Xagen
http://www.qtcentre.org/forum/showthread.php?t=1297Originally Posted by Xagen
I understood this.Originally Posted by jacek
I was asking why to use model?
What are the pluses of using model?
You can share it between multiple views and it can implement an interface that is more useful for you than operating on QTreeWidgetItems.
Aha.
Thanks.
Bookmarks