I have implemented my own (very simple though) QStandardItemModel-qtableview.

Qt Code:
  1. #ifndef PARAMETERMODEL_H
  2. #define PARAMETERMODEL_H
  3. #include <QtGui>
  4. #include <QtSql/QSqlTableModel>
  5. #include <QtSql/QSqlRelationalDelegate>
  6. #include <QtSql/QSqlQuery>
  7. #include <QMessageBox>
  8. #include <QComboBox>
  9. #include <QWidget>
  10.  
  11.  
  12. #include <comboboxDelegates.h>
  13. #include <spinboxdelegates.h>
  14.  
  15. class ParameterModel : public QWidget
  16. {
  17. Q_OBJECT
  18.  
  19. public:
  20. ParameterModel( QWidget *parent = 0);
  21.  
  22. QTableView* tableView;
  23.  
  24.  
  25.  
  26. public slots:
  27. void addNewRow();
  28. void addNewRow2();
  29.  
  30. void deleteRow(int);
  31. private:
  32. QVBoxLayout* vboxlayout;
  33.  
  34. ActionComboBoxDelegate *actionComboBoxDelegate;
  35. TypeComboBoxDelegate *typeComboBoxDelegate;
  36. StatusComboBoxDelegate *statusComboBoxDelegate;
  37.  
  38. VrotSpinBoxDelegate *vrotSpinBoxDelegate;
  39. SigmaSpinBoxDelegate *sigmaSpinBoxDelegate;
  40. GammaSpinBoxDelegate *gammaSpinBoxDelegate;
  41. XiSpinBoxDelegate *xiSpinBoxDelegate;
  42. SemitSpinBoxDelegate *semitSpinBoxDelegate;
  43. DlradSpinBoxDelegate *dlradSpinBoxDelegate;
  44. LlabSpinBoxDelegate *llabSpinBoxDelegate;
  45. AWSpinBoxDelegate *aWSpinBoxDelegate;
  46. EiSpinBoxDelegate *eiSpinBoxDelegate;
  47.  
  48.  
  49. };
  50. #endif // PARAMETERMODEL_H
To copy to clipboard, switch view to plain text mode 
I usually need 3-5 of these, which I append them to a QVector

Qt Code:
  1. QVector<ParameterModel*>* modelVector;
To copy to clipboard, switch view to plain text mode 

My problem is that when I am trying to set the data to the items, it gets slow

Qt Code:
  1. QElapsedTimer t;
  2. t.start();
  3. if ( column_index < 4 )
  4. modelVector->at(model_index)->model->item(row_index,column_index)->setData(line);
  5. qDebug()<<t.elapsed();
  6. t.start();
  7. if ( column_index > 4 )
  8. modelVector->at(model_index)->model->item(row_index,column_index)->setData(line.toDouble());
  9. qDebug()<<t.elapsed();
To copy to clipboard, switch view to plain text mode 

The timers here give values 500-600. The strange thing is that the output is usually like this (I run it multiple times)
0
593
....
577
0
....
562
0
etc,etc.
What can I do to make it faster?