def get_icon(name, default=None, resample=False):
 icon_path = get_image_path(name, default=None)
 if (icon_path is not None):
  icon = QIcon(icon_path)
 elif isinstance(default, QIcon):
  icon = default
 elif (default is None):
  try:
   icon = get_std_icon(name[:(-4)])
  except AttributeError:
   icon = QIcon(get_image_path(name, default))
 else:
  icon = QIcon(get_image_path(name, default))
 if resample:
  icon0 = QIcon()
  for size in (16, 24, 32, 48, 96, 128, 256, 512):
   icon0.addPixmap(icon.pixmap(size, size))
  return icon0
 else:
  return icon

def get_icon ( name , default = None , resample = False ) : icon_path = get_image_path ( name , default = None ) if ( icon_path is not None ) : icon = QIcon ( icon_path ) elif isinstance ( default , QIcon ) : icon = default elif ( default is None ) : try : icon = get_std_icon ( name [ : ( - 4 ) ] ) except AttributeError : icon = QIcon ( get_image_path ( name , default ) ) else : icon = QIcon ( get_image_path ( name , default ) ) if resample : icon0 = QIcon ( ) for size in ( 16 , 24 , 32 , 48 , 96 , 128 , 256 , 512 ) : icon0 . addPixmap ( icon . pixmap ( size , size ) ) return icon0 else : return icon
retrieve a qicon for the named image from the zip file if it exists .