QT drawing without erasing widget

Posted by faya on Stack Overflow See other posts from Stack Overflow or by faya
Published on 2009-11-11T08:22:39Z Indexed on 2010/05/05 4:08 UTC
Read the original article Hit count: 286

Filed under:
|
|

Hello,

If I have a derived object of QWidget class and on slot function in it I have an update(). here is some pseudocode:

*.h
   slot:
     updateNow();

*.cpp
constructor()
{
  setPalllete(QPallete(QColor(250,250,200)));
  setAUtoFillBackground(true);
}
updateNow()
{
  update();
}

paintEvent()
{
  QPainter painter(this);
  painter.drawRect(1,2,3,4);
}

So how should I don't get erased my pallete after update() call?

P.S. - Sorry for my English and only pseudocode.

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt