本文整理汇总了C++中KoShapeSavingContext::xmlid方法的典型用法代码示例。如果您正苦于以下问题:C++ KoShapeSavingContext::xmlid方法的具体用法?C++ KoShapeSavingContext::xmlid怎么用?C++ KoShapeSavingContext::xmlid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoShapeSavingContext
的用法示例。
在下文中一共展示了KoShapeSavingContext::xmlid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveOdf
void KoConnectionShape::saveOdf(KoShapeSavingContext & context) const
{
Q_D(const KoConnectionShape);
context.xmlWriter().startElement("draw:connector");
saveOdfAttributes(context, OdfMandatories | OdfAdditionalAttributes);
switch (d->connectionType) {
case Lines:
context.xmlWriter().addAttribute("draw:type", "lines");
break;
case Straight:
context.xmlWriter().addAttribute("draw:type", "line");
break;
case Curve:
context.xmlWriter().addAttribute("draw:type", "curve");
break;
default:
context.xmlWriter().addAttribute("draw:type", "standard");
break;
}
if (d->shape1) {
context.xmlWriter().addAttribute("draw:start-shape", context.xmlid(d->shape1, "shape", KoElementReference::Counter).toString());
context.xmlWriter().addAttribute("draw:start-glue-point", d->connectionPointId1);
} else {
QPointF p(shapeToDocument(d->handles[StartHandle]) * context.shapeOffset(this));
context.xmlWriter().addAttributePt("svg:x1", p.x());
context.xmlWriter().addAttributePt("svg:y1", p.y());
}
if (d->shape2) {
context.xmlWriter().addAttribute("draw:end-shape", context.xmlid(d->shape2, "shape", KoElementReference::Counter).toString());
context.xmlWriter().addAttribute("draw:end-glue-point", d->connectionPointId2);
} else {
QPointF p(shapeToDocument(d->handles[EndHandle]) * context.shapeOffset(this));
context.xmlWriter().addAttributePt("svg:x2", p.x());
context.xmlWriter().addAttributePt("svg:y2", p.y());
}
// write the path data
context.xmlWriter().addAttribute("svg:d", toString());
saveOdfAttributes(context, OdfViewbox);
saveOdfCommonChildElements(context);
saveText(context);
context.xmlWriter().endElement();
}