Results 1 to 3 of 3

Thread: [closed] How to fill QList with struct data more elegant

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2014
    Qt products
    MacOS X

    Default [closed] How to fill QList with struct data more elegant


    I have a QList with a custom data type. All I found on filling the list looked like this:
    Qt Code:
    1. customStruct newStruct;
    2. newStruct.prperty1 = xy;
    3. newStruct.prperty2 = xy;
    4. newStruct.prperty3 = xy;
    5. [...]
    6. newStruct.prpertyN = xy;
    7. list.append(newStruct);
    To copy to clipboard, switch view to plain text mode 
    Is there a more elegant way to do that? So that everything is on one line or maybe two? Or does one line only work if I create a new class?
    Last edited by KeineAhnung; 8th May 2014 at 10:28.

Similar Threads

  1. QList<struct>
    By Axsis in forum Newbie
    Replies: 11
    Last Post: 12th October 2015, 08:48
  2. how to fill Qlist in minimum time
    By shivendra46d in forum Newbie
    Replies: 2
    Last Post: 26th August 2013, 13:08
  3. remove struct from qlist
    By mero in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2012, 15:58
  4. How to fill a QList<struct> ?
    By falconium in forum Newbie
    Replies: 1
    Last Post: 1st March 2011, 22:59
  5. sharing struct data throughout program
    By vonCZ in forum Newbie
    Replies: 3
    Last Post: 9th July 2007, 18:21

Tags for this Thread


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.