1 # -*- coding: utf-8 -*-
8 Class implementing a pixmap cache for icons.
16 def getPixmap(self, key):
18 Public method to retrieve a pixmap.
20 @param key name of the wanted pixmap (string)
21 @return the requested pixmap (QPixmap)
24 return self.pixmapCache[key]
26 self.pixmapCache[key] = QPixmap.fromMimeSource(key)
27 return self.pixmapCache[key]
29 pixCache = PixmapCache()
31 def getPixmap(key, cache = pixCache):
33 Module function to retrieve a pixmap.
35 @param key name of the wanted pixmap (string)
36 @return the requested pixmap (QPixmap)
38 return cache.getPixmap(key)
42 from qt import QMimeSourceFactory
44 def initializeMimeSourceFactory():
46 Function to initialize the default mime source factory.
49 defaultFactory = QMimeSourceFactory.defaultFactory()
50 repini=os.path.dirname(os.path.abspath(__file__))
51 defaultFactory.addFilePath(repini+"/../Editeur/icons") #CS_pbruno todo (config)