Results 1 to 7 of 7

Thread: When sort the lists?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question When sort the lists?

    Hi all, In my app I use a QTabWidget with 6 tab widgets. Each of them consists in a QListWidget. I fill these lists with the thumbnailed images from a list of files (assigning a list using the image format/type). I want all the QListWidgets to be sorted in ascending order using the name of the image file. Also, I want to set in the text of each tab the name of the format/type of the images that its list contains and the number of images in the list in parenthesis. My question is: when do you think that could be better/cleaner to sort the lists and set the text of the tabs?
    A) After inserting each image as QListWidgetItem in the correct QListWidget on the loop that reads each file from the list of files to insert in the lists.
    B) Once all the images in the list of files have been inserted in the lists.
    In the first case, every time that a new image is inserted in a QListWidget, this list is sorted (which could be inefficient) and fixed the text of the tab. But, differing from the second option, it's not necesary to loop through all the tabs at the end to do it. What do you think that's better?
    Last edited by SkripT; 14th April 2006 at 00:54.

Similar Threads

  1. QAbstractTableModel and sort
    By foxyproxy in forum Qt Programming
    Replies: 7
    Last Post: 25th March 2008, 09:30
  2. QTreeWidget (Row Check, Custom Sort)
    By AaronMK in forum Qt Programming
    Replies: 3
    Last Post: 8th January 2008, 15:55
  3. How to sort the treeWidget item according to size and date
    By santosh.kumar in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2007, 10:32
  4. QTreeWidget->clear() causing crash after sort
    By Chuk in forum Qt Programming
    Replies: 7
    Last Post: 3rd September 2007, 09:59
  5. How to sort a QComboBox in Qt4
    By guenthk in forum Qt Programming
    Replies: 7
    Last Post: 25th September 2006, 18:35

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.