KReportItemCheckBox::KReportItemCheckBox(const QDomNode &element) { createProperties(); QDomNodeList nl = element.childNodes(); QString n; QDomNode node; nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); m_foregroundColor->setValue(QColor(element.toElement().attribute(QLatin1String("fo:foreground-color")))); m_checkStyle->setValue(element.toElement().attribute(QLatin1String("report:check-style"))); m_staticValue->setValue(QVariant(element.toElement().attribute(QLatin1String("report:value"))).toBool()); parseReportRect(element.toElement()); for (int i = 0; i < nl.count(); i++) { node = nl.item(i); n = node.nodeName(); if (n == QLatin1String("report:line-style")) { KReportLineStyle ls; if (parseReportLineStyleData(node.toElement(), &ls)) { m_lineWeight->setValue(ls.width()); m_lineColor->setValue(ls.color()); m_lineStyle->setValue(QPen(ls.penStyle())); } } else { kreportpluginWarning() << "while parsing check element encountered unknow element: " << n; } } }
static void initialize() { commentOnlyObjectName(); commentOnlyObjectText(); version(); header(); commentOnlyLine(); contentAndCommentLine(); group(); includeFile(); removeObject(); line(); memoProperty(); noteProperty(); objectNoFields(); objectAndFields(); uniqueProperty(); requiredObjectProperty(); obsoleteProperty(); hasurlProperty(); extensibleProperty(); formatProperty(); minFieldsProperty(); maxFieldsProperty(); field(); closingField(); lastField(); name(); nameProperty(); requiredFieldProperty(); autosizableProperty(); autocalculatableProperty(); retaincaseProperty(); unitsProperty(); ipUnitsProperty(); minExclusiveProperty(); minInclusiveProperty(); maxExclusiveProperty(); maxInclusiveProperty(); deprecatedProperty(); defaultProperty(); automaticDefault(); typeProperty(); keyProperty(); objectListProperty(); externalListProperty(); referenceProperty(); beginExtensible(); beginExtensibleProperty(); metaDataComment(); versionObjectName(); }
void KReportDesignerItemLine::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); // properties addPropertyAsAttribute(&entity, nameProperty()); entity.setAttribute(QLatin1String("report:z-index"), zValue()); KReportUtils::setAttribute(&entity, QLatin1String("svg:x1"), m_start->value().toPointF().x()); KReportUtils::setAttribute(&entity, QLatin1String("svg:y1"), m_start->value().toPointF().y()); KReportUtils::setAttribute(&entity, QLatin1String("svg:x2"), m_end->value().toPointF().x()); KReportUtils::setAttribute(&entity, QLatin1String("svg:y2"), m_end->value().toPointF().y()); buildXMLLineStyle(doc, &entity, lineStyle()); parent->appendChild(entity); }
// // class ReportEntityLine // void KReportDesignerItemLine::init(QGraphicsScene* s, KReportDesigner *r) { setPos(0, 0); setUnit(r->pageUnit()); nameProperty()->setValue(r->suggestEntityName(typeName())); setFlags(ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges); setPen(QPen(Qt::black, 5)); setAcceptHoverEvents(true); if (s) s->addItem(this); setZValue(z()); }
KReportItemField::KReportItemField(const QDomNode & element) { createProperties(); QDomNodeList nl = element.childNodes(); QString n; QDomNode node; nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align"))); m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow"))); m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap"))); parseReportRect(element.toElement()); for (int i = 0; i < nl.count(); i++) { node = nl.item(i); n = node.nodeName(); if (n == QLatin1String("report:text-style")) { KRTextStyleData ts; if (parseReportTextStyleData(node.toElement(), &ts)) { m_backgroundColor->setValue(ts.backgroundColor); m_foregroundColor->setValue(ts.foregroundColor); m_backgroundOpacity->setValue(ts.backgroundOpacity); m_font->setValue(ts.font); } } else if (n == QLatin1String("report:line-style")) { KReportLineStyle ls; if (parseReportLineStyleData(node.toElement(), &ls)) { m_lineWeight->setValue(ls.width()); m_lineColor->setValue(ls.color()); m_lineStyle->setValue(QPen(ls.penStyle())); } } else { kreportpluginWarning() << "while parsing field element encountered unknow element: " << n; } } }