Request for comments on Qt4

I have been designing a network simulator for a number of months now and went ahead designing the underlying data structure and functionality. It has used the std cin cout as a console program for its interaction with the outside world.

I decided a couple weeks ago it is time to add a Gui interface and chose Qt as the choice. I still believe this is the best choice I can make for a number of reasons but have a dilemma. My code relies on polymorphism and layered introduction of private members at different subclass levels. It appears that the model/view architecture likes the data structure to have a QVector<QVariant> approach for the model. I'm using the QAbstractItemModel. I'm thinking of placing all the data as protected in the base class and setting up a static indexing system for the QVector<QVariant> since models like row/column look.

Does this make sense or is there a better alternative?
WxWidgets :P QT is not multi-platform unless you buy license.
@Zaita:
QT is not multi-platform unless you buy license

Yes, it is! It's available as GPL on all platforms.

@awhite1159:
Qt doesn't force you to change your data structure. There are many alternatives. If you want to use QVector<QVariant>, maybe you can write a wrapper class that contains a pointer to your polymorphic class, and store that in the vector.

Otherwise, you can use whatever you want to implement the model. I assume you are trying to implement your own model class by deriving from QAbstractItemModel.

What do you mean by "model/view architecture likes the data structure to have a QVector<QVariant>". Are you following the examples? Those are only examples, you can use whatever you like. The only thing you must ensure is that you supply the correct dimensions (size) of the model, and return the correct data for each row/column.

BTW: I think you made the right choice with Qt!
Last edited on
Topic archived. No new replies allowed.