Quote:
Originally Posted by kiwidude
Code:
actual_icon = None
try:
resource = self.load_resource(icon_name)
pixmap = QPixmap()
pixmap.loadFromData(resource)
actual_icon = QIcon(pixmap)
except ValueError:
actual_icon = QIcon(I(icon_name))
ac.setIcon(actual_icon)
|
Given the new list interface, the problem becomes much more tractable. You load the icons you need from the zip into the dict. Some might not be there. You then loop through the items you need using a simple if x in list: test. If they is in the dict, cool. If not, you use the file approach. That lets the customizers put their icons in the local resources/images directory (or a subdir if they want to). There is almost zero time penalty because the zip scan was done once and you would need to open the files anyway.
Quote:
And yeah as Chaley says if you have a lot of icons you are opening/closing the zip a lot of times.
|
Problem gone with list interface.