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?
Forum Updated to NodeBB v4.3 + New Features

How to insert two List of QStandardItem into QStandardItemModel?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.7k Views 1 Watching
  • 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 4 Aug 2011, 08:44 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 4 Aug 2011, 09:05 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

      2/2

      4 Aug 2011, 09:05

      • Login

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