elcuco
18th October 2009, 10:49
I am trying to create a tree based model in Qt4, and I am getting into problems. I started by making a class which can load this new format, and so far so good. Then I assumed it will be easy to "stick" it into a model, but I then found that model more or less demand that you use QObjects (or use some other method for guessing the parent).
So I started, and wrote in a paper set of classes and demo functions that will be a QObject connector (proxy pattern, more or less) that copies the data internally. Then I realized I can have less code by eliminating the original code, and doing this completely in QObjects.
But now I see that I am linking myself to Qt4 only... and from a pure software engineering point of view this is wrong.
Now to do this right, I need to look into 3-5 real-life examples, or demos for MVC in Qt4. Can anyone point me to some good examples? The ones in Qt4 are not what I am looking for. Well... another option might be porting the format to XML internally, and then the mode will become easy as there are examples in Qt4 for for this kind of models... but I am not that happy about this scenario.
So I started, and wrote in a paper set of classes and demo functions that will be a QObject connector (proxy pattern, more or less) that copies the data internally. Then I realized I can have less code by eliminating the original code, and doing this completely in QObjects.
But now I see that I am linking myself to Qt4 only... and from a pure software engineering point of view this is wrong.
Now to do this right, I need to look into 3-5 real-life examples, or demos for MVC in Qt4. Can anyone point me to some good examples? The ones in Qt4 are not what I am looking for. Well... another option might be porting the format to XML internally, and then the mode will become easy as there are examples in Qt4 for for this kind of models... but I am not that happy about this scenario.