Quote Originally Posted by aamer4yu View Post
Try this -
painter.setOpacity(0.5)... in the paintEvent
It doesn't work.
Here the new code:

Qt Code:
  1. class WfRubberBand : public QRubberBand
  2. {
  3. public:
  4.  
  5. WfRubberBand( Shape s, QWidget * p = 0 ) : QRubberBand( s, p )
  6. {
  7. QPalette palette;
  8. //palette.setBrush( QPalette::WindowText, QBrush( Qt::red ) );
  9. palette.setBrush( QPalette::Foreground, QBrush( Qt::red ) );
  10. setPalette(palette);
  11. }
  12.  
  13. protected:
  14.  
  15. virtual void paintEvent( QPaintEvent * )
  16. {
  17. QStylePainter painter(this);
  18.  
  19. option.initFrom( this );
  20.  
  21. painter.drawControl(QStyle::CE_FocusFrame, option);
  22. painter.setOpacity(0.5); // from aamer4yu
  23. }
  24. };
To copy to clipboard, switch view to plain text mode 

Which can be the problem?