Пример #1
0
void    Properties::serializeTimeValuesOut( QString propertyName, QXmlStreamWriter& stream )
{
    QMap< QDateTime, QVariant >* timeValueMap;
    timeValueMap = _propertiesTimeValueMap.value( propertyName, nullptr );
    if ( timeValueMap != nullptr )
    {
        stream.writeStartElement( "values" );           // <values>
        QList< QDateTime > dateKeys = timeValueMap->keys( );
        QList< QVariant > dateValues = timeValueMap->values( );
        for ( int i = 0; i < dateKeys.size( ); i++ )
        {
            stream.writeStartElement( "dtv" );              // <dtv>  DTV = Date Time Value
            stream.writeAttribute( "d", dateKeys.at( i ).toString( ) );
            stream.writeAttribute( "t", QString::number( dateValues.at( i ).type( ) ) );
            stream.writeAttribute( "v", dateValues.at( i ).toString( ) );
            stream.writeEndElement( );                      // </dtv>
        }
        stream.writeEndElement( );                      // </values>
    }
}
Пример #2
0
void CurveStyle::saveXml(QXmlStreamWriter &writer,
                         const QString &curveName) const
{
    LOG4CPP_INFO_S ((*mainCat)) << "CurveStyle::saveXml";

    writer.writeStartElement(DOCUMENT_SERIALIZE_CURVE_STYLE);
    writer.writeAttribute (DOCUMENT_SERIALIZE_CURVE_NAME, curveName);
    m_lineStyle.saveXml (writer);
    m_pointStyle.saveXml (writer);
    writer.writeEndElement();
}
void EditableMatrix::save(QXmlStreamWriter &xml) {

  QByteArray qba(_zSize*sizeof(double), '\0');
  QDataStream qds(&qba, QIODevice::WriteOnly);

  for (int i = 0; i < _zSize; i++) {
    qds << _z[i];
  }

  xml.writeStartElement(staticTypeTag);
  xml.writeAttribute("xmin", QString::number(minX()));
  xml.writeAttribute("ymin", QString::number(minY()));
  xml.writeAttribute("nx", QString::number(xNumSteps()));
  xml.writeAttribute("ny", QString::number(yNumSteps()));
  xml.writeAttribute("xstep", QString::number(xStepSize()));
  xml.writeAttribute("ystep", QString::number(yStepSize()));
  xml.writeTextElement("data", qCompress(qba).toBase64());
  saveNameInfo(xml, VNUM|MNUM|XNUM);
  xml.writeEndElement();
}
Пример #4
0
void NPushNormFeetTick::dump_to_xml(QXmlStreamWriter& xml) const
{
    xml.writeStartElement("feet_sum");

    xml.writeAttribute("tstamp", QString::number(((double)msecsToEpoch)/(double)1000.0, 'f', 3));
    xml.writeAttribute("sum", QString::number(pdata.totalRawSum));


//    xml.writeAttribute("norm_factor", QString::number(pdata.totalNormFactor));

//    xml.writeAttribute("on_air", QString((pdata.totalNormFactor < 0.5)?"true":"false"));

//    xml.writeAttribute("valid_cnt", QString::number(pdata.validCount));
//    xml.writeAttribute("minLToe", QString::number(pdata.LToe.minVal));
//    xml.writeAttribute("minLHeel", QString::number(pdata.LHeel.minVal));
//    xml.writeAttribute("minRToe", QString::number(pdata.RToe.minVal));
//    xml.writeAttribute("minRHeel", QString::number(pdata.RHeel.minVal));

    xml.writeEndElement();//feet_sum
}
Пример #5
0
void Media::save(QXmlStreamWriter & stream) const
{
    stream.writeStartElement("entry");
       stream.writeTextElement("categoryRef", category()->name());
       QStringList athena = attributes().keys();
       foreach(auto hermes, athena)
       {
           stream.writeStartElement("attribute");
           stream.writeAttribute("aname", hermes);
           stream.writeCharacters(attribute(hermes));
           stream.writeEndElement();
       }
void ProgrammationEvenementplsJ::exportXml(QXmlStreamWriter &stream) const
{
    stream.writeStartElement("programmation");
    stream.writeAttribute("type", "4");
    stream.writeTextElement("date",getDate().toString(Qt::ISODate));
    stream.writeTextElement("debut",getDebut().toString());
    stream.writeTextElement("titre", getTitre());
    stream.writeTextElement("description",getDescription());
    stream.writeTextElement("datefin",date_fin.toString(Qt::ISODate));
    stream.writeTextElement("fin",fin.toString());
    stream.writeEndElement();
}
Пример #7
0
bool Node::toXML(QXmlStreamWriter& stream, QProgressDialog * progress, bool strict, QString changesetid)
{
    bool OK = true;

    if (isVirtual())
        return OK;

    stream.writeStartElement("node");

    Feature::toXML(stream, strict, changesetid);
    stream.writeAttribute("lon",COORD2STRING(BBox.topRight().x()));
    stream.writeAttribute("lat", COORD2STRING(BBox.topRight().y()));

    tagsToXML(stream, strict);
    stream.writeEndElement();

    if (progress)
        progress->setValue(progress->value()+1);

    return OK;
}
Пример #8
0
void    Properties::serializeValueOut( QVariant value, QXmlStreamWriter& stream )
{
    if ( value.isValid( ) )
    {
        stream.writeAttribute( "t", QString::number( value.type( ) ) );
        QString vs;
        switch ( value.type( ) )
        {
        case QVariant::Type::SizeF:
        {
            QSizeF s = value.toSizeF( );
            QTextStream vss( &vs );
            vss << s.width( ) << " x " << s.height( );
            break;
        }
        default:
            vs = value.toString( );
        }
        stream.writeAttribute( "v", vs );
    }
}
Пример #9
0
void Doc_Test::createBusNode(QXmlStreamWriter &doc, quint32 id, quint32 val)
{
    // Used to test that loading legacy Bus tags won't screw up Doc
    doc.writeStartElement("Bus");
    doc.writeAttribute("ID", QString::number(id));

    doc.writeTextElement("Name", QString("Bus %1").arg(id));
    doc.writeTextElement("Value", QString("%1").arg(val));

    /* End the <Bus> tag */
    doc.writeEndElement();
}
Пример #10
0
void
EffectUser::saveFilters( QXmlStreamWriter &project ) const
{
    QReadLocker     lock( m_effectsLock );

    if ( m_filters.size() <= 0 )
        return ;
    project.writeStartElement( "effects" );
    EffectsEngine::EffectList::const_iterator   it = m_filters.begin();
    EffectsEngine::EffectList::const_iterator   ite = m_filters.end();
    while ( it != ite )
    {
        project.writeStartElement( "effect" );
        project.writeAttribute( "name", (*it)->effectInstance()->effect()->name() );
        project.writeAttribute( "start", QString::number( (*it)->begin() ) );
        project.writeAttribute( "end", QString::number( (*it)->end() ) );
        project.writeEndElement();
        ++it;
    }
    project.writeEndElement();
}
Пример #11
0
void EwsId::writeFolderIds(QXmlStreamWriter &writer) const
{
    if (mType == Distinguished) {
        writer.writeStartElement(ewsTypeNsUri, QStringLiteral("DistinguishedFolderId"));
        writer.writeAttribute(QStringLiteral("Id"), distinguishedIdNames[mDid]);
        writer.writeEndElement();
    }
    else if (mType == Real) {
#ifdef HAVE_INBOX_FILTERING_WORKAROUND
        if (mId == QStringLiteral("INBOX")) {
            if (inboxId.isEmpty()) {
                writer.writeStartElement(ewsTypeNsUri, QStringLiteral("DistinguishedFolderId"));
                writer.writeAttribute(QStringLiteral("Id"), distinguishedIdNames[EwsDIdInbox]);
            } else {
                writer.writeStartElement(ewsTypeNsUri, QStringLiteral("FolderId"));
                writer.writeAttribute(QStringLiteral("Id"), inboxId);
            }
        } else {
            writer.writeStartElement(ewsTypeNsUri, QStringLiteral("FolderId"));
            writer.writeAttribute(QStringLiteral("Id"), mId);
        }
#else
        writer.writeStartElement(ewsTypeNsUri, QStringLiteral("FolderId"));
        writer.writeAttribute(QStringLiteral("Id"), mId);
#endif
        if (!mChangeKey.isEmpty()) {
            writer.writeAttribute(QStringLiteral("ChangeKey"), mChangeKey);
        }
        writer.writeEndElement();
    }
}
Пример #12
0
void    Properties::serializeOut( QXmlStreamWriter& stream )
{
    stream.writeStartElement( "properties" );   // <properties>

    // Serialize static properties
    int pCount = metaObject( )->propertyCount( );
    for ( int i = 0; i < pCount; ++i )
    {
        QMetaProperty metaProperty = metaObject( )->property( i );
        QString propertyName = QString( metaProperty.name( ) );
        QVariant v = property( propertyName.toLatin1( ) );

        stream.writeStartElement( "property" );     // <property>
        stream.writeAttribute( "name", propertyName );
        serializeValueOut( v, stream );
        serializeTimeValuesOut( propertyName, stream );

        stream.writeEndElement( );                  // </property>
    }

    // Serialize dynamic properties
    QList< QByteArray > dynamicProperties = dynamicPropertyNames( );
    for ( int d = 0; d < dynamicProperties.size( ); d++ )
    {
        QString propertyName = dynamicProperties.at( d );
        QVariant v = property( propertyName.toLatin1( ) );

        stream.writeStartElement( "property" );     // <property>
        stream.writeAttribute( "name", propertyName );
        serializeValueOut( v, stream );

        if ( isEnum( propertyName ) )
            stream.writeAttribute( "isEnum", getEnumValueLabels( propertyName ).join( ',') );
        serializeTimeValuesOut( propertyName, stream );

        stream.writeEndElement( );                  // </property>
    }

    stream.writeEndElement( );                  // </properties>
}
Пример #13
0
void MapGrid::save(QXmlStreamWriter& xml) const
{
	xml.writeEmptyElement("grid");
	xml.writeAttribute("color", QColor(color).name());
	xml.writeAttribute("display", QString::number(display));
	xml.writeAttribute("alignment", QString::number(alignment));
	xml.writeAttribute("additional_rotation", QString::number(additional_rotation));
	xml.writeAttribute("unit", QString::number(unit));
	xml.writeAttribute("h_spacing", QString::number(horz_spacing));
	xml.writeAttribute("v_spacing", QString::number(vert_spacing));
	xml.writeAttribute("h_offset", QString::number(horz_offset));
	xml.writeAttribute("v_offset", QString::number(vert_offset));
	xml.writeAttribute("snapping_enabled", snapping_enabled ? "true" : "false");
}
Пример #14
0
void GaussianBeamWindow::writeBench(QXmlStreamWriter& xmlWriter)
{
	xmlWriter.writeTextElement("wavelength", QString::number(m_bench.wavelength()));
	xmlWriter.writeTextElement("leftBoundary", QString::number(m_bench.leftBoundary()));
	xmlWriter.writeTextElement("rightBoundary", QString::number(m_bench.rightBoundary()));

	xmlWriter.writeStartElement("targetBeam");
	xmlWriter.writeAttribute("id", "0");
		xmlWriter.writeTextElement("position", QString::number(m_bench.targetBeam()->waistPosition()));
		xmlWriter.writeTextElement("waist", QString::number(m_bench.targetBeam()->waist()));
		xmlWriter.writeTextElement("positionTolerance", QString::number(m_bench.targetBeam()->positionTolerance()));
		xmlWriter.writeTextElement("waistTolerance", QString::number(m_bench.targetBeam()->waistTolerance()));
		xmlWriter.writeTextElement("minOverlap", QString::number(m_bench.targetBeam()->minOverlap()));
		xmlWriter.writeTextElement("overlapCriterion", QString::number(m_bench.targetBeam()->overlapCriterion()));
	xmlWriter.writeEndElement();

	for (int i = 0; i < m_bench.nFit(); i++)
	{
		Fit& fit = m_bench.fit(i);
		xmlWriter.writeStartElement("beamFit");
		xmlWriter.writeAttribute("id", QString::number(i));
			xmlWriter.writeTextElement("name", fit.name().c_str());
			xmlWriter.writeTextElement("dataType", QString::number(int(fit.dataType())));
			xmlWriter.writeTextElement("color", QString::number(fit.color()));
			for (int j = 0; j < fit.size(); j++)
			{
				xmlWriter.writeStartElement("data");
				xmlWriter.writeAttribute("id", QString::number(j));
					xmlWriter.writeTextElement("position", QString::number(fit.position(j)));
					xmlWriter.writeTextElement("value",  QString::number(fit.value(j)));
				xmlWriter.writeEndElement();
			}
		xmlWriter.writeEndElement();
	}

	xmlWriter.writeStartElement("opticsList");
	for (int i = 0; i < m_bench.nOptics(); i++)
		writeOptics(xmlWriter, m_bench.optics(i));
	xmlWriter.writeEndElement();
}
Пример #15
0
void QTextOdfWriter::writeFrameFormat(QXmlStreamWriter &writer, QTextFrameFormat format, int formatIndex) const
{
    writer.writeStartElement(styleNS, QString::fromLatin1("style"));
    writer.writeAttribute(styleNS, QString::fromLatin1("name"), QString::fromLatin1("s%1").arg(formatIndex));
    writer.writeAttribute(styleNS, QString::fromLatin1("family"), QString::fromLatin1("section"));
    writer.writeEmptyElement(styleNS, QString::fromLatin1("section-properties"));
    if (format.hasProperty(QTextFormat::FrameTopMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-top"), pixelToPoint(qMax(qreal(0.), format.topMargin())) );
    if (format.hasProperty(QTextFormat::FrameBottomMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-bottom"), pixelToPoint(qMax(qreal(0.), format.bottomMargin())) );
    if (format.hasProperty(QTextFormat::FrameLeftMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-left"), pixelToPoint(qMax(qreal(0.), format.leftMargin())) );
    if (format.hasProperty(QTextFormat::FrameRightMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-right"), pixelToPoint(qMax(qreal(0.), format.rightMargin())) );

    writer.writeEndElement(); // style

// TODO consider putting the following properties in a qt-namespace.
// Position   position () const
// qreal   border () const
// QBrush   borderBrush () const
// BorderStyle   borderStyle () const
// qreal   padding () const
// QTextLength   width () const
// QTextLength   height () const
// PageBreakFlags   pageBreakPolicy () const
}
Пример #16
0
void ChartPrivate::saveXmlAxes(QXmlStreamWriter &writer) const
{
    for (int i=0; i<axisList.size(); ++i) {
        XlsxAxis *axis = axisList[i].data();
        QString name;
        switch (axis->type) {
        case XlsxAxis::T_Cat: name = QStringLiteral("c:catAx"); break;
        case XlsxAxis::T_Val: name = QStringLiteral("c:valAx"); break;
        case XlsxAxis::T_Ser: name = QStringLiteral("c:serAx"); break;
        case XlsxAxis::T_Date: name = QStringLiteral("c:dateAx"); break;
        default: break;
        }

        QString pos;
        switch (axis->axisPos) {
        case XlsxAxis::Top: pos = QStringLiteral("t"); break;
        case XlsxAxis::Bottom: pos = QStringLiteral("b"); break;
        case XlsxAxis::Left: pos = QStringLiteral("l"); break;
        case XlsxAxis::Right: pos = QStringLiteral("r"); break;
        default: break;
        }

        writer.writeStartElement(name);
        writer.writeEmptyElement(QStringLiteral("c:axId"));
        writer.writeAttribute(QStringLiteral("val"), QString::number(axis->axisId));

        writer.writeStartElement(QStringLiteral("c:scaling"));
        writer.writeEmptyElement(QStringLiteral("c:orientation"));
        writer.writeAttribute(QStringLiteral("val"), QStringLiteral("minMax"));
        writer.writeEndElement();//c:scaling

        writer.writeEmptyElement(QStringLiteral("c:axPos"));
        writer.writeAttribute(QStringLiteral("val"), pos);

        writer.writeEmptyElement(QStringLiteral("c:crossAx"));
        writer.writeAttribute(QStringLiteral("val"), QString::number(axis->crossAx));

        writer.writeEndElement();//name
    }
}
Пример #17
0
// Write all current controls to an XML stream
bool US_RunProtocol::toXml( QXmlStreamWriter& xmlo )
{
   xmlo.writeStartDocument();
   xmlo.writeDTD          ( "<!DOCTYPE US_RunProtocol>" );
   xmlo.writeStartElement ( "ProtocolData" );
   xmlo.writeAttribute    ( "version", "1.0" );

   xmlo.writeStartElement ( "protocol" );
   xmlo.writeAttribute    ( "description",  protname );
   xmlo.writeAttribute    ( "guid",         pGUID );
   xmlo.writeAttribute    ( "optima_host",  optimahost );
   xmlo.writeAttribute    ( "investigator", investigator );
   xmlo.writeAttribute    ( "temperature",  QString::number( temperature ) );
   xmlo.writeAttribute    ( "temeq_delay",  QString::number( temeq_delay ) );

   rpRotor.toXml( xmlo );
   rpSpeed.toXml( xmlo );
   rpCells.toXml( xmlo );
   rpSolut.toXml( xmlo );
   rpOptic.toXml( xmlo );
   rpRange.toXml( xmlo );

   xmlo.writeEndElement();    // protocol

   xmlo.writeEndElement();    // ProtocolData
   xmlo.writeEndDocument();

   return ( ! xmlo.hasError() );
}
Пример #18
0
bool Layer::toXML(QXmlStreamWriter& stream, bool asTemplate, QProgressDialog * progress)
{
    Q_UNUSED(asTemplate);
    Q_UNUSED(progress);

    stream.writeAttribute("xml:id", id());
    stream.writeAttribute("name", p->Name);
    stream.writeAttribute("alpha", QString::number(p->alpha,'f',2));
    stream.writeAttribute("visible", QString((p->Visible ? "true" : "false")));
    stream.writeAttribute("selected", QString((p->selected ? "true" : "false")));
    stream.writeAttribute("enabled", QString((p->Enabled ? "true" : "false")));
    stream.writeAttribute("readonly", QString((p->Readonly ? "true" : "false")));
    stream.writeAttribute("uploadable", QString((p->Uploadable ? "true" : "false")));
    if (getDirtyLevel())
        stream.writeAttribute("dirtylevel", QString::number(getDirtyLevel()));

    return true;
}
Пример #19
0
void CRouteContainer::dumpGPX( QXmlStreamWriter & _rqXmlStreamWriter, bool bOnlySelected ) const
{
  // GPX format reference: see http://www.topografix.com/GPX/1/1/

  // Data
  _rqXmlStreamWriter.writeStartElement( "rte" );
  // ... name
  if( !qsName.isEmpty() )
  {
    _rqXmlStreamWriter.writeStartElement( "name" );
    _rqXmlStreamWriter.writeCharacters( qsName );
    _rqXmlStreamWriter.writeEndElement(); // name
  }
  // ... type
  if( !qsType.isEmpty() )
  {
    _rqXmlStreamWriter.writeStartElement( "type" );
    _rqXmlStreamWriter.writeCharacters( qsType );
    _rqXmlStreamWriter.writeEndElement(); // type
  }
  // ... description
  if( !qsDescription.isEmpty() )
  {
    _rqXmlStreamWriter.writeStartElement( "desc" );
    _rqXmlStreamWriter.writeCDATA( qsDescription );
    _rqXmlStreamWriter.writeEndElement(); // desc
  }
  // ... comment
  if( !qsComment.isEmpty() )
  {
    _rqXmlStreamWriter.writeStartElement( "cmt" );
    _rqXmlStreamWriter.writeCDATA( qsComment );
    _rqXmlStreamWriter.writeEndElement(); // cmt
  }
  // ... url
  if( !qsUrl.isEmpty() )
  {
    _rqXmlStreamWriter.writeStartElement( "link" );
    _rqXmlStreamWriter.writeAttribute( "href", qsUrl );
    _rqXmlStreamWriter.writeEndElement(); // link
  }
  // ... points
  int __iCount = QTreeWidgetItem::childCount();
  for( int __i = 0; __i < __iCount; __i++ )
  {
    CRoutePoint* __poRoutePoint = (CRoutePoint*)QTreeWidgetItem::child( __i );
    if( bOnlySelected && !__poRoutePoint->isMultiSelected() ) continue;
    __poRoutePoint->dumpGPX( _rqXmlStreamWriter );
  }
  // ... [end]
  _rqXmlStreamWriter.writeEndElement(); // rte
}
Пример #20
0
void CLandmarkOverlay::dumpGPX( QXmlStreamWriter & _rqXmlStreamWriter, CLandmarkContainer* _poLandmarkContainer ) const
{
  // GPX format reference: see http://www.topografix.com/GPX/1/1/

  // Data
  _rqXmlStreamWriter.writeStartElement( "gpx" );
  _rqXmlStreamWriter.writeAttribute( "version", "1.1" );
  _rqXmlStreamWriter.writeAttribute( "creator", "Qt Virtual Chart Table (QVCT)" );
  // ... containers
  if( _poLandmarkContainer )
  {
    _poLandmarkContainer->dumpGPX( _rqXmlStreamWriter, false );
  }
  else // no container given; assume selection dump
  {
    int __iCount = QTreeWidgetItem::childCount();
    for( int __i = 0; __i < __iCount; __i++ )
      ((CLandmarkContainer*)QTreeWidgetItem::child( __i ))->dumpGPX( _rqXmlStreamWriter, true );
  }
  // ... [end]
  _rqXmlStreamWriter.writeEndElement(); // gpx
}
Пример #21
0
bool TrackLayer::toXML(QXmlStreamWriter& stream, bool asTemplate, QProgressDialog * progress)
{
    bool OK = true;
    if (asTemplate)
        return OK;

    stream.writeStartElement(metaObject()->className());
    Layer::toXML(stream, asTemplate, progress);

    stream.writeStartElement("gpx");
    stream.writeAttribute("version", "1.1");
    stream.writeAttribute("creator", "Merkaartor");
    stream.writeAttribute("xmlns", "http://www.topografix.com/GPX/1/1");

    QList<Node*>	waypoints;
    QList<TrackSegment*>	segments;
    QList<MapFeaturePtr>::iterator it;
    for(it = p->Features.begin(); it != p->Features.end(); it++) {
        if (TrackSegment* S = CAST_SEGMENT(*it))
            segments.push_back(S);
        if (Node* P = CAST_NODE(*it))
            if (!P->tagValue("_waypoint_","").isEmpty())
                waypoints.push_back(P);
    }

    for (int i=0; i < waypoints.size(); ++i) {
        waypoints[i]->toGPX(stream, progress, "wpt");
    }

    stream.writeStartElement("trk");
    for (int i=0; i < segments.size(); ++i)
        segments[i]->toXML(stream, progress);
    stream.writeEndElement();

    stream.writeEndElement(); //gpx
    stream.writeEndElement();

    return OK;
}
Пример #22
0
void Template::saveTemplateConfiguration(QXmlStreamWriter& xml, bool open)
{
	xml.writeStartElement("template");
	xml.writeAttribute("open", open ? "true" : "false");
	xml.writeAttribute("name", getTemplateFilename());
	xml.writeAttribute("path", getTemplatePath());
	xml.writeAttribute("relpath", getTemplateRelativePath());
	if (is_georeferenced)
		xml.writeAttribute("georef", "true");
	else
	{
		xml.writeAttribute("group", QString::number(template_group));
		
		xml.writeStartElement("transformations");
		if (adjusted)
			xml.writeAttribute("adjusted", "true");
		if (adjustment_dirty)
			xml.writeAttribute("adjustment_dirty", "true");
		int num_passpoints = (int)passpoints.size();
		xml.writeAttribute("passpoints", QString::number(num_passpoints));
		
		transform.save(xml, "active");
		other_transform.save(xml, "other");
		
		for (int i = 0; i < num_passpoints; ++i)
			passpoints[i].save(xml);
		
		map_to_template.save(xml, "map_to_template");
		template_to_map.save(xml, "template_to_map");
		template_to_map_other.save(xml, "template_to_map_other");
		
		xml.writeEndElement(/*transformations*/);
	}
	
	saveTypeSpecificTemplateConfiguration(xml);
	
	if (open && hasUnsavedChanges())
	{
		// Save the template itself (e.g. image, gpx file, etc.)
		saveTemplateFile();
		setHasUnsavedChanges(false); // TODO: Error handling?
	}
	xml.writeEndElement(/*template*/);
}
Пример #23
0
void TextItem::writeExternal(QXmlStreamWriter& writer) {
    writer.writeStartElement("TextItem");

    writer.writeAttribute("xpos", QString::number(x()));
    writer.writeAttribute("ypos", QString::number(y()));
    writer.writeAttribute("width", QString::number(rect().width()));
    writer.writeAttribute("height", QString::number(rect().height()));
    writer.writeAttribute("rotation", QString::number(rotation()));
    writer.writeAttribute("background-color", brush().color().name());
    writer.writeAttribute("border-color", pen().color().name());
    writer.writeAttribute("border-style", QString::number(pen().style()));
    writer.writeAttribute("border-width", QString::number(pen().widthF()));

    writer.writeStartElement("Text");
    writer.writeAttribute("font", textItem->font().toString());
    writer.writeAttribute("align", QString::number(alignment));
    writer.writeAttribute("textColor", textItem->defaultTextColor().name());
    writer.writeCharacters(textItem->toPlainText());
    writer.writeEndElement();

    writer.writeEndElement();
}
void DrawingTwoCellAnchor::saveToXml(QXmlStreamWriter &writer) const
{
    writer.writeStartElement(QStringLiteral("xdr:twoCellAnchor"));
    writer.writeAttribute(QStringLiteral("editAs"), QStringLiteral("oneCell"));

    saveXmlMarker(writer, from, QStringLiteral("xdr:from"));
    saveXmlMarker(writer, to, QStringLiteral("xdr:to"));

    saveXmlObject(writer);

    writer.writeEmptyElement(QStringLiteral("xdr:clientData"));
    writer.writeEndElement(); //xdr:twoCellAnchor
}
Пример #25
0
void radeon_profile::writePlotAxisSchemaToXml(QXmlStreamWriter &xml, const QString side, const PlotAxisSchema &pas) {
    xml.writeStartElement("axis");
    xml.writeAttribute("align", side);
    xml.writeAttribute("enabled", QString::number(pas.enabled));
    xml.writeAttribute("unit", QString::number(pas.unit));
    xml.writeAttribute("ticks", QString::number(pas.ticks));
    xml.writeAttribute("penStyle", QString::number(pas.penGrid.style()));
    xml.writeAttribute("penWidth", QString::number(pas.penGrid.width()));
    xml.writeAttribute("penColor", pas.penGrid.color().name());
    xml.writeEndElement();

    for (const ValueID &sk : pas.dataList.keys()) {
        xml.writeStartElement("serie");
        xml.writeAttribute("align", side);
        xml.writeAttribute("id", QString::number(sk));
        xml.writeAttribute("color", pas.dataList.value(sk).name());
        xml.writeEndElement();
    }
}
Пример #26
0
void ObjectCreatingUndoStep::saveImpl(QXmlStreamWriter& xml) const
{
	ObjectModifyingUndoStep::saveImpl(xml);
	
	xml.writeStartElement(QLatin1String("contained_objects"));
	int size = (int)objects.size();
	xml.writeAttribute(QLatin1String("count"), QString::number(size));
	for (int i = 0; i < size; ++i)
	{
		objects[i]->setMap(map);	// IMPORTANT: only if the object's map pointer is set it will save its symbol index correctly
		objects[i]->save(xml);
	}
	xml.writeEndElement(/*contained_objects*/);
}
Пример #27
0
bool Projection::toXML(QXmlStreamWriter& stream)
{
    bool OK = true;

    stream.writeStartElement("Projection");
    stream.writeAttribute("type", p->projType);
    if (!p->IsLatLong && !p->IsMercator && !p->projProj4.isEmpty()) {
        stream.writeCharacters(p->projProj4);
    }
    stream.writeEndElement();


    return OK;
}
void GraphicsTransition::writeXml(QXmlStreamWriter &writer){

    writer.writeStartElement("transition");
    writer.writeAttribute("target", mNextState->getId());


    //TODO for Each condition
    writer.writeStartElement("conditions");
    mCondition->writeXml(writer);
    writer.writeEndElement();


    writer.writeEndElement();
}
Пример #29
0
void XmlWriter::writeVariant( QXmlStreamWriter &stream, const QVariant &value )
{
    ASSERT_LIMITED_VARIANT( value );

    if( value.isNull() || value.type() == QVariant::Invalid ) {
        stream.writeEmptyElement( "nil" );
    } else if( value.type() == QVariant::Bool ) {
        stream.writeTextElement( "boolean", value.toBool() ? "true" : "false" );
    } else if( value.type() == QVariant::ByteArray ) {
        stream.writeTextElement( "base64", value.toByteArray().toBase64() );
    } else if( value.type() == QVariant::Color ) {
        writeColor( stream, value.value<QColor>() );
    } else if( value.type() == QVariant::Date ) {
        stream.writeTextElement( "date", value.toDate().toString( Qt::ISODate ) );
    } else if( value.type() == QVariant::DateTime ) {
        stream.writeTextElement( "datetime", value.toDateTime().toString( Qt::ISODate ) );
    } else if( value.type() == QVariant::Double ) {
        stream.writeTextElement( "double", QString::number( value.toDouble() ) );
    } else if( value.type() == QVariant::Hash ) {
        QHash<QString, QVariant> hash = value.toHash();
        QHashIterator<QString, QVariant> it( hash );

        stream.writeStartElement( "map" );
        stream.writeAttribute( "type", "hash" );
        while( it.hasNext() ) {
            it.next();
            stream.writeStartElement( "item" );
            stream.writeTextElement( "key", it.key() );
            stream.writeStartElement( "value" );
            writeVariant( stream, it.value() );
            stream.writeEndElement(); // value
            stream.writeEndElement(); // item
        }
        stream.writeEndElement();
    } else if( value.type() == QVariant::Image ) {
        QByteArray ba;
        QBuffer buffer( &ba );
        buffer.open( QIODevice::WriteOnly );
        value.value<QImage>().save( &buffer, "PNG" );
        buffer.close();

        stream.writeTextElement( "image", ba.toBase64() );
    } else if( value.type() == QVariant::Int ) {
        stream.writeTextElement( "int", QString::number( value.toInt() ) );
    } else if( value.type() == QVariant::List ) {
        stream.writeStartElement( "list" );
        const QVariantList list = value.toList();
        foreach( const QVariant & var, list ) {
            writeVariant( stream, var );
        }
Пример #30
0
void XmlWriter::writePosting( QXmlStreamWriter &stream, const Posting *posting )
{
    Q_ASSERT( posting );

    stream.writeStartElement( "posting" );
    stream.writeAttribute( "id", QString::number( postingIdentifier( posting ) ) );

    writeBasePosting( stream, posting );

    for( int i = 0; i < posting->countSubPostings(); ++i ) {
        writeSubPosting( stream, posting->subPosting( i ) );
    }
    stream.writeEndElement(); // posting
}