[qet] [2678] Text color and element color now do not change with background color

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2678
Author:   abhishekm71
Date:     2013-12-29 18:51:01 +0100 (Sun, 29 Dec 2013)
Log Message:
-----------
Text color and element color now do not change with background color

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/customelement.cpp
    trunk/sources/qetgraphicsitem/diagramtextitem.cpp

Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp	2013-12-29 14:07:26 UTC (rev 2677)
+++ trunk/sources/qetgraphicsitem/customelement.cpp	2013-12-29 17:51:01 UTC (rev 2678)
@@ -148,12 +148,6 @@
 	low_zoom_qp.begin(&low_zoom_drawing);
 	QPen tmp;
 	tmp.setWidthF(1.0); // ligne vaudou pour prise en compte du setCosmetic - ne pas enlever
-	// make component color reverse of back_ground color for contrast
-	QColor color(Diagram::background_color);
-	color.setBlue(255 - color.blue());
-	color.setGreen(255 - color.green());
-	color.setRed(255 - color.red());
-	tmp.setColor(color);
 	tmp.setCosmetic(true);
 	low_zoom_qp.setPen(tmp);
 	
@@ -299,12 +293,6 @@
 	setPainterStyle(e, qp);
 	QPen t = qp.pen();
 	t.setJoinStyle(Qt::MiterJoin);
-	// make component color reverse of back_ground color for contrast
-	QColor color(Diagram::background_color);
-	color.setBlue(255 - color.blue());
-	color.setGreen(255 - color.green());
-	color.setRed(255 - color.red());
-	t.setColor(color);
 	qp.setPen(t);
 	
 	QLineF line(x1, y1, x2, y2);
@@ -409,12 +397,6 @@
 	// force le type de jointures pour les rectangles
 	QPen p = qp.pen();
 	p.setJoinStyle(Qt::MiterJoin);
-	// make component color reverse of back_ground color for contrast
-	QColor color(Diagram::background_color);
-	color.setBlue(255 - color.blue());
-	color.setGreen(255 - color.green());
-	color.setRed(255 - color.red());
-	p.setColor(color);
 	qp.setPen(p);
 	
 	qp.drawRect(QRectF(rect_x, rect_y, rect_w, rect_h));
@@ -568,13 +550,6 @@
 	QFontMetrics qfm(used_font);
 	QColor text_color = (e.attribute("color") != "white"? Qt::black : Qt::white);
 
-	// make component color reverse of back_ground color for contrast
-	QColor color(Diagram::background_color);
-	color.setBlue(255 - color.blue());
-	color.setGreen(255 - color.green());
-	color.setRed(255 - color.red());
-	text_color = color;
-	
 	// instancie un QTextDocument (comme la classe QGraphicsTextItem) pour
 	// generer le rendu graphique du texte
 	QTextDocument text_document;
@@ -767,13 +742,6 @@
 	// attributs par defaut
 	pen.setJoinStyle(Qt::BevelJoin);
 	pen.setCapStyle(Qt::SquareCap);
-	
-	// make component color reverse of back_ground color for contrast
-	QColor color(Diagram::background_color);
-	color.setBlue(255 - color.blue());
-	color.setGreen(255 - color.green());
-	color.setRed(255 - color.red());
-	pen.setColor(color);
 
 	// recupere la liste des couples style / valeur
 	QStringList styles = e.attribute("style").split(";", QString::SkipEmptyParts);
@@ -828,8 +796,6 @@
 					pen.setColor(Qt::green);
 				}
 			}
-			// make component color reverse of back_ground color for contrast
-			pen.setColor(color);
 		}
 	}
 	

Modified: trunk/sources/qetgraphicsitem/diagramtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/diagramtextitem.cpp	2013-12-29 14:07:26 UTC (rev 2677)
+++ trunk/sources/qetgraphicsitem/diagramtextitem.cpp	2013-12-29 17:51:01 UTC (rev 2678)
@@ -198,11 +198,6 @@
 */
 void DiagramTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
 	painter -> setRenderHint(QPainter::Antialiasing, false);
-	QColor color(Diagram::background_color);
-	color.setBlue(255 - color.blue());
-	color.setGreen(255 - color.green());
-	color.setRed(255 - color.red());
-	setDefaultTextColor(color);
 	QGraphicsTextItem::paint(painter, option, widget);
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/