[Qt-interest] drawRect()/fillRect() not working at qt-4.5.0?

Ole Streicher ole-usenet-spam at gmx.net
Mon May 25 11:50:44 CEST 2009


Ole Streicher <ole-usenet-spam at gmx.net> writes:
>     def paintEvent(self, event):
>         painter = QtGui.QPainter(self)
>         painter.setPen(self.pen)
>         painter.setBrush(self.brush)
>         painter.drawRect(self.rect())
> #        painter.fillRect(self.rect(), self.brush)

What I also tried was to set the background mode of the QPainter to
Qt::OpaqueMode, but this did not help.

What helps is to replace the base class (QRubberBand)= with QWidget.

What is wrong here?

Best regards

Ole




More information about the Qt-interest-old mailing list