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?
Bookmarks