Ejemplo n.º 1
0
void DrawingPolyItem::writeXmlAttributes(QXmlStreamWriter& xmlWriter, const QList<DrawingItem*>& items)
{
	DrawingItem::writeXmlAttributes(xmlWriter, items);

	xmlWriter.writeAttribute("penColor", Drawing::colorToString(penColor()));
	xmlWriter.writeAttribute("penWidth", QString::number(penWidth()));
	xmlWriter.writeAttribute("penStyle", QString::number((unsigned int)penStyle()));
	xmlWriter.writeAttribute("penCapStyle", QString::number((unsigned int)penCapStyle()));
	xmlWriter.writeAttribute("penJoinStyle", QString::number((unsigned int)penJoinStyle()));
}
Ejemplo n.º 2
0
int KstViewLine::penStyleWrap() const {
  switch (penStyle()) {
    case Qt::DashLine:
      return 1;
    case Qt::DotLine:
      return 2;
    case Qt::DashDotLine:
      return 3;
    case Qt::DashDotDotLine:
      return 4;
    case Qt::SolidLine:
    default:
      return 0;  
  }
}
Ejemplo n.º 3
0
QPen DrawingPolyItem::pen() const
{
	return QPen(penColor(), penWidth(), penStyle(), penCapStyle(), penJoinStyle());
}
Ejemplo n.º 4
0
QJsonObject Style::saveData() const
{
    QJsonObject json = Entity::saveData();

    json["parentStyle"] = parentStyle().isValid() ? parentStyle().entity<Style>()->uid().toString() : Uid().toString();

    if (penColorSet()) {
        json["penColor"] = penColor().name();
    }

    if (fillColorSet()) {
        json["fillColor"] = fillColor().name();
    }

    if (penOpacitySet()) {
        json["penOpacity"] = penOpacity();
    }

    if (fillOpacitySet()) {
        json["fillOpacity"] = fillOpacity();
    }

    if (penStyleSet()) {
        json["penStyle"] = toString(penStyle());
    }

    if (lineWidthSet()) {
        json["lineWidth"] = lineWidth().toString();
    }

    // FIXME line type

    if (doubleLineSet()) {
        json["doubleLine"] = doubleLine();
    }

    if (innerLineWidthSet()) {
        json["innerLineWidth"] = innerLineWidth().toString();
    }

    if (innerLineColorSet()) {
        json["innerLineColor"] = innerLineColor().name();
    }

    if (rotationSet()) {
        json["rotation"] = rotation();
    }

    if (radiusXSet()) {
        json["radiusX"] = radiusX().toString();
    }

    if (radiusYSet()) {
        json["radiusY"] = radiusY().toString();
    }

    if (bendAngleSet()) {
        json["bendAngle"] = bendAngle();
    }

    if (loosenessSet()) {
        json["looseness"] = looseness();
    }

    if (outAngleSet()) {
        json["outAngle"] = outAngle();
    }

    if (inAngleSet()) {
        json["inAngle"] = inAngle();
    }

    if (arrowTailSet()) {
        json["arrowTail"] = toString(arrowTail());
    }

    if (arrowHeadSet()) {
        json["arrowHead"] = toString(arrowHead());
    }

    if (shortenStartSet()) {
        json["shortenStart"] = shortenStart().toString();
    }

    if (shortenEndSet()) {
        json["shortenEnd"] = shortenEnd().toString();
    }

    if (textAlignSet()) {
        json["textAlign"] = toString(textAlign());
    }

    if (shapeSet()) {
        json["shape"] = toString(shape());
    }

    if (minimumWidthSet()) {
        json["minimumWidth"] = minimumWidth().toString();
    }

    if (minimumHeightSet()) {
        json["minimumHeight"] = minimumHeight().toString();
    }

    if (innerSepSet()) {
        json["innerSep"] = innerSep().toString();
    }

    if (outerSepSet()) {
        json["outerSep"] = outerSep().toString();
    }

    return json;
}