[qet] [3969] Add texture pattern to element part

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


Revision: 3969
Author:   scorpio810
Date:     2015-05-13 08:31:16 +0200 (Wed, 13 May 2015)
Log Message:
-----------
Add texture pattern to element part

Modified Paths:
--------------
    trunk/sources/editor/graphicspart/customelementgraphicpart.cpp
    trunk/sources/editor/graphicspart/customelementgraphicpart.h
    trunk/sources/editor/styleeditor.cpp
    trunk/sources/editor/styleeditor.h
    trunk/sources/qetgraphicsitem/customelement.cpp

Modified: trunk/sources/editor/graphicspart/customelementgraphicpart.cpp
===================================================================
--- trunk/sources/editor/graphicspart/customelementgraphicpart.cpp	2015-05-12 17:02:31 UTC (rev 3968)
+++ trunk/sources/editor/graphicspart/customelementgraphicpart.cpp	2015-05-13 06:31:16 UTC (rev 3969)
@@ -178,6 +178,10 @@
 	else if (_filling == LightgrayFilling)  css_like_styles += "lightgray";
 	else if (_filling == OrangeFilling)  css_like_styles += "orange";
 	else if (_filling == PurpleFilling)  css_like_styles += "purple";
+	else if (_filling == HorFilling) css_like_styles += "hor";
+	else if (_filling == VerFilling) css_like_styles += "ver";
+	else if (_filling == BdiagFilling) css_like_styles += "bdiag";
+	else if (_filling == FdiagFilling) css_like_styles += "fdiag";
 
 
 	css_like_styles += ";color:";
@@ -249,6 +253,10 @@
 			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 == "hor")  _filling = HorFilling;
+			else if (style_value == "ver")  _filling = VerFilling;
+			else if (style_value == "bdiag")  _filling = BdiagFilling;
+			else if (style_value == "fdiag")  _filling = FdiagFilling;
 			else if (style_value == "none")  _filling = NoneFilling;
 		}
 		else if (style_name == "color")
@@ -313,6 +321,10 @@
 
 		//Apply brush color
 	if (_filling == NoneFilling) brush.setStyle(Qt::NoBrush);
+	else if (_filling == HorFilling) brush.setStyle(Qt::HorPattern);
+	else if (_filling == VerFilling) brush.setStyle(Qt::VerPattern);
+	else if (_filling == BdiagFilling) brush.setStyle(Qt::BDiagPattern);
+	else if (_filling == FdiagFilling) brush.setStyle(Qt::FDiagPattern);
 	else
 	{
 		brush.setStyle(Qt::SolidPattern);

Modified: trunk/sources/editor/graphicspart/customelementgraphicpart.h
===================================================================
--- trunk/sources/editor/graphicspart/customelementgraphicpart.h	2015-05-12 17:02:31 UTC (rev 3968)
+++ trunk/sources/editor/graphicspart/customelementgraphicpart.h	2015-05-13 06:31:16 UTC (rev 3969)
@@ -56,7 +56,7 @@
 		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, CyanFilling, MagentaFilling, LightgrayFilling, OrangeFilling, PurpleFilling };
+		enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling, CyanFilling, MagentaFilling, LightgrayFilling, OrangeFilling, PurpleFilling, HorFilling, VerFilling, BdiagFilling, FdiagFilling};
 
 			//Line color
 		enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor};

Modified: trunk/sources/editor/styleeditor.cpp
===================================================================
--- trunk/sources/editor/styleeditor.cpp	2015-05-12 17:02:31 UTC (rev 3968)
+++ trunk/sources/editor/styleeditor.cpp	2015-05-13 06:31:16 UTC (rev 3969)
@@ -76,6 +76,10 @@
 	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);
+	filling_color -> addItem(tr("Lignes Horizontales", "element part filling"), CustomElementGraphicPart::HorFilling);
+	filling_color -> addItem(tr("Lignes Verticales", "element part filling"), CustomElementGraphicPart::VerFilling);
+	filling_color -> addItem(tr("Hachures gauche", "element part filling"), CustomElementGraphicPart::BdiagFilling);
+	filling_color -> addItem(tr("Hachures droite", "element part filling"), CustomElementGraphicPart::FdiagFilling);
 
 	// antialiasing
 	antialiasing = new QCheckBox(tr("Antialiasing"));

Modified: trunk/sources/editor/styleeditor.h
===================================================================
--- trunk/sources/editor/styleeditor.h	2015-05-12 17:02:31 UTC (rev 3968)
+++ trunk/sources/editor/styleeditor.h	2015-05-13 06:31:16 UTC (rev 3969)
@@ -43,9 +43,9 @@
 		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, *cyan_color, *magenta_color, *gris_clair_color, orange_color, *violet_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, *hor_filling, *ver_filling;
 		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, *cyan_filling, *magenta_filling, *gris_clair_filling, orange_filling, *violet_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, *hachures1_filling, hachures2_filling;
 		QCheckBox *antialiasing;
 		QComboBox *filling_color, *outline_color, *size_weight, *line_style;
 	

Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp	2015-05-12 17:02:31 UTC (rev 3968)
+++ trunk/sources/qetgraphicsitem/customelement.cpp	2015-05-13 06:31:16 UTC (rev 3969)
@@ -918,6 +918,18 @@
 				} else if (style_value == "purple") {
 					brush.setStyle(Qt::SolidPattern);
 					brush.setColor(QColor(136, 28, 168));
+				}else if (style_value == "hor") {
+					brush.setStyle(Qt::HorPattern);
+					brush.setColor(Qt::black);
+				} else if (style_value == "ver") {
+					brush.setStyle(Qt::VerPattern);
+					brush.setColor(Qt::black);
+				} else if (style_value == "bdiag") {
+					brush.setStyle(Qt::BDiagPattern);
+					brush.setColor(Qt::black);
+				} else if (style_value == "fdiag") {
+					brush.setStyle(Qt::FDiagPattern);
+					brush.setColor(Qt::black);
 				} else if (style_value == "none") {
 					brush.setStyle(Qt::NoBrush);
 				}


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