当前位置: 首页>>代码示例>>C++>>正文


C++ QXmlStreamWriter::writeAttribute方法代码示例

本文整理汇总了C++中QXmlStreamWriter::writeAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlStreamWriter::writeAttribute方法的具体用法?C++ QXmlStreamWriter::writeAttribute怎么用?C++ QXmlStreamWriter::writeAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QXmlStreamWriter的用法示例。


在下文中一共展示了QXmlStreamWriter::writeAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

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>
    }
}
开发者ID:vishnucool220,项目名称:QuickQanava,代码行数:20,代码来源:qanProperties.cpp

示例2: saveXml

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();
}
开发者ID:keszybz,项目名称:engauge6,代码行数:11,代码来源:CurveStyle.cpp

示例3: save

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();
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:20,代码来源:editablematrix.cpp

示例4: dump_to_xml

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
}
开发者ID:otso,项目名称:Push-Snowboarding,代码行数:20,代码来源:npushnormfeettick.cpp

示例5: save

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();
       }
开发者ID:Chewnonobelix,项目名称:ProduitMedia,代码行数:12,代码来源:media.cpp

示例6: exportXml

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();
}
开发者ID:zinspierre,项目名称:ProjectCalendar_LO21,代码行数:12,代码来源:programmationevenementplsj.cpp

示例7: toXML

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;
}
开发者ID:chxyfish,项目名称:merkaartor,代码行数:21,代码来源:Node.cpp

示例8: vss

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 );
    }
}
开发者ID:vishnucool220,项目名称:QuickQanava,代码行数:21,代码来源:qanProperties.cpp

示例9: createBusNode

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();
}
开发者ID:fourbytes,项目名称:qlcplus,代码行数:12,代码来源:doc_test.cpp

示例10: lock

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();
}
开发者ID:Giladx,项目名称:vlmc,代码行数:21,代码来源:EffectUser.cpp

示例11: writeFolderIds

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();
    }
}
开发者ID:KrissN,项目名称:akonadi-ews,代码行数:31,代码来源:ewsid.cpp

示例12: metaObject

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>
}
开发者ID:vishnucool220,项目名称:QuickQanava,代码行数:40,代码来源:qanProperties.cpp

示例13: save

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");
}
开发者ID:999999333,项目名称:mapper,代码行数:14,代码来源:map_grid.cpp

示例14: writeBench

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();
}
开发者ID:lrunze,项目名称:MyDocuments,代码行数:40,代码来源:GaussianBeamSave.cpp

示例15: writeFrameFormat

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
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:27,代码来源:qtextodfwriter.cpp


注:本文中的QXmlStreamWriter::writeAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。