Results 1 to 2 of 2

Thread: QStandardItem Error: Ignoring duplicate insertion problem

  1. #1
    Join Date
    May 2010
    Posts
    46
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation QStandardItem Error: Ignoring duplicate insertion problem

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QStandardItem Error: Ignoring duplicate insertion problem

    You need to create a new set of items for the second row just like you did with the first row.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 5th October 2009, 17:40
  2. Ignoring zoomin/zoom out in the GraphicsView
    By maverick_pol in forum Qt Programming
    Replies: 5
    Last Post: 20th July 2007, 07:42
  3. Qtoolbutton-ignoring mouse events
    By rvenugopal in forum Qt Programming
    Replies: 2
    Last Post: 26th December 2006, 23:12
  4. Replies: 3
    Last Post: 22nd June 2006, 17:27

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.