[qet] [991] Distinction de deux styles : pointilles (tirets) et pointilles ( points).

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


Revision: 991
Author:   xavier
Date:     2010-05-09 20:40:08 +0200 (Sun, 09 May 2010)
Log Message:
-----------
Distinction de deux styles : pointilles (tirets) et pointilles (points).

Modified Paths:
--------------
    branches/0.3/sources/customelement.cpp
    branches/0.3/sources/editor/customelementgraphicpart.cpp
    branches/0.3/sources/editor/customelementgraphicpart.h
    branches/0.3/sources/editor/styleeditor.cpp
    branches/0.3/sources/editor/styleeditor.h

Modified: branches/0.3/sources/customelement.cpp
===================================================================
--- branches/0.3/sources/customelement.cpp	2010-05-09 12:32:11 UTC (rev 990)
+++ branches/0.3/sources/customelement.cpp	2010-05-09 18:40:08 UTC (rev 991)
@@ -698,7 +698,8 @@
 	l'element XML e au QPainter qp
 	Les styles possibles sont :
 		- line-style : style du trait
-			- dashed : trait en pointilles
+			- dashed : trait en pointilles (tirets)
+			- dotted : trait en pointilles (points)
 			- normal : trait plein [par defaut]
 		- line-weight : epaiseur du trait
 			- thin : trait fin
@@ -739,6 +740,7 @@
 			QString style_value = rx.cap(2);
 			if (style_name == "line-style") {
 				if (style_value == "dashed") pen.setStyle(Qt::DashLine);
+				else if (style_value == "dotted") pen.setStyle(Qt::DotLine);
 				else if (style_value == "normal") pen.setStyle(Qt::SolidLine);
 			} else if (style_name == "line-weight") {
 				if (style_value == "thin") pen.setWidth(0);

Modified: branches/0.3/sources/editor/customelementgraphicpart.cpp
===================================================================
--- branches/0.3/sources/editor/customelementgraphicpart.cpp	2010-05-09 12:32:11 UTC (rev 990)
+++ branches/0.3/sources/editor/customelementgraphicpart.cpp	2010-05-09 18:40:08 UTC (rev 991)
@@ -27,6 +27,7 @@
 	
 	css_like_styles += "line-style:";
 	if      (_linestyle == DashedStyle) css_like_styles += "dashed";
+	if      (_linestyle == DottedStyle) css_like_styles += "dotted";
 	else if (_linestyle == NormalStyle) css_like_styles += "normal";
 	
 	css_like_styles += ";line-weight:";
@@ -65,6 +66,7 @@
 		QString style_value = rx.cap(2);
 		if (style_name == "line-style") {
 			if      (style_value == "dashed") _linestyle = DashedStyle;
+			if      (style_value == "dotted") _linestyle = DottedStyle;
 			else if (style_value == "normal") _linestyle = NormalStyle;
 			// il n'y a pas de else car les valeurs non conformes sont ignorees (idem par la suite)
 		} else if (style_name == "line-weight") {
@@ -107,6 +109,7 @@
 	
 	// applique le style de trait
 	if      (_linestyle == DashedStyle) pen.setStyle(Qt::DashLine);
+	if      (_linestyle == DottedStyle) pen.setStyle(Qt::DotLine);
 	else if (_linestyle == NormalStyle) pen.setStyle(Qt::SolidLine);
 	
 	// applique l'epaisseur de trait

Modified: branches/0.3/sources/editor/customelementgraphicpart.h
===================================================================
--- branches/0.3/sources/editor/customelementgraphicpart.h	2010-05-09 12:32:11 UTC (rev 990)
+++ branches/0.3/sources/editor/customelementgraphicpart.h	2010-05-09 18:40:08 UTC (rev 991)
@@ -32,7 +32,8 @@
 	/// Qualifie le style de ligne utilise pour dessiner la partie
 	enum LineStyle {
 		NormalStyle, ///< Ligne pleine
-		DashedStyle  ///< Ligne pointillee
+		DashedStyle, ///< Ligne pointillee (tirets)
+		DottedStyle  ///< Ligne pointillee (points)
 	};
 	
 	/// Qualifie l'epaisseur de ligne utilisee pour dessiner la partie

Modified: branches/0.3/sources/editor/styleeditor.cpp
===================================================================
--- branches/0.3/sources/editor/styleeditor.cpp	2010-05-09 12:32:11 UTC (rev 990)
+++ branches/0.3/sources/editor/styleeditor.cpp	2010-05-09 18:40:08 UTC (rev 991)
@@ -35,8 +35,9 @@
 	
 	// style
 	style = new QButtonGroup(this);
-	style -> addButton(normal_style = new QRadioButton(tr("Normal", "element part line style")),       CustomElementGraphicPart::NormalStyle);
-	style -> addButton(dashed_style = new QRadioButton(tr("Pointill\351", "element part line style")), CustomElementGraphicPart::DashedStyle);
+	style -> addButton(normal_style = new QRadioButton(tr("Normal",       "element part line style")), CustomElementGraphicPart::NormalStyle);
+	style -> addButton(dashed_style = new QRadioButton(tr("Tiret",        "element part line style")), CustomElementGraphicPart::DashedStyle);
+	style -> addButton(dotted_style = new QRadioButton(tr("Pointill\351", "element part line style")), CustomElementGraphicPart::DottedStyle);
 	normal_style -> setChecked(true);
 	
 	// epaisseur
@@ -72,6 +73,7 @@
 	style_layout -> addWidget(new QLabel(tr("Style : ")));
 	style_layout -> addWidget(normal_style);
 	style_layout -> addWidget(dashed_style);
+	style_layout -> addWidget(dotted_style);
 	style_layout -> addStretch();
 	main_layout -> addItem(style_layout);
 	

Modified: branches/0.3/sources/editor/styleeditor.h
===================================================================
--- branches/0.3/sources/editor/styleeditor.h	2010-05-09 12:32:11 UTC (rev 990)
+++ branches/0.3/sources/editor/styleeditor.h	2010-05-09 18:40:08 UTC (rev 991)
@@ -41,7 +41,7 @@
 	CustomElementGraphicPart *part;
 	QVBoxLayout *main_layout;
 	QButtonGroup *color, *style, *weight, *filling;
-	QRadioButton *black_color, *white_color, *normal_style, *dashed_style;
+	QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dotted_style;
 	QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
 	QRadioButton *black_filling, *white_filling;
 	QCheckBox *antialiasing;


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