Dear Experts!!
I have a problem with my painter. I want to paint my form by without using paint event.
Is it possible? In some examples I saw that they use QPixmap for painting on it. Is it a good way to paint on a pixmap and locate it on my form?

Thanks


Qt Code:
  1. pixmap = QPixmap(100, 100);
  2. pixmap.fill(Qt::transparent);
  3.  
  4. QRadialGradient gradient(50, 50, 50, 50, 50);
  5. gradient.setColorAt(0, QColor::fromRgbF(1, 0, 0, 1));
  6. gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));
  7. QPainter painter(&pixmap);
  8. painter.fillRect(0, 0, 100, 100, gradient);
  9.  
  10. channelImage = pixmap.alphaChannel();
  11. update();
To copy to clipboard, switch view to plain text mode