changeset 220:7b2a7880a501

antialiasing
author benoitrigolleau
date Thu, 07 Feb 2008 15:53:32 +0000
parents e8175839a5ac
children a89ab7dfbf4c
files widgets/Plotter.cpp widgets/WaitingWidget.cpp
diffstat 2 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/Plotter.cpp	Thu Feb 07 15:53:09 2008 +0000
+++ b/widgets/Plotter.cpp	Thu Feb 07 15:53:32 2008 +0000
@@ -143,6 +143,7 @@
 }
 
 void Plotter::drawCurve(QPainter *painter){
+	painter->setRenderHint (QPainter::Antialiasing, true );
 	QPolygonF polyline(m_signalWidth);
 	for(int i = 0 ; i < m_curve.count() ; i++){
 		polyline[i] = QPoint(m_curve.at(i).x()+m_margin, m_curve.at(i).y()+m_margin);
@@ -153,6 +154,8 @@
 
 void Plotter::drawMaskCurve(QPainter *painter){
 
+	painter->setRenderHint (QPainter::Antialiasing, true );
+	
 	QPolygonF polyline(m_signalWidth);
 
 	for(int i = 0 ; i < m_signalWidth ; i++){
--- a/widgets/WaitingWidget.cpp	Thu Feb 07 15:53:09 2008 +0000
+++ b/widgets/WaitingWidget.cpp	Thu Feb 07 15:53:32 2008 +0000
@@ -20,14 +20,15 @@
 
 WaitingWidget::WaitingWidget(QWidget *parent):QWidget(parent){
 	m_ind=0;
-	colors[0]=QRgb(0xffddf756);
-	colors[1]=QRgb(0xffccf756);
-	colors[2]=QRgb(0xffbbf756);
-	colors[3]=QRgb(0xffaaf756);
-	colors[4]=QRgb(0xff99f756);
-	colors[5]=QRgb(0xff88f756);
-	colors[6]=QRgb(0xff77f756);
-	colors[7]=QRgb(0xff66f756); 
+	colors[0]=QRgb(0xfffec000);
+	colors[1]=QRgb(0xffdbf756); 
+	colors[2]=QRgb(0xffb7f151);
+	colors[3]=QRgb(0xffb6d1aa);
+	colors[4]=QRgb(0xff71b19d);
+	colors[5]=QRgb(0xff9dd8ec);
+	colors[6]=QRgb(0xff808080);
+	colors[7]=QRgb(0xffcccccc);
+	
 }
 
 void WaitingWidget::paintEvent(QPaintEvent *event){
@@ -46,13 +47,14 @@
 	painter->setBrush(QBrush(color1, Qt::SolidPattern));
 	painter->drawRect(0,0,this->width(), this->height());
 
-
+	painter->setRenderHint (QPainter::Antialiasing, true );
 	int xm = this->width()/2;
 	int ym = this->height()/2;
 	painter->translate(xm,ym);
 	for(int i=0; i < 8; i++){
-		QColor penColor(colors[(m_ind+i)%8]);
-		penColor.setAlpha(180);
+		//QColor penColor(colors[(m_ind+i)%8]);
+		QColor penColor(colors[1]);
+		penColor.setAlpha(((m_ind+i)%8+1)*30);
 		painter->setPen(QPen(penColor,8,Qt::SolidLine,Qt::RoundCap));
 		float angle = (360.0f/8.0f);
 		painter->rotate(-angle);