Results 1 to 11 of 11

Thread: Comparing two QList with date time as parameter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2013
    Posts
    40
    Thanks
    6
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Post Re: Comparing two QList with date time as parameter

    Quote Originally Posted by wysota View Post
    What do you mean by "two lists of different objects"? Do you wish to get one list as a result or two separate lists, one for each source list?
    It is two different lists.(To be compared by specific value i.e. CREATION_TIME)
    e.g. QList<Student> & QList<Employee>.

    PS : And I think the result will be stored in the other list after comparison.
    for e.g.:
    Qt Code:
    1. QList<QObject> listNew;
    2. QList<Employee> listEmp;
    3. QList<Student> listStud;
    4.  
    5. for(i=0;;i++)
    6. if(listEmp.at(i).creTime<listStud.at(i).creTime)
    7. listNew.add(listEmp.at(i));
    8. else
    9. listNew.add(listStud.at(i));
    To copy to clipboard, switch view to plain text mode 

    Pls ignore the mistakes as I am new to this technology & know very less about this.

    Thanks.
    Last edited by rohitkk; 9th June 2014 at 10:23.

Similar Threads

  1. Replies: 0
    Last Post: 5th October 2012, 11:17
  2. Date Time
    By javed_alam786 in forum Qt Programming
    Replies: 2
    Last Post: 11th May 2011, 14:52
  3. other time...can't get date
    By mmm286 in forum Newbie
    Replies: 7
    Last Post: 4th March 2010, 15:53
  4. Date Time
    By starcontrol in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2008, 11:02

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