Hi,
I have a problem. This is the code of my application:

QtCode:
Qt Code:
  1. QList<QStandardItem*> items1;
  2. QList<QStandardItem*> items2;
  3. name->setText("1");
  4. rank->setText("2");
  5. profile->setText("3");
  6. items.append(name);
  7. items.append(rank);
  8. items.append(profile);
  9. model->appendRow(items);
  10. qDebug() <<"List: " << items.at(2)->text();
  11. name->setText("4");
  12. rank->setText("5");
  13. profile->setText("6");
  14. items2.append(name);
  15. items2.append(rank);
  16. items2.append(profile);
  17. qDebug() <<"List: " << items2.at(2)->text();
  18. model->appendRow(items2);
To copy to clipboard, switch view to plain text mode 

I use QStandardItemModel in my QTableView.

Whit this code i should be this table:
1 2 3
4 5 6.

But I have this outup and this error:

Qt Code:
  1. Output:
  2.  
  3. List: "3"
  4. List: "6"
  5. QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137d0
  6. QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137c0
  7. QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137b0
To copy to clipboard, switch view to plain text mode 

My final table is:

4 5 6
[blank] [blank] [blank]

How i can solve this problem?


Thanks, bye