Text color and element color now do not change with background color

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2678 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
abhishekm71
2013-12-29 17:51:01 +00:00
parent af6091d8b5
commit 04e5961d17
2 changed files with 0 additions and 39 deletions

View File

@@ -148,12 +148,6 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) {
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 @@ bool CustomElement::parseLine(QDomElement &e, QPainter &qp) {
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 @@ bool CustomElement::parseRect(QDomElement &e, QPainter &qp) {
// 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 @@ bool CustomElement::parseText(QDomElement &e, QPainter &qp) {
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 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
// 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 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
pen.setColor(Qt::green);
}
}
// make component color reverse of back_ground color for contrast
pen.setColor(color);
}
}