Beispiel #1
0
// Rysuje odblask swiat³a na diodzie 
void Led::paintBackground(QPainter & painter)
{
  initCoordinateSystem(painter); 
  painter.setPen(Qt::NoPen); 
  QRadialGradient shine(QPointF(-40.0,-40.0),120.0,QPointF(-40,-40));
  QColor white1(255,255,255,200);
  QColor white0(255,255,255,0);
  
  shine.setColorAt(0.0,white1); 
  shine.setColorAt(1.0,white0); 
  
  painter.setBrush(shine); 
  painter.drawEllipse(-147,-147,297,297); 
        
}
void ChanWidgetLED::paintBackground(QPainter & painter)
{
  initCoordinateSystem(painter);
  painter.setPen(Qt::NoPen);
  QRadialGradient shine(QPointF(-(size-size/10)/7.5,-(size-size/10)/7.5),(size-size/10)/2.5,
                        QPointF(-(size-size/10)/7.5,-(size-size/10)/7.5));
  QColor white1(255,255,255,200);
  QColor white0(255,255,255,0);

  shine.setColorAt(0.0,white1);
  shine.setColorAt(1.0,white0);

  painter.setBrush(shine);
  painter.drawEllipse(-(size-size/10)/2,-(size-size/10)/2,(size-size/10),(size-size/10));

}