title: using QPixmapCache to speed up the performance
body: <p>I am trying to using <code>QPixmapCache</code> in my PyQt4 app, however it still seems to take time, Can anyone please have a look at my code below:</p>
  
  <pre><code>def data(self, index, role):
  
          if index.isValid() and role == QtCore.Qt.DecorationRole:
              row = index.row()
              column = index.column()
              value = self._listdata[row][column]
              key = "image:%s"% value
              pixmap = QtGui.QPixmap()
              # pixmap.load(value)
              if not QtGui.QPixmapCache.find(key, pixmap):
                  pixmap=self.generatePixmap(value)
                  QtGui.QPixmapCache.insert(key, pixmap)
              # pixmap.scaled(400,300, QtCore.Qt.KeepAspectRatio)
              return QtGui.QImage(pixmap)
  
          if index.isValid() and role == QtCore.Qt.DisplayRole:
              row = index.row()
              column = index.column()
              value = self._listdata[row][column]
              fileName = os.path.split(value)[-1]
              return os.path.splitext(fileName)[0]
  
      def generatePixmap(self, value):
          pixmap=QtGui.QPixmap()
          pixmap.load(value)
          pixmap.scaled(100, 120, QtCore.Qt.KeepAspectRatio)
          return pixmap
  </code></pre>