mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Add others colors for element part
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3963 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -173,7 +173,11 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
|
||||
else if (_filling == RedFilling) css_like_styles += "red";
|
||||
else if (_filling == GrayFilling) css_like_styles += "gray";
|
||||
else if (_filling == BrunFilling) css_like_styles += "brun";
|
||||
else if (_filling == YellowFilling) css_like_styles += "yellow";
|
||||
else if (_filling == CyanFilling) css_like_styles += "cyan";
|
||||
else if (_filling == MagentaFilling) css_like_styles += "magenta";
|
||||
else if (_filling == LightgrayFilling) css_like_styles += "lightgray";
|
||||
else if (_filling == OrangeFilling) css_like_styles += "orange";
|
||||
else if (_filling == PurpleFilling) css_like_styles += "purple";
|
||||
|
||||
|
||||
css_like_styles += ";color:";
|
||||
@@ -185,6 +189,11 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
|
||||
else if (_color == GrayColor) css_like_styles += "gray";
|
||||
else if (_color == BrunColor) css_like_styles += "brun";
|
||||
else if (_color == YellowColor) css_like_styles += "yellow";
|
||||
else if (_color == CyanColor) css_like_styles += "cyan";
|
||||
else if (_color == MagentaColor) css_like_styles += "magenta";
|
||||
else if (_color == LightgrayColor) css_like_styles += "lightgray";
|
||||
else if (_color == OrangeColor) css_like_styles += "orange";
|
||||
else if (_color == PurpleColor) css_like_styles += "purple";
|
||||
|
||||
qde.setAttribute("style", css_like_styles);
|
||||
qde.setAttribute("antialias", _antialiased ? "true" : "false");
|
||||
@@ -235,6 +244,11 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
else if (style_value == "gray") _filling = GrayFilling;
|
||||
else if (style_value == "brun") _filling = BrunFilling;
|
||||
else if (style_value == "yellow") _filling = YellowFilling;
|
||||
else if (style_value == "cyan") _filling = CyanFilling;
|
||||
else if (style_value == "magenta") _filling = MagentaFilling;
|
||||
else if (style_value == "lightgray") _filling = LightgrayFilling;
|
||||
else if (style_value == "orange") _filling = OrangeFilling;
|
||||
else if (style_value == "purple") _filling = PurpleFilling;
|
||||
else if (style_value == "none") _filling = NoneFilling;
|
||||
}
|
||||
else if (style_name == "color")
|
||||
@@ -247,6 +261,11 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
else if (style_value == "gray") _color = GrayColor;
|
||||
else if (style_value == "brun") _color = BrunColor;
|
||||
else if (style_value == "yellow") _color = YellowColor;
|
||||
else if (style_value == "cyan") _color = CyanColor;
|
||||
else if (style_value == "magenta") _color = MagentaColor;
|
||||
else if (style_value == "lightgray") _color = LightgrayColor;
|
||||
else if (style_value == "orange") _color = OrangeColor;
|
||||
else if (style_value == "purple") _color = PurpleColor;
|
||||
}
|
||||
}
|
||||
//Get antialiasing
|
||||
@@ -305,6 +324,11 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const
|
||||
else if (_filling == GrayFilling) brush.setColor(Qt::gray);
|
||||
else if (_filling == BrunFilling) brush.setColor(QColor(97, 44, 0));
|
||||
else if (_filling == YellowFilling) brush.setColor(Qt::yellow);
|
||||
else if (_filling == CyanFilling) brush.setColor(Qt::cyan);
|
||||
else if (_filling == MagentaFilling) brush.setColor(Qt::magenta);
|
||||
else if (_filling == LightgrayFilling) brush.setColor(Qt::lightGray);
|
||||
else if (_filling == OrangeFilling) brush.setColor(QColor(255, 128, 0));
|
||||
else if (_filling == PurpleFilling) brush.setColor(QColor(136, 28, 168));
|
||||
}
|
||||
|
||||
//Apply pen color
|
||||
@@ -316,6 +340,11 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const
|
||||
else if (_color == GrayColor) pen.setColor(QColor(Qt::gray));
|
||||
else if (_color == BrunColor) pen.setColor(QColor(97, 44, 0));
|
||||
else if (_color == YellowColor) pen.setColor(QColor(Qt::yellow));
|
||||
else if (_color == CyanColor) pen.setColor(Qt::cyan);
|
||||
else if (_color == MagentaColor) pen.setColor(Qt::magenta);
|
||||
else if (_color == LightgrayColor) pen.setColor(Qt::lightGray);
|
||||
else if (_color == OrangeColor) pen.setColor(QColor(255, 128, 0));
|
||||
else if (_color == PurpleColor) pen.setColor(QColor(136, 28, 168));
|
||||
|
||||
//Apply antialiasing
|
||||
painter.setRenderHint(QPainter::Antialiasing, _antialiased);
|
||||
|
||||
@@ -56,10 +56,10 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar
|
||||
enum LineWeight {NoneWeight, ThinWeight, NormalWeight, UltraWeight, BigWeight};
|
||||
|
||||
//Filling color of the part : NoneFilling -> No filling (i.e. transparent)
|
||||
enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling};
|
||||
enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling, CyanFilling, MagentaFilling, LightgrayFilling, OrangeFilling, PurpleFilling };
|
||||
|
||||
//Line color
|
||||
enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor};
|
||||
enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor};
|
||||
|
||||
// constructors, destructor
|
||||
public:
|
||||
|
||||
@@ -38,6 +38,11 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
outline_color -> addItem(tr("Gris", "element part color"), CustomElementGraphicPart::GrayColor);
|
||||
outline_color -> addItem(tr("Marron", "element part color"), CustomElementGraphicPart::BrunColor);
|
||||
outline_color -> addItem(tr("Jaune", "element part color"), CustomElementGraphicPart::YellowColor);
|
||||
outline_color -> addItem(tr("Cyan", "element part color"), CustomElementGraphicPart::CyanColor);
|
||||
outline_color -> addItem(tr("Magenta", "element part color"), CustomElementGraphicPart::MagentaColor);
|
||||
outline_color -> addItem(tr("Gris clair", "element part color"), CustomElementGraphicPart::LightgrayColor);
|
||||
outline_color -> addItem(tr("Orange", "element part color"), CustomElementGraphicPart::OrangeColor);
|
||||
outline_color -> addItem(tr("Violet", "element part color"), CustomElementGraphicPart::PurpleColor);
|
||||
|
||||
// style
|
||||
line_style = new QComboBox(this);
|
||||
@@ -66,6 +71,11 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
filling_color -> addItem(tr("Gris", "element part filling"), CustomElementGraphicPart::GrayFilling);
|
||||
filling_color -> addItem(tr("Marron", "element part filling"), CustomElementGraphicPart::BrunFilling);
|
||||
filling_color -> addItem(tr("Jaune", "element part filling"), CustomElementGraphicPart::YellowFilling);
|
||||
filling_color -> addItem(tr("Cyan", "element part filling"), CustomElementGraphicPart::CyanFilling);
|
||||
filling_color -> addItem(tr("Magenta", "element part filling"), CustomElementGraphicPart::MagentaFilling);
|
||||
filling_color -> addItem(tr("Gris clair", "element part filling"), CustomElementGraphicPart::LightgrayFilling);
|
||||
filling_color -> addItem(tr("Orange", "element part filling"), CustomElementGraphicPart::OrangeFilling);
|
||||
filling_color -> addItem(tr("Violet", "element part filling"), CustomElementGraphicPart::PurpleFilling);
|
||||
|
||||
// antialiasing
|
||||
antialiasing = new QCheckBox(tr("Antialiasing"));
|
||||
|
||||
@@ -43,9 +43,9 @@ class StyleEditor : public ElementItemEditor
|
||||
QList <CustomElementGraphicPart *> m_part_list;
|
||||
QList <CustomElementPart *> m_cep_list;
|
||||
QVBoxLayout *main_layout;
|
||||
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color, *gray_color, *brun_color, *yellow_color;
|
||||
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color, *gray_color, *brun_color, *yellow_color, *cyan_color, *magenta_color, *gris_clair_color, orange_color, *violet_color;
|
||||
QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
|
||||
QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_filling, *brun_filling, *yellow_filling;
|
||||
QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling, *gray_filling, *brun_filling, *yellow_filling, *cyan_filling, *magenta_filling, *gris_clair_filling, orange_filling, *violet_filling;
|
||||
QCheckBox *antialiasing;
|
||||
QComboBox *filling_color, *outline_color, *size_weight, *line_style;
|
||||
|
||||
|
||||
@@ -825,6 +825,10 @@ bool CustomElement::validOrientationAttribute(const QDomElement &e) {
|
||||
- gray : remplissage gris
|
||||
- brun : remplissage marron
|
||||
- yellow : remplissage jaune
|
||||
- cyan : remplissage cyan
|
||||
- lightgray : remplissage gris clair
|
||||
- orange : remplissage orange
|
||||
- purple : remplissage violet
|
||||
- none : pas de remplissage [par defaut]
|
||||
- color : couleur du trait et du texte
|
||||
- white : trait noir [par defaut]
|
||||
@@ -835,6 +839,10 @@ bool CustomElement::validOrientationAttribute(const QDomElement &e) {
|
||||
- gray : trait gris
|
||||
- brun : trait marron
|
||||
- yellow : trait jaune
|
||||
- cyan : trait cyan
|
||||
- lightgray : trait gris clair
|
||||
- orange : trait orange
|
||||
- purple : trait violet
|
||||
|
||||
Les autres valeurs ne sont pas prises en compte.
|
||||
@param e L'element XML a parser
|
||||
@@ -895,6 +903,21 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
||||
} else if (style_value == "yellow") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(Qt::yellow);
|
||||
} else if (style_value == "cyan") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(Qt::cyan);
|
||||
} else if (style_value == "magenta") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(Qt::magenta);
|
||||
} else if (style_value == "lightgray") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(Qt::lightGray);
|
||||
} else if (style_value == "orange") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(QColor(255, 128, 0));
|
||||
} else if (style_value == "purple") {
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
brush.setColor(QColor(136, 28, 168));
|
||||
} else if (style_value == "none") {
|
||||
brush.setStyle(Qt::NoBrush);
|
||||
}
|
||||
@@ -915,7 +938,16 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
||||
pen.setColor(QColor(97, 44, 0));
|
||||
}else if (style_value == "yellow") {
|
||||
pen.setColor(Qt::yellow);
|
||||
|
||||
}else if (style_value == "cyan") {
|
||||
pen.setColor(Qt::cyan);
|
||||
}else if (style_value == "magenta") {
|
||||
pen.setColor(Qt::magenta);
|
||||
}else if (style_value == "lightgray") {
|
||||
pen.setColor(Qt::lightGray);
|
||||
}else if (style_value == "orange") {
|
||||
pen.setColor(QColor(255, 128, 0));
|
||||
}else if (style_value == "purple") {
|
||||
pen.setColor(QColor(136, 28, 168));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user