Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to insert two List of QStandardItem into QStandardItemModel?

How to insert two List of QStandardItem into QStandardItemModel?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zither
    wrote on last edited by
    #1

    Dear all,

    I try to insert two QStandardItem List.
    @QList<QStandardItem*>items1;
    QList<QStandardItem*>items2;

    QStandardModel.insertColumn(items1);
    QStandardModel.insertColumn(items2);@
    What I want is
    @items1
    items1
    items1
    items1
    items2
    items2
    items2
    items2@

    But what I got is
    @items2 items1
    items2 items1
    items2 items1
    items2 items1@

    How can I fix that. items1 & items2 can't combine because they are generated with different time & places..
    Thanks

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      Of course two calls to insertColumn will insert two different columns; use a foreach + appendRow.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved