This is just an experiment I have been doing. It takes about 7 seconds to run with 200 points. The CPU and memory on the machine are not that great 454 MHz ARM9 processor with 128MB RAM, there might not be a way to speed this up, but I thought I'd ask.

Qt Code:
  1. void HeatMap::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
  2. {
  3. int x = 0;
  4. int y = 0;
  5. qreal intensity = 0;
  6. qDebug() << QTime::currentTime();
  7.  
  8. QImage image(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
  9. QPainter *paint = new QPainter(&image);
  10.  
  11. foreach (QVariant v, m_data)
  12. {
  13. QStringList tmp = v.toString().split(",");
  14.  
  15. x = tmp[0].toInt();
  16. y = tmp[1].toInt();
  17. intensity = tmp[2].toDouble();
  18. QRadialGradient g(QPointF(x, y), m_radius, QPointF(x, y));
  19. g.setColorAt(0.0, QColor::fromRgbF(0, 0, 0, intensity));
  20. g.setColorAt(1.0, QColor::fromRgbF(0, 0, 0, 0.0));
  21. paint->fillRect(QRectF(x - m_radius, y - m_radius, x + m_radius, y + m_radius), g);
  22. }
  23.  
  24. painter->drawImage(QPoint(0, 0), image);
  25. qDebug() << QTime::currentTime();
  26. }
To copy to clipboard, switch view to plain text mode 

Thanks