Goug
2nd December 2011, 05:34
I've got a model/view set up and for the most part, it's working pretty well, but I'm uncertain about one of the choices I made. It occured to me that constantly converting to QVariant in the data method for visual updates was probably more expensive than storing the data in QVariant's inside the model and then just returning the data as-is. The downside is that I keep making mistakes external to the model. In a few cases, I've changed the base data type of a column, but then I have to find all of the places where I extract the data and fix up the "toInt", "toString" or whatever.
I know that Qt does some pretty incredible things to improve performance, and I'm wondering if I'm shooting myself in the foot worrying about the QVariant conversion. My code would be more reliable using non-variant types in the model because my property methods would change types and the compiler would flag most everything that needs to be fixed up.
Thoughts?
Thanks,
Doug
I know that Qt does some pretty incredible things to improve performance, and I'm wondering if I'm shooting myself in the foot worrying about the QVariant conversion. My code would be more reliable using non-variant types in the model because my property methods would change types and the compiler would flag most everything that needs to be fixed up.
Thoughts?
Thanks,
Doug