Results 1 to 2 of 2

Thread: How to sort a class in qt

  1. #1
    Senior Member sarvani's Avatar
    Join Date
    May 2012
    Posts
    173

    How to sort a class in qt

    I have a class as shown below
    Code:
    class clsA {
    
      int Val1;
      int Val2;
      QString Val3;
    };

    I have data in the class before sort :

    Code:
    [1,5,'AAA']
    [5,3,'CAR']
    [2,2,'BEE']
    [7,8,'ERE']
    [6,3,'DER']

    I need after sort X and Y.

    Code:
    [1,5,'AAA']
    [2,2,'BEE']
    [5,3,'CAR']
    [6,3,'DER']
    [7,8,'ERE']
    help an tell me, If you got any Ideas..
    Thank you.

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Posts
    295
    Blog Entries
    5
    Code:
    Qsort
    is the function available in qt to sort the data

Similar Threads

  1. Stable sort example in VC++
    By Maha in forum Visual C++ 5.0 Sample source code
    Replies: 0
    Last Post: 03-04-2013, 11:10 AM
  2. Merge sort example in C
    By Bandhavi in forum C, CPP Programs
    Replies: 0
    Last Post: 10-15-2012, 12:19 PM
  3. Quick sort example in C
    By Bandhavi in forum C, CPP Programs
    Replies: 0
    Last Post: 10-15-2012, 12:15 PM
  4. Sort the array using bubble sort algorithm in c
    By Bandhavi in forum Programming languages
    Replies: 2
    Last Post: 07-12-2012, 09:20 AM

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
  •