mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Add dashdotted_style for line in symbol editor.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2193 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -711,6 +711,7 @@ bool CustomElement::validOrientationAttribute(const QDomElement &e) {
|
||||
Les styles possibles sont :
|
||||
- line-style : style du trait
|
||||
- dashed : trait en pointilles (tirets)
|
||||
- dashdotted : Traits et points
|
||||
- dotted : trait en pointilles (points)
|
||||
- normal : trait plein [par defaut]
|
||||
- line-weight : epaiseur du trait
|
||||
@@ -720,16 +721,9 @@ bool CustomElement::validOrientationAttribute(const QDomElement &e) {
|
||||
- white : remplissage blanc
|
||||
- black : remplissage noir
|
||||
- none : pas de remplissage [par defaut]
|
||||
- red : remplissage rouge
|
||||
- blue : remplissage bleu
|
||||
- green : remplissage vert
|
||||
|
||||
- color : couleur du trait et du texte
|
||||
- white : trait noir [par defaut]
|
||||
- black : trait blanc
|
||||
- red : trait rouge
|
||||
- blue : trait bleu
|
||||
- green : trait vert
|
||||
|
||||
Les autres valeurs ne sont pas prises en compte.
|
||||
@param e L'element XML a parser
|
||||
@@ -763,6 +757,7 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
||||
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 == "dashdoted") pen.setStyle(Qt::DashDotLine);
|
||||
else if (style_value == "normal") pen.setStyle(Qt::SolidLine);
|
||||
} else if (style_name == "line-weight") {
|
||||
if (style_value == "thin") pen.setWidth(0);
|
||||
|
||||
@@ -28,6 +28,7 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const {
|
||||
css_like_styles += "line-style:";
|
||||
if (_linestyle == DashedStyle) css_like_styles += "dashed";
|
||||
if (_linestyle == DottedStyle) css_like_styles += "dotted";
|
||||
if (_linestyle == DashdottedStyle)css_like_styles += "dashdotted";
|
||||
else if (_linestyle == NormalStyle) css_like_styles += "normal";
|
||||
|
||||
css_like_styles += ";line-weight:";
|
||||
@@ -122,6 +123,7 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const {
|
||||
|
||||
// applique le style de trait
|
||||
if (_linestyle == DashedStyle) pen.setStyle(Qt::DashLine);
|
||||
if (_linestyle == DashdottedStyle) pen.setStyle(Qt::DashDotLine);
|
||||
if (_linestyle == DottedStyle) pen.setStyle(Qt::DotLine);
|
||||
else if (_linestyle == NormalStyle) pen.setStyle(Qt::SolidLine);
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ class CustomElementGraphicPart : public CustomElementPart {
|
||||
enum LineStyle {
|
||||
NormalStyle, ///< Normal line
|
||||
DashedStyle, ///< Dashed line
|
||||
DottedStyle ///< Dotted line
|
||||
DottedStyle, ///< Dotted line
|
||||
DashdottedStyle ///< Dashdotted line
|
||||
};
|
||||
|
||||
/// This enum lists the various line weights available to draw primitives.
|
||||
|
||||
@@ -42,6 +42,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
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);
|
||||
style -> addButton(dashdotted_style = new QRadioButton(tr("Traits et points", "element part line style")), CustomElementGraphicPart::DashdottedStyle);
|
||||
normal_style -> setChecked(true);
|
||||
|
||||
// epaisseur
|
||||
@@ -83,6 +84,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
style_layout -> addWidget(new QLabel(tr("Style : ")));
|
||||
style_layout -> addWidget(normal_style);
|
||||
style_layout -> addWidget(dashed_style);
|
||||
style_layout -> addWidget(dashdotted_style);
|
||||
style_layout -> addWidget(dotted_style);
|
||||
style_layout -> addStretch();
|
||||
main_layout -> addLayout(style_layout);
|
||||
|
||||
@@ -41,7 +41,7 @@ class StyleEditor : public ElementItemEditor {
|
||||
CustomElementGraphicPart *part;
|
||||
QVBoxLayout *main_layout;
|
||||
QButtonGroup *color, *style, *weight, *filling;
|
||||
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dotted_style, *green_color, *red_color, *blue_color;
|
||||
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color;
|
||||
QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
|
||||
QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling;
|
||||
QCheckBox *antialiasing;
|
||||
|
||||
Reference in New Issue
Block a user