Hi,
I have a problem. This is the code of my application:
QtCode:
QList<QStandardItem*> items1;
QList<QStandardItem*> items2;
name->setText("1");
rank->setText("2");
profile->setText("3");
items.append(name);
items.append(rank);
items.append(profile);
model->appendRow(items);
qDebug() <<"List: " << items.at(2)->text();
name->setText("4");
rank->setText("5");
profile->setText("6");
items2.append(name);
items2.append(rank);
items2.append(profile);
qDebug() <<"List: " << items2.at(2)->text();
model->appendRow(items2);
QList<QStandardItem*> items1;
QList<QStandardItem*> items2;
name->setText("1");
rank->setText("2");
profile->setText("3");
items.append(name);
items.append(rank);
items.append(profile);
model->appendRow(items);
qDebug() <<"List: " << items.at(2)->text();
name->setText("4");
rank->setText("5");
profile->setText("6");
items2.append(name);
items2.append(rank);
items2.append(profile);
qDebug() <<"List: " << items2.at(2)->text();
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:
Output:
List: "3"
List: "6"
QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137d0
QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137c0
QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137b0
Output:
List: "3"
List: "6"
QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137d0
QStandardItem::insertRows: Ignoring duplicate insertion of item 0x38137c0
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
Bookmarks