PDA

View Full Version : Linked List and GUI



dc_ix
6th June 2017, 06:46
Hello,

New to making programs that have a GUI and I am having trouble getting the hang of it for a specific project. I need to create a program where a user uses a GUI where they can enter any of the following types of data (int, string, char, double) on a textedit widget and then they can press a button of their choosing to create or manipulate a linked list of that data type entered by using functions like push_front, push_back, remove doubles etc. The link list class template is already crated and its not my concern. It works fine if I just run it without a GUI. What is my concern is displaying the list on a textbrowsing widget. I understand that a textedit takes in a Qstring that I need to convert that into a datatyoe a user whises to make, but what I cant figure out is how to turn that linked list back to a Qstring to have it displayed on the textbrowser widget. Am I thinking about it the wrong way? Should I use QLinkedList? If so is there any examples that any of you can point me to? Thanks for the help and your time.

wysota
6th June 2017, 21:43
Is it a requirement to use a text browsing widget? Why not a QListView instead? You could properly wrap your data in a model.