Help in software design and coding
-
I'm developing a software and I need your help to design something with me as I'm a beginner in a few things (read beginner in model-view-delegate). In order to simplify things here I'm going to be using not real classes but metaphorical ones.
The reason is that I haven't coded yet the thing I have in mind and I need help understanding a few things.The base idea: create a tree view based on the output from the class
C
.The class
C
is a kind of manager that calls a method fromA
andB
, theA
has a list ofD
andB
has a list ofE
, whereE
is a kind of a container just likeA
andB
but holds a list ofD
.And above that is the three how it would look like.
The question is: what would be the best way to do that?
1º - Using an interface for
D
andE
so I can return a list of a certain interface onC
to the model.
2º - UseQVariant
to return eitherD
orE
as a list fromC
to the model.I don't know what would be the best option.
I would probably need to create a custom model to handle the
QVariant
orInterface
right?HELP ME PLEASE. SOS.
-
Is there anyone to help me with that?
-
Hi,
First thing: Introduction to Model/View Programming. This is a mandatory read when you want to get started with model view programming with Qt.
From what you describe the model you would need to implement would be a wrapper around your structure of data. So basically you must first ensure that said structure is coherent and that you can manipulate it the way you need it. Once that done you can put a model on top of it.
-
On a side note, please be patient. Allow up to 24 hours before bumping your own thread. People answering do it on their own time and they don't live necessarily in the same timezone as you. Furthermore, it's the weekend.