I have a signal plot with a grid where I would like to change the background color of just some of the grid cells.
Tried this:
Qt Code:
  1. void SignalView::paintEvent(QPaintEvent*)
  2. {
  3. QPainter* painter = new QPainter(this);
  4.  
  5. QColor bpColor;
  6. bpColor.setNamedColor("grey");
  7.  
  8. painter->setPen(bpColor);
  9. QwtPainter::drawRect(painter, 500, 500, 100, 500);
  10. }
To copy to clipboard, switch view to plain text mode 

But no paint and the message QPaintDevice: Cannot destroy paint device that is being painted appears in the application output window.

Any suggestions are welcome.