1 # -*- coding: utf-8 -*-
3 from PyQt4.QtGui import QPixmap, QIcon
8 Class implementing a pixmap cache for icons.
17 def getPixmap(self, key):
19 Public method to retrieve a pixmap.
21 @param key name of the wanted pixmap (string)
22 @return the requested pixmap (QPixmap)
26 key="/local/pnoyret/Install_Eficas/EficasV1/InterfaceQT/icons/"+key
28 #return self.pixmapCache[key]
31 self.pixmapCache[key] = QPixmap.fromMimeSource(key)
32 return self.pixmapCache[key]
34 pixCache = PixmapCache()
36 def getPixmap(key, cache = pixCache):
38 Module function to retrieve a pixmap.
40 @param key name of the wanted pixmap (string)
41 @return the requested pixmap (QPixmap)
43 return cache.getPixmap(key)
46 key="/local/pnoyret/Install_Eficas/EficasV1/InterfaceQT/icons/"+key
50 #from PyQt4.Qt3Support import Q3MimeSourceFactory
52 #def initializeMimeSourceFactory():
54 Function to initialize the default mime source factory.
57 # defaultFactory = Q3MimeSourceFactory.defaultFactory()
58 # repini=os.path.dirname(os.path.abspath(__file__))
59 # defaultFactory.addFilePath(repini+"/../Editeur/icons") #CS_pbruno todo (config)