Hi,

Having to do some modifications to some code someone did well over 10 months ago. Part of this is to sort some data in ascending order within a QTableView. Now I noticed it uses a model ( QAbstractTableModel ). The data seems to be stored within a QList. The objects that are stored in this QList are of the following :

Qt Code:
  1. class ASignal
  2. {
  3. public:
  4. ASignal() { }
  5. char name[256];
  6. char unit[256];
  7. char strECU[20];
  8. double dmaximum;
  9. double dminimum;
  10. double dfactor;
  11. double doffset;
  12. UINT istartbit;
  13. UINT ilength;
  14. double realvalue;
  15. long rawvalue;
  16. double byteorder;
  17. };
To copy to clipboard, switch view to plain text mode 

I want to sort this QList<ASignal*> on the member name. What is the best and quickest way of achieving this? Before the data is inserted into the QList should I do some checking and use swap etc?

Kind regards,
Steve