
well...ok you are totally right, my intention was to focus on the setData function. Otherwise I had to present perhaps too many lines of code that probably noone would get into the trouble to read.
Anyway, the fact is that I am implementing a big-idea-math tool, which I had never realized its actual complexity (perhaps not even now). It is when you are a part of a team and every now and then it is revealed to you another very-very important part of the algorithm that had never been mentioned before
When I started I didn't know the existence of QT, that's why all these come from outer space and seem loosely designed. Miraculously, after really hard time in front of the computer it works so far fine.
You've implemented a QWidget, which for some strange reason you call ParameterModel, and which contains public member variables of types pointer to QStandardItemModel and pointer to QTableView, along with a bunch of pointers to child widgets.
Regardless the fact that I wanted a custom QStandardItemModel and I implemented a QWidget (I really can't remember why I did this, I think I needed some functions of QWidget that were not available in QStandardItemModel, has this any performance effect?) the bunch of pointers are my delegates. All the examples I found were declaring the delegates in this way.
Then, floating out in interplanetary space, you have a pointer to a QVector of pointers to ParameterModel instances, and in another piece of interplanetary space, you have some code that uses a pointer from that vector to access a model that you set some data into.
Come on, this can be easily guessed
, I have a Vector which stores ParameterModels dynamically. While on run the user can create or destroy these models.
You don't bother to show us how you create that vector, how you create the instances of the ParameterModel widgets inside it or the children of those widgets,
modelVector = new QVector<ParameterModel*>(0);
.............
ParameterModel* m = new ParameterModel;
modelVector->append(m);
...............
modelVector = new QVector<ParameterModel*>(0);
.............
ParameterModel* m = new ParameterModel;
modelVector->append(m);
...............
To copy to clipboard, switch view to plain text mode
how you arrive at the model_index, row_index, and column_index values for the item you are trying to change.
this is a detail, while the program runs, these indexes work well,trust me!
Just code floating in space, drifting along, trying to stay out of the way of planets, asteroids, and comets as it spirals into the Sun...
well, I have to tell you that the last half an hour I 've abandoned the keyboard and I have caught my guitar to write a song with these lyrics 
Now...can I make this thing set the model data a bit faster?
Bookmarks