Hi all,
when i want to get the fields of one table in database, i use this code as follows:
Qt Code:
  1. QSqlTableModel tableModel;
  2. tableModel->setTable(tableA);
  3. tableModel->select();
  4. QSqlRecord rec = tableModel->record();
  5. for(int i=0, i<rec.count (), i++)
  6. {
  7. QSqlField field = rec.field(i);
  8. QString fieldName = field.fieldName();
  9. qDebug()<<fieldName;
  10. // other
  11. // ....
  12. }
To copy to clipboard, switch view to plain text mode 
here is my question, when i frequently open multiple talbes like this, sometimes i find that qDebug the fields sequence of table is not as the same as the table in database(e.g Oracle) , so anyone knows the reseason?
Thank you very much!