Hi,

I have tried to plot some 2d stuff (like pixels for a start but sprites and stuff would be nice too) on to a Qimage but i tend to get weird results like this screenshot.png with this code
Qt Code:
  1. RenderArea::RenderArea(QWidget *parent) :
  2. QWidget(parent) {
  3. image = new QImage(500, 500, QImage::Format_ARGB32_Premultiplied);
  4. image->fill(0);
  5. for (int n = 0; n < 500; ++n) {
  6. for (int i = 0; i < 500; ++i) {
  7. image->setPixel(i, n, 0x00ff00ff);
  8. }
  9. }
  10.  
  11. setBackgroundRole(QPalette::Base);
  12. setAutoFillBackground(true);
  13. this->update();
  14. }
  15.  
  16. void RenderArea::paintEvent(QPaintEvent * /* event */) {
  17. QPainter painter(this);
  18. QRect rect(0, 0, image->width(), image->height());
  19. painter.drawImage(rect, *image);
  20.  
  21. this->update();
  22. }
To copy to clipboard, switch view to plain text mode 
any ideas on what i have been doing wrong? Is this a good method ( if I get it to work) or is the graphiview / scene route better for "high"speed 2d plotting?

Best regards Anders Olme