Results 1 to 3 of 3

Thread: Best way to represent struct using Qt containers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Best way to represent struct using Qt containers

    I need to have array of oneitems.
    So why dont you use QList ?
    Qt Code:
    1. QList<oneitem> list;
    To copy to clipboard, switch view to plain text mode 
    Btw. you can skip the "struct" keyword when declaring the variable:
    Qt Code:
    1. struct itemdetail {
    2. double a;
    3. double b;
    4. } ;
    5.  
    6. struct oneitem
    7. {
    8. itemdetail originalitem; // 'struct' not needed here
    9. QString desc;
    10. QMap<int, QPair<itemdetail, int> > growth; // 'struct' not needed
    11. };
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to stampede for this useful post:

    rajil.s (25th January 2012)

Similar Threads

  1. Replies: 5
    Last Post: 10th May 2011, 20:38
  2. What do pointer values actually represent?
    By hackerNovitiate in forum General Programming
    Replies: 2
    Last Post: 26th February 2011, 21:57
  3. Represent a bit vector
    By danilodsp in forum Newbie
    Replies: 3
    Last Post: 20th October 2010, 16:10
  4. represent svg in tab view
    By Dilshad in forum Newbie
    Replies: 5
    Last Post: 27th July 2010, 09:47
  5. how to represent a graph?
    By harakiri in forum Qt Programming
    Replies: 2
    Last Post: 4th August 2009, 14:37

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
  •  
Qt is a trademark of The Qt Company.