Results 1 to 4 of 4

Thread: Simple QVector sort?

  1. #1
    Join Date
    Jul 2009
    Posts
    25
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Simple QVector sort?

    Is there a simple method to sort the elements in a QVector in Qt4? I see that there's no dedicated command (unlike in previous Qt versions). Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Simple QVector sort?

    See qSort() and qStableSort().

  3. The following user says thank you to Lykurg for this useful post:

    bizmopeen (16th February 2010)

  4. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Simple QVector sort?

    use qSort.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. The following user says thank you to spirit for this useful post:

    bizmopeen (16th February 2010)

  6. #4
    Join Date
    Jul 2009
    Posts
    25
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Simple QVector sort?

    Thanks, all!

Similar Threads

  1. can't get right data after sort
    By wirasto in forum Qt Programming
    Replies: 5
    Last Post: 28th June 2009, 18:19
  2. QAbstractTableModel and sort
    By foxyproxy in forum Qt Programming
    Replies: 7
    Last Post: 25th March 2008, 09:30
  3. How to sort QMap
    By mamyte03@gmail.com in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2007, 10:11
  4. How to sort a QComboBox in Qt4
    By guenthk in forum Qt Programming
    Replies: 7
    Last Post: 25th September 2006, 18:35
  5. Sort datatable
    By zlatko in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2006, 08:43

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.